]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
9 years agoMove OFED init a bit earlier so that PXE boot works.
hselasky [Tue, 9 Dec 2014 08:56:01 +0000 (08:56 +0000)]
Move OFED init a bit earlier so that PXE boot works.

MFC after: 3 days
Sponsored by: Mellanox Technologies

9 years agoPull in r223171 from upstream llvm trunk (by Michael Zolotukhin):
dim [Tue, 9 Dec 2014 07:34:28 +0000 (07:34 +0000)]
Pull in r223171 from upstream llvm trunk (by Michael Zolotukhin):

  PR21302. Vectorize only bottom-tested loops.

  rdar://problem/18886083

This fixes a bug in the llvm vectorizer, which could sometimes cause
vectorized loops to perform an additional iteration, leading to possible
buffer overruns.  Symptoms of this, which are usually segfaults, were
first noticed when building gcc ports, here:

https://lists.freebsd.org/pipermail/freebsd-ports/2014-September/095466.html
https://lists.freebsd.org/pipermail/freebsd-toolchain/2014-September/001211.html

Since this fix is very important for ports, bump __FreeBSD_version to
make it easier for port maintainers to test whether the fix has been
applied.

Upstream PR: http://llvm.org/PR21302
MFC after: 3 days

9 years agoAdd port routing support for Wildcat Point.
hselasky [Mon, 8 Dec 2014 21:14:13 +0000 (21:14 +0000)]
Add port routing support for Wildcat Point.

PR: 195793
MFC after: 1 week

9 years agoAdd makewhatis to ITOOLS if MK_MAN != no
ngie [Mon, 8 Dec 2014 18:29:20 +0000 (18:29 +0000)]
Add makewhatis to ITOOLS if MK_MAN != no

This will fix installation with differing host targets in installworld, so
one can build i386/i386 on an amd64 host, then install to an i386/i386 target

Reported by: alfred
Phabric: D1280
MFC after: 1 week

9 years agoAdd -lxo (for df) and -lgpio(for gpioctl) to bsdbox. This will allow the picostation
sbruno [Mon, 8 Dec 2014 17:14:01 +0000 (17:14 +0000)]
Add -lxo (for df) and -lgpio(for gpioctl) to bsdbox.  This will allow the picostation
build to work again.

Reviewed by: adrian

9 years agoAdd functions syncer_suspend() and syncer_resume(), which are supposed
kib [Mon, 8 Dec 2014 16:48:57 +0000 (16:48 +0000)]
Add functions syncer_suspend() and syncer_resume(), which are supposed
to be called before suspension and after resume, correspondingly.  The
syncer_suspend() ensures that all filesystems dirty data and metadata
are saved to the permanent storage, and stops kernel threads which
might modify filesystems.  The syncer_resume() restores stopped
threads.

For now, only syncer is stopped.  This is needed, because each sync
loop causes superblock updates for UFS.

Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

9 years agoWhen getnewbuf_reuse_bp() is called to reclaim some (clean) buffer,
kib [Mon, 8 Dec 2014 16:42:34 +0000 (16:42 +0000)]
When getnewbuf_reuse_bp() is called to reclaim some (clean) buffer,
the vnode owning the buffer is not locked.  More, it cannot be locked
safely, since getnewbuf_reuse_bp() is called from newbuf(), and some
other vnode is already locked, for which reused buffer will be
reassigned.

As the consequence, reclamation of the owning vnode could go in
parallel, in particular, the call to vnode_destroy_vobject(), which
deallocates the vm object and zeroes the v_bufobj->bo_object.  Note
that the pages wired by the buffer are left wired and can be safely
freed by the vfs_vmio_release() without the need for the vm object
lock.  Also, seeing stale pointer to the v_object is safe due to vm
object type stability.

Check for bo_bufobj != NULL and cache the value in local variable to
avoid trying to lock NULL vm object.

Reported and tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

9 years agoCurrent reaction of the nfsd worker threads to any signal is exit.
kib [Mon, 8 Dec 2014 16:33:18 +0000 (16:33 +0000)]
Current reaction of the nfsd worker threads to any signal is exit.
This is not correct at least for the stop requests.  Check for stop
conditions and suspend threads if requested.

Reported and tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

9 years agoDo some refactoring and minor cleanups of the thread_single() code in
kib [Mon, 8 Dec 2014 16:27:43 +0000 (16:27 +0000)]
Do some refactoring and minor cleanups of the thread_single() code in
preparation for the global stop commit.

Move the code to weed suspended or sleeping threads into the
appropriate state, into the helper weed_inhib().  Current code already
has deep nesting and hard to follow [1].

Add currently useless helper remain_for_mode(), which returns the
count of threads which are allowed to run, according to the
single-threading mode.

In thread_single_end(), do not save curthread into local variable, it
is unused after, except to find curproc.

Remove stray empty line.

Requested by: avg [1]
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

9 years agoThread waiting for the vfork(2)-ed child to exec or exit, must allow
kib [Mon, 8 Dec 2014 16:18:05 +0000 (16:18 +0000)]
Thread waiting for the vfork(2)-ed child to exec or exit, must allow
for the suspension.

Currently, the loop performs uninterruptible cv_wait(9) call, which
prevents suspension until child allows further execution of parent.
If child is stopped, suspension or single-threading is delayed
indefinitely.

Create a helper thread_suspend_check_needed() to identify the need for
a call to thread_suspend_check().  It is required since call to the
thread_suspend_check() cannot be safely done while owning the child
(p2) process lock.  Only when suspension is needed, drop p2 lock and
call thread_suspend_check().  Perform wait for cv with timeout, in
case suspend is requested after wait started; I do not see a better
way to interrupt the wait.

Reported and tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

9 years agoWhen process is exiting, check for suspension regardless of
kib [Mon, 8 Dec 2014 16:02:02 +0000 (16:02 +0000)]
When process is exiting, check for suspension regardless of
multithreaded status of the process.

The stopped state must be cleared before P_WEXIT is set.  A stop
signal delivered just before first PROC_LOCK() block in exit1(9) would
put the process into pending stop with P_WEXIT set or assertion
triggered.  Also recheck for the suspension after failed
thread_single(9) call, since process lock could be dropped.

Reported and tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

9 years agoAdjust the |x| small limit from 0x1p-7 to 0x1p-9. This
kargl [Mon, 8 Dec 2014 15:47:52 +0000 (15:47 +0000)]
Adjust the |x| small limit from 0x1p-7 to 0x1p-9.  This
adjustment increases the number of correctly rounded
cases within the interval on i386.

Requested by: bde

9 years agoAdjust the 'Relnotes:' search to look for any non-empty
gjb [Mon, 8 Dec 2014 15:45:07 +0000 (15:45 +0000)]
Adjust the 'Relnotes:' search to look for any non-empty
string following the tag.

Sponsored by: The FreeBSD Foundation

9 years agopatch(1): avoid line number overflows
pfg [Mon, 8 Dec 2014 15:10:48 +0000 (15:10 +0000)]
patch(1): avoid line number overflows

Introduce strtolinenum to properly check line numbers while parsing:
no signs, no spaces, just digits, 0 <= x <= LONG_MAX

Properly validate line ranges supplied in diff file to prevent overflows.
Also fixes an out of boundary memory access because the resulting values
are used as array indices.

PR: 195436
Obtained from: OpenBSD (CVS pch.c rev 1.45, 1,46, common.h rev 1.28)
MFC after: 1 week

9 years agoAdd more U3G USB IDs.
hselasky [Mon, 8 Dec 2014 10:49:23 +0000 (10:49 +0000)]
Add more U3G USB IDs.

Submitted by: Benediktus Anindito <bennybroz105@gmail.com>
MFC after: 1 week

9 years agoAdd more USB quirks for Western Digital external USB HDD
hselasky [Mon, 8 Dec 2014 10:41:34 +0000 (10:41 +0000)]
Add more USB quirks for Western Digital external USB HDD
enclosures. Rename an incorrectly named device. Increase
limit for maximum number of quirks.

PR:     178771, 180617
MFC after:  2 weeks

9 years agoBuild gperf with xdev as part of _xb-bootstrap-tools
ngie [Mon, 8 Dec 2014 09:09:50 +0000 (09:09 +0000)]
Build gperf with xdev as part of _xb-bootstrap-tools

This will unbreak the build when "env MK_CXX=no make delete-old" has been run
on the build host post-r272849

Tested with the following commands:

/bin/sh
export __MAKE_CONF=/dev/null SRCCONF=/dev/null
export MK_CLANG=no MK_CLANG_BOOTSTRAP=no MK_GCC=yes MK_GCC_BOOTSTRAP=yes
export MK_GNUCXX=yes TARGET=armv6 TARGET_ARCH=arm make xdev
make toolchain
make xdev-build
sudo -E make xdev-install
/usr/armv6-freebsd/usr/bin/cc -dumpmachine | grep arm

X-MFC with: r272849
Reported by: Dan Raymond <draymond@foxvalley.net>, gjb

9 years agoUse CURVNET macros inside inet_get_local_port_range() function.
rodrigc [Mon, 8 Dec 2014 07:25:59 +0000 (07:25 +0000)]
Use CURVNET macros inside inet_get_local_port_range() function.
Without this fix, a kernel with VIMAGE + Infiniband will panic on bootup.

Certain necessary #include statements require LIST_HEAD.
Add these includes to ofed/include/linux/list.h, because
LIST_HEAD is specifically overridden in this file.

PR: 191468
Differential Revision: D1279
Reviewed by: hselasky

9 years agoUse calloc() instead of malloc() + bzero(). This also gets rid of a warning
delphij [Mon, 8 Dec 2014 06:10:47 +0000 (06:10 +0000)]
Use calloc() instead of malloc() + bzero().  This also gets rid of a warning
because bzero is defined by strings.h which is not included in thread_pool.c.

MFC after: 2 weeks

9 years agoMFV r275540:
delphij [Mon, 8 Dec 2014 06:04:42 +0000 (06:04 +0000)]
MFV r275540:

When importing a pool, don't assume that the passed pool configuration
at vdev_load is always vaild.  It's possible that a stale configuration
that comes with extra vdevs, where metaslab_init() would fail because
of lower layer returns error.

Change the code to make metaslab_init() handle and return errors from
lower layer and pass it back to upper layer and handle it there.

Illumos issue:
    5213 panic in metaslab_init due to space_map_open returning ENXIO

MFC after: 2 weeks

9 years agoAdd refcounting to IPv6 DAD objects and simplify the DAD code to fix a
markj [Mon, 8 Dec 2014 04:44:40 +0000 (04:44 +0000)]
Add refcounting to IPv6 DAD objects and simplify the DAD code to fix a
number of races which could cause double frees or use-after-frees when
performing DAD on an address. In particular, an IPv6 address can now only be
marked as a duplicate from the DAD callout.

Differential Revision: https://reviews.freebsd.org/D1258
Reviewed by: ae, hrs
Reported by: rstone
MFC after: 1 month

9 years agoMFV r272851:
markj [Mon, 8 Dec 2014 04:35:34 +0000 (04:35 +0000)]
MFV r272851:

5202 want ctf(4)

illumos/illumos-gate@fe2e029eea29fd49d0d9058dbd5b79a252667e6b

9 years agoDocument support for Netgear WG111v1 (rev2)
mp [Mon, 8 Dec 2014 04:06:03 +0000 (04:06 +0000)]
Document support for Netgear WG111v1 (rev2)

9 years agoThe previous commit should have been a logical or not a logical "and"
ngie [Mon, 8 Dec 2014 03:32:26 +0000 (03:32 +0000)]
The previous commit should have been a logical or not a logical "and"

Pointyhat to: me

9 years ago${CC} --version doesn't need to be queried if both COMPILER_TYPE and
ngie [Mon, 8 Dec 2014 03:30:42 +0000 (03:30 +0000)]
${CC} --version doesn't need to be queried if both COMPILER_TYPE and
COMPILER_VERSION are known

9 years agoFix mrc and mrc2 with APSR_nzcv. Binutils encodes it internally as 0 where
andrew [Sun, 7 Dec 2014 21:47:19 +0000 (21:47 +0000)]
Fix mrc and mrc2 with APSR_nzcv. Binutils encodes it internally as 0 where
we need it to be set to 15 for it to be equivalent to r15.

MFC after: 1 week
X-MFC with: r275415
Sponsored by: ABT Systems Ltd

9 years agoFix buffer overflow in Marvell PCI/PCIe driver
zbb [Sun, 7 Dec 2014 21:02:45 +0000 (21:02 +0000)]
Fix buffer overflow in Marvell PCI/PCIe driver

Buffer overflow occured when more than one MSI was allocated.

Submitted by:    Wojciech Macek <wma@semihalf.com>
Obtained from:   Semihalf

9 years agoSmall space changes
pfg [Sun, 7 Dec 2014 20:32:24 +0000 (20:32 +0000)]
Small space changes

Mostly to keep in sync with OpenBSD and update the TAG.

Obtained from: OpenBSD
MFC after: 5 days

9 years agoPrefer setvbuf() to setlinebuf().
pfg [Sun, 7 Dec 2014 20:15:07 +0000 (20:15 +0000)]
Prefer setvbuf() to setlinebuf().

On FreeBSD's libc setlinebuf is a wrapper to setvbuf anyways.

Obtained from: OpenBSD
MFC after: 5 days

9 years agoMFV r275537:
delphij [Sun, 7 Dec 2014 18:15:27 +0000 (18:15 +0000)]
MFV r275537:

Illumos issue:
   5316 allow smbadm join to use RPC

(Due to our lack of smbsrv this is mostly no-op on
FreeBSD)

MFC after: 2 weeks

9 years agoremove opensolaris cyclic code, replace with high-precision callouts
avg [Sun, 7 Dec 2014 11:21:41 +0000 (11:21 +0000)]
remove opensolaris cyclic code, replace with high-precision callouts

In the old days callout(9) had 1 tick precision and that was inadequate
for some uses, e.g. DTrace profile module, so we had to emulate cyclic
API and behavior.  Now we can directly use callout(9) in the very few
places where cyclic was used.

Differential Revision: https://reviews.freebsd.org/D1161
Reviewed by: gnn, jhb, markj
MFC after: 2 weeks

9 years agokey_getspacq() returns holding the spacq_lock. Unlock it in all cases.
ae [Sun, 7 Dec 2014 06:47:00 +0000 (06:47 +0000)]
key_getspacq() returns holding the spacq_lock. Unlock it in all cases.

MFC after: 1 week
Sponsored by: Yandex LLC

9 years agoInclude the received chunk padding when reporting an unknown chunk.
tuexen [Sat, 6 Dec 2014 22:57:19 +0000 (22:57 +0000)]
Include the received chunk padding when reporting an unknown chunk.
MFC after: 1 week

9 years agoFix rendering
bapt [Sat, 6 Dec 2014 22:28:51 +0000 (22:28 +0000)]
Fix rendering

9 years agoAdd myself as a ports committer, mentored by bapt/bdrewery.
sbruno [Sat, 6 Dec 2014 22:03:12 +0000 (22:03 +0000)]
Add myself as a ports committer, mentored by bapt/bdrewery.

9 years agoUpdate to reflect the current members of portmgr
bapt [Sat, 6 Dec 2014 21:55:18 +0000 (21:55 +0000)]
Update to reflect the current members of portmgr

9 years agoadd some missing mentor->mentee relationship
bapt [Sat, 6 Dec 2014 21:50:35 +0000 (21:50 +0000)]
add some missing mentor->mentee relationship

9 years agoAdd mentor information for kami a.k.a. me.
kami [Sat, 6 Dec 2014 21:34:37 +0000 (21:34 +0000)]
Add mentor information for kami a.k.a. me.

My mentors are cs and koobs.

Differential Revision: https://reviews.freebsd.org/D975
Reviewed by: cs
Approved by: cs

9 years agoCount consecutive read requests as blocking in CTL for files and ZVOLs.
mav [Sat, 6 Dec 2014 20:39:25 +0000 (20:39 +0000)]
Count consecutive read requests as blocking in CTL for files and ZVOLs.

Technically read requests can be executed in any order or simultaneously
since they are not changing any data.  But ZFS prefetcher goes crasy when
it receives consecutive requests from different threads.  Since prefetcher
works on level of separate blocks, instead of two consecutive 128K requests
it may receive 32 8K requests in mixed order.

This patch is more workaround then a real fix, and it does not fix all of
prefetcher problems, but it improves sequential read speed by 3-4x times
in some configurations.  On the other side it may hurt performance if
some backing store has no prefetch, that is why it is disabled by default
for raw devices.

MFC after: 2 weeks

9 years agoFix the support of mapped IPv4 addresses.
tuexen [Sat, 6 Dec 2014 20:00:08 +0000 (20:00 +0000)]
Fix the support of mapped IPv4 addresses.
Thanks to Mark Bonnekessel and Markus Boese for making me aware of the
problems.
MFC after: 1 week

9 years agoApply the same fix in r274697 to the ARM case.
andrew [Sat, 6 Dec 2014 12:03:09 +0000 (12:03 +0000)]
Apply the same fix in r274697 to the ARM case.

9 years agoUse the unified syntax when generating assembly for clang. The clang 3.5
andrew [Sat, 6 Dec 2014 11:59:35 +0000 (11:59 +0000)]
Use the unified syntax when generating assembly for clang. The clang 3.5
integrated assembler only accepts it.

MFC after: 1 week
Sponsored by: ABT Systems Ltd

9 years agoMFV r275536:
delphij [Sat, 6 Dec 2014 10:05:07 +0000 (10:05 +0000)]
MFV r275536:

Illumos issue:
    3363 Mark non-returning functions in ctftools

MFC after: 2 weeks

9 years agoMFV r275535:
delphij [Sat, 6 Dec 2014 09:38:28 +0000 (09:38 +0000)]
MFV r275535:

Unexpand ISP2() and MSEC2NSEC().

Illumos issue:
    5255 uts shouldn't open-code ISP2

MFC after: 2 weeks

9 years agoMFV r275534:
delphij [Sat, 6 Dec 2014 09:14:46 +0000 (09:14 +0000)]
MFV r275534:

Sync with Illumos.  This have no effect to FreeBSD.

Illumos issue:
    5285 pass in cpu_pause_func via pause_cpus

MFC after: 2 weeks

9 years agoMFC r275533:
delphij [Sat, 6 Dec 2014 09:11:13 +0000 (09:11 +0000)]
MFC r275533:

Sync with Illumos.  This have no effect to FreeBSD.

Illumos issue:
    5100 sparc build failed after 5004

MFC after: 2 weeks

9 years agoFix typos in comments and wrap to <80 columns
ngie [Sat, 6 Dec 2014 03:15:46 +0000 (03:15 +0000)]
Fix typos in comments and wrap to <80 columns

MFC after: 3 days

9 years agoMFp4: @181627
rodrigc [Sat, 6 Dec 2014 02:59:59 +0000 (02:59 +0000)]
MFp4: @181627

Allow UMA allocated memory to be freed when VNET jails are torn down.

Differential Revision: D1201
Submitted by: bz
Reviewed by: rwatson, gnn

9 years agocxgbe(4): allow the driver to use rx buffers that do not end on a pack
np [Sat, 6 Dec 2014 01:47:38 +0000 (01:47 +0000)]
cxgbe(4): allow the driver to use rx buffers that do not end on a pack
boundary.

MFC after: 2 weeks

9 years agoMerge fixes from OpenBSD.
pfg [Sat, 6 Dec 2014 01:21:12 +0000 (01:21 +0000)]
Merge fixes from OpenBSD.

Check fstat return value.  Also, use off_t for file size and offsets.
Avoid iterating over end of string.

Obtained from: OpenBSD (CVS rev. 1.41, 1.43)
MFC after: 1 week

9 years agoMFV r260710 + 275532:
delphij [Sat, 6 Dec 2014 01:01:51 +0000 (01:01 +0000)]
MFV r260710 + 275532:

Add a new method, nvlist_print_json to allow libnvpair to emit JSON.

MFC after: 1 month

9 years ago5314 Remove "dbuf phys" db->db_data pointer aliases in ZFS
delphij [Sat, 6 Dec 2014 00:50:57 +0000 (00:50 +0000)]
5314 Remove "dbuf phys" db->db_data pointer aliases in ZFS
Reviewed by: Andriy Gapon <avg@freebsd.org>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Will Andrews <willa@spectralogic.com>
Approved by: Dan McDonald <danmcd@omniti.com>
Author: Justin T. Gibbs <justing@spectralogic.com>

illumos/illumos-gate@c1379625401dfbe1c39b79136dd384a571d47fde

9 years ago4181 zfs(1m): 'zfs allow' examples in the man page are outdated
delphij [Sat, 6 Dec 2014 00:38:55 +0000 (00:38 +0000)]
4181 zfs(1m): 'zfs allow' examples in the man page are outdated
Reviewed by: Richard Lowe <richlowe@richlowe.net>
Reviewed by: Gordon Ross <gordon.ross@nexenta.com>
Reviewed by: Yuri Pankov <yuri.pankov@nexenta.com>
Approved by: Dan McDonald <danmcd@omniti.com>
Author: Marcel Telka <marcel.telka@nexenta.com>

illumos/illumos-gate@5619b3f84733e187bc34bca49abbec8bdfcd7d99

9 years ago5312 libzfs should be decoupled from kernel's zfs_context.h
delphij [Sat, 6 Dec 2014 00:17:25 +0000 (00:17 +0000)]
5312 libzfs should be decoupled from kernel's zfs_context.h
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Will Andrews <willa@spectralogic.com>
Reviewed by: Andriy Gapon <avg@FreeBSD.org>
Approved by: Dan McDonald <danmcd@omniti.com>
Author: Justin T. Gibbs <justing@spectralogic.com>

illumos/illumos-gate@587644a8567e6a9533f88401daa59cbd78c4632f

9 years agocxgbe(4): Allow for different pad and pack boundaries for different
np [Sat, 6 Dec 2014 00:13:56 +0000 (00:13 +0000)]
cxgbe(4): Allow for different pad and pack boundaries for different
adapters.  Set the pack boundary for T5 cards to be the same as the
PCIe max payload size.  The chip likes it this way.

In this revision the driver allocate rx buffers that align on both
boundaries.  This is not a strict requirement and a followup commit
will switch the driver to a more relaxed allocation strategy.

MFC after: 2 weeks

9 years ago5316 allow smbadm join to use RPC
delphij [Sat, 6 Dec 2014 00:10:47 +0000 (00:10 +0000)]
5316 allow smbadm join to use RPC
Reviewed by: Bayard Bell <bayard.bell@nexenta.com>
Reviewed by: Dan McDonald <danmcd@nexenta.com>
Reviewed by: Thomas Keiser <thomas.keiser@nexenta.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Gordon Ross <gwr@nexenta.com>

illumos/illumos-gate@1ed6b69a5ca1ca3ee5e9a4931f74e2237c7e1c9f

9 years ago3363 Mark non-returning functions in ctftools
delphij [Sat, 6 Dec 2014 00:01:19 +0000 (00:01 +0000)]
3363 Mark non-returning functions in ctftools
Reviewed by: Richard Lowe <richlowe@richlowe.net>
Reviewed by: Josef 'Jeff' Sipek <josef.sipek@nexenta.com>
Approved by: Albert Lee <trisk@omniti.com>
Author: Erik Cederstrand <erik@cederstrand.dk>

illumos/illumos-gate@a6bde1a23b60f140c7ed78df979c2e22b1ed9b2c

9 years ago5005 libnvpair JSON output broken by lint fixes
delphij [Fri, 5 Dec 2014 23:43:15 +0000 (23:43 +0000)]
5005 libnvpair JSON output broken by lint fixes
5006 libnvpair JSON cannot print int16 arrays
Reviewed by: Robert Mustacchi <rm@joyent.com>
Approved by: Gordon Ross <gwr@nexenta.com>
Author: Joshua M. Clulow <josh@sysmgr.org>

illumos/illumos-gate@37c79205ad46187f54b2edbf6a468160935f14d9

9 years agoUpdate OpenBSD CVS revision for our r255232.
pfg [Fri, 5 Dec 2014 23:08:39 +0000 (23:08 +0000)]
Update OpenBSD CVS revision for our r255232.

This is a no-op to make it easier to track changes from OpenBSD

MFC after: 3 days

9 years agoUse %d instead of %u for error number. This way we see ERESTART as -1
delphij [Fri, 5 Dec 2014 22:56:10 +0000 (22:56 +0000)]
Use %d instead of %u for error number.  This way we see ERESTART as -1
not 4294967295 when doing DTrace.

MFC after: 2 weeks

9 years agoSwitch to a .cpu directive. These will work when clang 3.5 is imported
andrew [Fri, 5 Dec 2014 19:23:51 +0000 (19:23 +0000)]
Switch to a .cpu directive. These will work when clang 3.5 is imported
where the .arch directive is a nop.

MFC after: 1 week
Sponsored by: ABT Systems Ltd

9 years agoSwitch to an armv6k cpu, without this clang 3.5 complains "bx lr" is
andrew [Fri, 5 Dec 2014 19:19:17 +0000 (19:19 +0000)]
Switch to an armv6k cpu, without this clang 3.5 complains "bx lr" is
unsupported as it needs a newer cpu.

MFC after: 1 week
Sponsored by: ABT Systems Ltd

9 years agoPlace the literal pool after a RET otherwise clang 3.5 tries to put it too
andrew [Fri, 5 Dec 2014 19:14:05 +0000 (19:14 +0000)]
Place the literal pool after a RET otherwise clang 3.5 tries to put it too
far away from a ldr psuedo instruction. With this clang will place the
literal value here where it's close enough to be loaded.

MFC after: 1 week
Sponsored by: ABT Systems Ltd

9 years agoSet the alignment to 4-bytes after a string as clang 3.5 can switch to
andrew [Fri, 5 Dec 2014 19:11:25 +0000 (19:11 +0000)]
Set the alignment to 4-bytes after a string as clang 3.5 can switch to
thumb mode if this is incorrect.

MFC after: 1 week
Sponsored by: ABT Systems Ltd

9 years agoUse the unified syntax in a few more assembly files
andrew [Fri, 5 Dec 2014 19:08:36 +0000 (19:08 +0000)]
Use the unified syntax in a few more assembly files

MFC after: 1 week
Sponsored by: ABT Systems Ltd

9 years agoAdd missing END macros to some of the xscale functions.
andrew [Fri, 5 Dec 2014 19:04:08 +0000 (19:04 +0000)]
Add missing END macros to some of the xscale functions.

MFC after: 1 week
Sponsored by: ABT Systems Ltd

9 years agoUpdate the constants associated with the evaluation of j0f(x)
kargl [Fri, 5 Dec 2014 19:00:55 +0000 (19:00 +0000)]
Update the constants associated with the evaluation of j0f(x)
for |x| small.

While here, remove the explicit cast of 0.25 to float.  Replace
a multiplication involving 0.25 by a division using an integer
constant 4.  Make a similar change in j0() to minimize the diff.

Suggested by: bde

9 years agoFix a regression introduced in r274337 (large block support)
delphij [Fri, 5 Dec 2014 18:29:01 +0000 (18:29 +0000)]
Fix a regression introduced in r274337 (large block support)

In dsl_dataset_hold_obj() we used zap_contains(.., DS_FIELD_LARGE_BLOCKS)
to determine whether the extensible (zapifyed) dataset have large blocks.
The code expects the result be either 0 (found) or ENOENT (not found),
however reused the variable 'err' which later code expects to be 0.

Fix this by adopting similar code construct that is used later for
DS_FIELD_BOOKMARK_NAMES, which uses a temporary variable zaperr to catch
errors from zap_* rountines.

Reported by: Peter J. Creath (on FreeNAS; FreeNAS bug #6848)
Illumos issue: 5393 spurious failures from dsl_dataset_hold_obj()
Reviewed by: mahrens
Sponsored by: iXsystems, Inc.
X-MFC with: r274337

9 years agoAlways ignore the deprecated MAP_RENAME and MAP_NORESERVE flags to mmap().
jhb [Fri, 5 Dec 2014 15:24:42 +0000 (15:24 +0000)]
Always ignore the deprecated MAP_RENAME and MAP_NORESERVE flags to mmap().
Some old libraries may be used even with newer binaries (specifically the
Nvidia driver libraries).

Differential Revision: https://reviews.freebsd.org/D1262
Reviewed by: kib

9 years agoWhen the last reference on the vnode' vm object is dropped, read the
kib [Fri, 5 Dec 2014 15:02:30 +0000 (15:02 +0000)]
When the last reference on the vnode' vm object is dropped, read the
vp->v_vflag without taking vnode lock and without bypass.  We do know
that vp is the lowest level in the stack, since the pointer is
obtained from the object' handle.  Stale VV_TEXT flag read can only
happen if parallel execve() is performed and not yet activated the
image, since process takes reference for text mapping.  In this case,
the execve() code manages the VV_TEXT flag on its own already.

It was observed that otherwise read-only sendfile(2) requires
exclusive vnode lock and contending on it on some loads for VV_TEXT
handling.

Reported by: glebius, scottl
Tested by: glebius, pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

9 years agoIn addition to r275481 allow threshold notifications work without UNMAP.
mav [Fri, 5 Dec 2014 13:30:45 +0000 (13:30 +0000)]
In addition to r275481 allow threshold notifications work without UNMAP.

While without UNMAP support there is not much initiator can do about it,
the administrator still better be notified about the storage overflow.

MFC after: 2 weeks
Sponsored by: iXsystems, Inc.

9 years agoMove iscsi.conf.5 from sbin/iscontrol/ to usr.bin/iscsictl/, as the
trasz [Fri, 5 Dec 2014 12:38:01 +0000 (12:38 +0000)]
Move iscsi.conf.5 from sbin/iscontrol/ to usr.bin/iscsictl/, as the
former is obsolete.

MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation

9 years agoOptimise bit searching loop by using the ffs() function.
hselasky [Fri, 5 Dec 2014 12:07:53 +0000 (12:07 +0000)]
Optimise bit searching loop by using the ffs() function.
Make some related bit shifts unsigned while at it.

9 years agoDefine the ffs() function in the USB bootloader's global and
hselasky [Fri, 5 Dec 2014 12:04:47 +0000 (12:04 +0000)]
Define the ffs() function in the USB bootloader's global and
independent header file.

9 years agoAvoid unneeded malloc/memcpy/free if there is no metadata on disk.
mav [Fri, 5 Dec 2014 10:23:18 +0000 (10:23 +0000)]
Avoid unneeded malloc/memcpy/free if there is no metadata on disk.

Submitted by: Dmitry Luhtionov <dmitryluhtionov@gmail.com>
MFC after: 2 weeks

9 years agoThis is the SCTP specific companion of
tuexen [Thu, 4 Dec 2014 21:17:50 +0000 (21:17 +0000)]
This is the SCTP specific companion of
https://svnweb.freebsd.org/changeset/base/275358
which was provided by Hans Petter Selasky.

9 years agoDocument r275481 changes.
mav [Thu, 4 Dec 2014 19:08:05 +0000 (19:08 +0000)]
Document r275481 changes.

MFC after: 2 weeks

9 years agoAdd to CTL support for threshold notifications for file-backed LUNs.
mav [Thu, 4 Dec 2014 18:37:42 +0000 (18:37 +0000)]
Add to CTL support for threshold notifications for file-backed LUNs.

Previously it was supported only for ZVOL-backed LUNs, but now should work
for file-backed LUNs too.  Used value in this case is a space occupied by
the backing file, while available value is an available space on file
system.  Pool thresholds are still not implemented in this case.

MFC after: 2 weeks
Sponsored by: iXsystems, Inc.

9 years agoAdd MLINKs for all functions described in the libxo manpages.
brueffer [Thu, 4 Dec 2014 18:23:13 +0000 (18:23 +0000)]
Add MLINKs for all functions described in the libxo manpages.

9 years agoSwap resource count scopes for used/available space.
mav [Thu, 4 Dec 2014 17:36:29 +0000 (17:36 +0000)]
Swap resource count scopes for used/available space.

Used count should be reported as per-LUN, while available should not.

MFC after: 1 week

9 years agoPull in r174303 from upstream gcc trunk (by Jason Merrill):
dim [Thu, 4 Dec 2014 17:26:04 +0000 (17:26 +0000)]
Pull in r174303 from upstream gcc trunk (by Jason Merrill):

  PR c++/48211
  * name-lookup.h (cp_class_binding): Make base a pointer.
  * name-lookup.c (new_class_binding): Adjust.
  (poplevel_class): Adjust.

This fixes a potential segfault when compiling gold, a part of the
devel/binutils port, with gcc.  See also the upstream bug report:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=48211

Thanks to Jason Merrill, Tom Callaway and Red Hat legal for approving
the use of this patch under the GNU GPL, version 2 or later.

MFC after: 1 week

9 years agoFix a 20+ year bug by using an appropriate constant for
kargl [Thu, 4 Dec 2014 15:57:58 +0000 (15:57 +0000)]
Fix a 20+ year bug by using an appropriate constant for
the transition from one asymptotic approximation to another
for the zeroth order Bessel and Neumann functions.

Reviewed by: bde

9 years agoDecode some binary fields of Intel metadata.
mav [Thu, 4 Dec 2014 15:54:45 +0000 (15:54 +0000)]
Decode some binary fields of Intel metadata.

Submitted by: Dmitry Luhtionov <dmitryluhtionov@gmail.com>
MFC after: 2 weeks

9 years agoAdd GET LBA STATUS command support to CTL.
mav [Thu, 4 Dec 2014 11:34:19 +0000 (11:34 +0000)]
Add GET LBA STATUS command support to CTL.

It is implemented for LUNs backed by ZVOLs in "dev" mode and files.
GEOM has no such API, so for LUNs backed by raw devices all LBAs will
be reported as mapped/unknown.

MFC after: 2 weeks
Sponsored by: iXsystems, Inc.

9 years agoFix style(9) and remove m_freem(NULL).
ae [Thu, 4 Dec 2014 05:02:12 +0000 (05:02 +0000)]
Fix style(9) and remove m_freem(NULL).
Add XXX comment, it looks incorrect, because m_pkthdr.len is already
incremented by M_PREPEND().

Sponsored by: Yandex LLC

9 years agoSwitch is an 8316, so make the comments say that.
sbruno [Wed, 3 Dec 2014 23:37:23 +0000 (23:37 +0000)]
Switch is an 8316, so make the comments say that.

Delete extraneous comment line that manifested itself from cut-n-pasting.

Sponsored by: Nicholas Esborn <nick@desert.net>

9 years agoConst poison in a few places to ensure we don't modify things
imp [Wed, 3 Dec 2014 22:14:13 +0000 (22:14 +0000)]
Const poison in a few places to ensure we don't modify things
through the module data pointer.

9 years agoOptimise the bit searching loops, by quickly skipping the 16 first set
hselasky [Wed, 3 Dec 2014 21:55:44 +0000 (21:55 +0000)]
Optimise the bit searching loops, by quickly skipping the 16 first set
bits if all the 16 first bits are set. This way the worst case
searching time is reduced from 32 to 16 cycles.

9 years agoWorkaround for possible bug in the SAF1761 chip. Wait 125us before
hselasky [Wed, 3 Dec 2014 21:48:30 +0000 (21:48 +0000)]
Workaround for possible bug in the SAF1761 chip. Wait 125us before
re-using a hardware propritary transfer descriptor, PTD, in USB host
mode. If the PTD's are recycled too quickly, it has been observed that
the hardware simply fails to schedule the requested job or resets
completely disconnecting all devices.

9 years agoThere is only one argemdio device on this board.
sbruno [Wed, 3 Dec 2014 19:41:49 +0000 (19:41 +0000)]
There is only one argemdio device on this board.

Sponsored by: Nicholas Esborn <nick@desert.net>

9 years agoAdd libcuse and libxo.
brueffer [Wed, 3 Dec 2014 18:14:21 +0000 (18:14 +0000)]
Add libcuse and libxo.

9 years agoAssign argemdio0 to the correct base address and assign argemdio1 to its
sbruno [Wed, 3 Dec 2014 18:08:39 +0000 (18:08 +0000)]
Assign argemdio0 to the correct base address and assign argemdio1 to its
proper place *after* argemdio0

Correctly place arge0 and arge1 on their respective bus positions.

Sponsored by: Nicholas Esborn <nick@desert.net>

9 years agoIncrease CTL ports limit from 128 to 256 and LUNs limit from 256 to 1024.
mav [Wed, 3 Dec 2014 16:04:01 +0000 (16:04 +0000)]
Increase CTL ports limit from 128 to 256 and LUNs limit from 256 to 1024.

After recent optimizations this change is no longer blocked by CTL memory
consumption.  Those limits are still not free, but much cheaper now.

MFC after: 1 week
Relnotes: yes
Sponsored by: iXsystems, Inc.

9 years agoRevert device_getenv_int() for now as it duplicates resource_int_value().
jhb [Wed, 3 Dec 2014 15:29:53 +0000 (15:29 +0000)]
Revert device_getenv_int() for now as it duplicates resource_int_value().
We should perhaps implement a device_getenv_*() and device_setenv_*() API
as a convenience wrapper on top of resource_*_value() and resource_set_*().

9 years agoUnify function names after r275458.
mav [Wed, 3 Dec 2014 15:19:38 +0000 (15:19 +0000)]
Unify function names after r275458.

MFC after: 1 month

9 years agoDo not pre-allocate UNIT ATTENTIONs storage for every possible initiator.
mav [Wed, 3 Dec 2014 15:16:18 +0000 (15:16 +0000)]
Do not pre-allocate UNIT ATTENTIONs storage for every possible initiator.

Abusing ability of major UAs cover minor ones we may not account UAs for
inactive ports.  Allocate UAs storage for port and start accounting only
after some initiator from that port fetched its first POWER ON OCCURRED.

This reduces per-LUN CTL memory usage from >1MB to less then 100K.

MFC after: 1 month

9 years agoIncrease BERI loader section alignment to 16
emaste [Wed, 3 Dec 2014 14:04:57 +0000 (14:04 +0000)]
Increase BERI loader section alignment to 16

The .text, .bss, and .data sections claimed 16-byte alignment, but were
only aligned to 8 by the linker script.

Discovered with strip(1) from elftoolchain, which performs validation
absent from the binutils strip(1).

Sponsored by: DARPA, AFRL

9 years agoRemove some unused code.
mav [Wed, 3 Dec 2014 10:39:47 +0000 (10:39 +0000)]
Remove some unused code.

9 years agoDo not corrupt the listen string when parsing it.
mav [Wed, 3 Dec 2014 09:32:51 +0000 (09:32 +0000)]
Do not corrupt the listen string when parsing it.

This fixes problem with ctld reload when it is configured to listen on two
portals with same IP, but different ports.

MFC after: 1 week

9 years agoDo not pre-allocate reservation keys memory for every possible initiator.
mav [Wed, 3 Dec 2014 09:05:53 +0000 (09:05 +0000)]
Do not pre-allocate reservation keys memory for every possible initiator.

In configurations with many ports, like iSCSI, each LUN is typically
accessed only by limited subset of ports.  Allocating that memory on
demand allows to reduce CTL memory usage from 5.3MB/LUN to 1.3MB/LUN.

MFC after: 1 month