]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/log
FreeBSD/stable/10.git
7 years agoMFC r311601:
ngie [Sun, 19 Mar 2017 22:14:22 +0000 (22:14 +0000)]
MFC r311601:

Move the mibII module up so uncommenting the bridge module works

Add a note about how module ordering and dependent modules

git-svn-id: svn://svn.freebsd.org/base/stable/10@315593 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r315426, MFV r315425:
pfg [Sun, 19 Mar 2017 20:04:57 +0000 (20:04 +0000)]
MFC r315426, MFV r315425:
one-true-awk: have calloc(3) do the multiplication.

git-svn-id: svn://svn.freebsd.org/base/stable/10@315582 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r315155:
kib [Sun, 19 Mar 2017 15:56:06 +0000 (15:56 +0000)]
MFC r315155:
Ktracing kevent(2) calls with unusual arguments might leads to an
overly large allocation requests.

PR: 217435

git-svn-id: svn://svn.freebsd.org/base/stable/10@315562 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r314996:
mmokhi [Sat, 18 Mar 2017 12:39:24 +0000 (12:39 +0000)]
MFC r314996:
Fix NULL pointer dereference and panic with shm file pread/pwrite.

PR: 217429
Approved by: dchagin

git-svn-id: svn://svn.freebsd.org/base/stable/10@315481 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoixgbe(4): Fix build breakage when only compiling ix(4)
erj [Fri, 17 Mar 2017 21:24:09 +0000 (21:24 +0000)]
ixgbe(4): Fix build breakage when only compiling ix(4)

PR: 217862
Reported by: lampa
Sponsored by: Intel Corporation

git-svn-id: svn://svn.freebsd.org/base/stable/10@315463 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC 314382,314483-314485
sephe [Fri, 17 Mar 2017 03:03:58 +0000 (03:03 +0000)]
MFC 314382,314483-314485

314382
    hyperv/hn: Simplify RNDIS packet data offset calculation.

    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D9699

314483
    hyperv/hn: Simplify RNDIS packet total length calculation.

    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D9712

314484
    hyperv/hn: Make sure that RNDIS packet message is at least 4B aligned.

    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D9713

314485
    hyperv/hn: Misaligned chimney sending buffers should not be used

    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D9714

git-svn-id: svn://svn.freebsd.org/base/stable/10@315437 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoixgbe(4): Fix VF build failure on i386 caused by r315333
erj [Thu, 16 Mar 2017 23:18:57 +0000 (23:18 +0000)]
ixgbe(4): Fix VF build failure on i386 caused by r315333

SYSCTL_ADD_UQUAD on i386 expects a uint64_t pointer, and not an
unsigned long pointer. So change the data type of the original variable to
u64 (uint64_t) from unsigned long, since the statistics are intended to be
64 bits, anyway.

Reported by: Peter Jeremy (peter@rulingia.com)

git-svn-id: svn://svn.freebsd.org/base/stable/10@315434 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r314571:
mm [Thu, 16 Mar 2017 23:08:18 +0000 (23:08 +0000)]
MFC r314571:
Update libarchive to version 3.3.1 (and sync with latest vendor dist)

Notable vendor changes:
  PR #501: improvements in ACL path handling
  PR #724: fix hang when reading malformed cpio files
  PR #864: fix out of bounds read with malformed GNU tar archives
  Documentation, style, test suite improvements and typo fixes.

New options to bsdtar that enable or disable reading and/or writing of:
  Access Control Lists (--acls, --no-acls)
  Extended file flags (--fflags, --no-fflags)
  Extended attributes (--xattrs, --no-xattrs)
  Mac OS X metadata (Mac OS X only) (--mac-metadata, --no-mac-metadata)

git-svn-id: svn://svn.freebsd.org/base/stable/10@315433 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r314918, r314919:
ian [Thu, 16 Mar 2017 15:43:32 +0000 (15:43 +0000)]
MFC r314918, r314919:

  Add the pnp id for a Wacom 'WACF00e' tablet.

  Update the comment for the Wacom WACF00e to make it clear it's not an
  accidental duplicate of WACF004.

PR:           217306

git-svn-id: svn://svn.freebsd.org/base/stable/10@315417 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r315187:
pfg [Thu, 16 Mar 2017 15:10:04 +0000 (15:10 +0000)]
MFC r315187:
libc: mall cleanup.

Let calloc(3) do the multiplication.

git-svn-id: svn://svn.freebsd.org/base/stable/10@315415 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r314549: Execute last ZIO of log commit synchronously.
mav [Thu, 16 Mar 2017 07:11:35 +0000 (07:11 +0000)]
MFC r314549: Execute last ZIO of log commit synchronously.

For short transactions overhead of context switch can be too large.
Skipping it gives significant latency reduction.  For large ones,
including multiple ZIOs, latency is less critical, while throughput
there may become limited by checksumming speed of single CPU core.
To get best of both cases, execute last ZIO directly from calling
thread context to save latency, while all others (if there are any)
enqueue to taskqueues in traditional way.

git-svn-id: svn://svn.freebsd.org/base/stable/10@315388 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r314548: Completely skip cache flushing for not supporting log devices.
mav [Thu, 16 Mar 2017 07:09:47 +0000 (07:09 +0000)]
MFC r314548: Completely skip cache flushing for not supporting log devices.

git-svn-id: svn://svn.freebsd.org/base/stable/10@315385 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r314954:
ngie [Thu, 16 Mar 2017 02:04:16 +0000 (02:04 +0000)]
MFC r314954:

style(9): sort the #includes

git-svn-id: svn://svn.freebsd.org/base/stable/10@315358 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r315113:
ngie [Thu, 16 Mar 2017 02:02:33 +0000 (02:02 +0000)]
MFC r315113:

Conditionally compile [additional] programs into rescue(8) if requested

Trivial oversight missed in r314240 cleanup because I enable these knobs on
my test machines.

MK_INET6_SUPPORT - rtsol
MK_NETCAT - nc

git-svn-id: svn://svn.freebsd.org/base/stable/10@315356 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r314924:
ngie [Thu, 16 Mar 2017 01:59:43 +0000 (01:59 +0000)]
MFC r314924:

sbin/devfs: clarify usage

- Note existence of -m option.
- Note that -s applies to rule keyword, only, by adding usage text
  specifically for the `rule` and `ruleset` keywords.

Don't go into any further detail in usage(..) -- it's best that one
reads the manpage to get a better idea of how things work as there are
a number of different option-specific keywords and arguments, as well
as some rule grammar.

git-svn-id: svn://svn.freebsd.org/base/stable/10@315355 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r315111:
ngie [Thu, 16 Mar 2017 01:58:09 +0000 (01:58 +0000)]
MFC r315111:

Remove /rescue/iscsictl and /rescue/iscsid if MK_ISCSI == no

git-svn-id: svn://svn.freebsd.org/base/stable/10@315353 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r315114:
ngie [Thu, 16 Mar 2017 01:56:19 +0000 (01:56 +0000)]
MFC r315114:

Remove /rescue/zdb if MK_ZFS == no

Missed in r202452.

git-svn-id: svn://svn.freebsd.org/base/stable/10@315351 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r314895:
ngie [Thu, 16 Mar 2017 01:50:11 +0000 (01:50 +0000)]
MFC r314895:

Only install 900.tcpwrap if MK_INETD != "no" and MK_TCP_WRAPPERS != "no"

It relies on output from inetd that is triggered by MK_TCP_WRAPPERS=yes.

We need to check for both knobs being set -- otherwise the script doesn't
have much value.

PR: 217577

git-svn-id: svn://svn.freebsd.org/base/stable/10@315348 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r274130:
ngie [Thu, 16 Mar 2017 01:47:26 +0000 (01:47 +0000)]
MFC r274130:
r274130 (by bapt):

Avoid installing security.functions with executable bits, periodic(8) will
try to execute all files with an executable bit in /etc/periodic/*/ while
this file is supposed only to be sourced by others

git-svn-id: svn://svn.freebsd.org/base/stable/10@315346 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r313733:
badger [Thu, 16 Mar 2017 01:41:36 +0000 (01:41 +0000)]
MFC r313733:

sleepq_catch_signals: do thread suspension before signal check

Since locks are dropped when a thread suspends, it's possible for another
thread to deliver a signal to the suspended thread. If the thread awakens from
suspension without checking for signals, it may go to sleep despite having
a pending signal that should wake it up. Therefore the suspension check is
done first, so any signals sent while suspended will be caught in the
subsequent signal check.

Sponsored by: Dell EMC

git-svn-id: svn://svn.freebsd.org/base/stable/10@315345 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r314830:
ngie [Thu, 16 Mar 2017 01:38:04 +0000 (01:38 +0000)]
MFC r314830:

mergemaster: fix description of -p

-p only handles updating /etc/master.passwd and /etc/group . No more,
no less.

Also, mergemaster (and no other portions of the vanilla FreeBSD build
process) should be messing with __MAKECONF or SRCCONF as part of the
installworld or distribution process. Don't insinuate that mergemaster
does that as it's a false claim.

git-svn-id: svn://svn.freebsd.org/base/stable/10@315343 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoixgbe(4): Update to 3.2.11-k
erj [Wed, 15 Mar 2017 21:20:17 +0000 (21:20 +0000)]
ixgbe(4): Update to 3.2.11-k

Includes:

1. Support for X553 (Denverton) Ethernet devices.
2. Initialization code refactoring.
3. ixgbe-specific netmap code moved to ixgbe folder
   (but not removed from dev/netmap/).
4. VF driver full split. Some cleanup can be had due to redundant code,
   but this split goes inline with the refactoring.

NOTE: This is a direct commit to stable/10. Newer branches will receive an
iflib-converted version of ixgbe, with these updates included, instead.

Differential Revision: https://reviews.freebsd.org/D9310
Submitted by: Jeb Cramer (jeb.j.cramer@intel.com)
Tested by: Jeffrey Pieper (jeffrey.e.pieper@intel.com)
Sponsored by: Intel Corporation

git-svn-id: svn://svn.freebsd.org/base/stable/10@315333 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r310232:
dim [Wed, 15 Mar 2017 19:50:58 +0000 (19:50 +0000)]
MFC r310232:

After r310171, the kernel version of sscanf() has format string checking
enabled.  This results in a -Werror warning in mlx4ib:

    sys/dev/mlx4/mlx4_ib/mlx4_ib_sysfs.c:90:22: error: format specifies type 'unsigned long long *' but the argument has type 'u64 *' (aka 'unsigned long *') [-Werror,-Wformat]
            sscanf(buf, "%llx", &sysadmin_ag_val);
                         ~~~~   ^~~~~~~~~~~~~~~~

Change sysadmin_ag_val to unsigned long long to avoid the warning.

Reviewed by: hselasky
Differential Revision: https://reviews.freebsd.org/D8831

git-svn-id: svn://svn.freebsd.org/base/stable/10@315328 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r314553:
hselasky [Tue, 14 Mar 2017 16:00:33 +0000 (16:00 +0000)]
MFC r314553:

Implement taskqueue_poll_is_busy() for use by the LinuxKPI.
Refer to comment above function for a detailed description.

Discussed with: kib @
Sponsored by: Mellanox Technologies

git-svn-id: svn://svn.freebsd.org/base/stable/10@315268 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r314328:
hselasky [Tue, 14 Mar 2017 15:56:19 +0000 (15:56 +0000)]
MFC r314328:

Fix startup race initialising ACPI CM battery structures on MacBookPro.

During acpi_cmbat_attach() the acpi_cmbat_init_battery() notification
handler is registered. It has been observed this notification handler
can be called instantly, before the attach routine has returned. In
the notification handler there is a call to device_is_attached() which
returns false. Because the softc is set we know an attach is in
progress and the fix is simply to wait and try again in this case.

Reviewed by: avg @

git-svn-id: svn://svn.freebsd.org/base/stable/10@315264 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r313941:
hselasky [Tue, 14 Mar 2017 15:50:36 +0000 (15:50 +0000)]
MFC r313941:

Make sure the thread constructor and destructor eventhandlers are
called for all threads belonging to a procedure. Currently the first
thread in a procedure is kept around as an optimisation step and is
never freed. Because the first thread in a procedure is never freed
nor allocated, its destructor and constructor callbacks are never
called which means per thread structures allocated by dtrace and the
Linux emulation layers for example, might be present for threads which
don't need these structures.

This patch adds a thread construction and destruction call for the
first thread in a procedure.

Tested: dtrace, linux emulation
Reviewed by: kib @
Sponsored by: Mellanox Technologies

git-svn-id: svn://svn.freebsd.org/base/stable/10@315260 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r313778:
hselasky [Tue, 14 Mar 2017 15:44:39 +0000 (15:44 +0000)]
MFC r313778:

Improve code readability and fix compilation error when using clang 4.x.

Found by: emaste @
Sponsored by: Mellanox Technologies

git-svn-id: svn://svn.freebsd.org/base/stable/10@315257 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r312551:
hselasky [Tue, 14 Mar 2017 15:37:29 +0000 (15:37 +0000)]
MFC r312551:

Fix for race leading to endless timer interrupts related to
configtimer().

During normal operation "state->nextcallopt" will always be less than
or equal to "state->nextcall" and checking only "state->nextcallopt"
before calling "callout_process()" is sufficient. However when
"configtimer()" is called a race might happen requiring both of these
binary times to be checked.

Short description of race:

1) A configtimer() call will reset both "state->nextcall" and
"state->nextcallopt" to the same binary time.

2) If a "callout_reset()" call happens between "configtimer()" and the
next "callout_process()" call, "state->nextcallopt" will get updated
and "state->nextcall" will remain at the current time. Refer to logic
inside cpu_new_callout().

3) getnextcpuevent() only respects "state->nextcall" and returns this
value over and over again, even if it is in the past, until "now >=
state->nextcallopt" becomes true. Then these two time variables are
corrected by a "callout_process()" call and the situation goes back to
normal.

The problem manifests itself in different ways. The common factor is
the timer process(es) consume all CPU on one or more CPU cores for a
long time, blocking other kernel processes from getting execution
time. This can be seen by very high interrupt counts as displayed by
"vmstat -i | grep timer" right after boot.

When EARLY_AP_STARTUP was enabled in r310177 the likelyhood of hitting
this bug apparently increased.

Example output from "vmstat -i" before patch:
cpu0:timer                          7591         69
cpu9:timer                      39031773     358089
cpu4:timer                          9359         85
cpu3:timer                          9100         83
cpu2:timer                          9620         88

Example output from "vmstat -i" after patch:
cpu0:timer                          4242         34
cpu6:timer                          5531         44
cpu3:timer                          6450         52
cpu1:timer                          4545         36
cpu9:timer                          7153         58

Before the patch cpu9 in the example above, was spinning in a loop in
order to reach 39 million interrupts just a few seconds after
bootup. After the patch the timer interrupt counts are more or less
consistent.

Discussed with: mav @
Reported by: several people
Sponsored by: Mellanox Technologies

git-svn-id: svn://svn.freebsd.org/base/stable/10@315255 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r312424:
hselasky [Tue, 14 Mar 2017 15:28:59 +0000 (15:28 +0000)]
MFC r312424:

Fix problem with suspend and resume when using Skylake chipsets. Make
sure the XHCI controller is reset after halting it. The problem is
clearly a BIOS bug as the suspend and resume is failing without
loading the XHCI driver. The same happens when using Linux and the
XHCI driver is not loaded.

Submitted by: Yanko Yankulov <yanko.yankulov@gmail.com>
PR: 216261

git-svn-id: svn://svn.freebsd.org/base/stable/10@315252 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r312338:
hselasky [Tue, 14 Mar 2017 15:21:41 +0000 (15:21 +0000)]
MFC r312338:

Add USB audio support for S/PDIF output with C-Media CM6206 devices.

Submitted by: Julien Nadeau <vedge@hypertriton.com>
PR: 216131

git-svn-id: svn://svn.freebsd.org/base/stable/10@315249 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r310806:
hselasky [Tue, 14 Mar 2017 15:15:37 +0000 (15:15 +0000)]
MFC r310806:

Add MSIX rewrite table quirk for use with VMs.

This patch solves IRQ generation problems using the mlx5en(4) driver
with xenserver v6.5.0 in SRIOV and PCI-passthrough modes.

Until further the hw.pci.msix_rewrite_table quirk must be set manually
in /boot/loader.conf .

Reviewed by: jhb @
Sponsored by:           Mellanox Technologies

git-svn-id: svn://svn.freebsd.org/base/stable/10@315247 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r315225:
delphij [Tue, 14 Mar 2017 06:12:51 +0000 (06:12 +0000)]
MFC r315225:

Discard first 3072 bytes of RC4 keystream, this is a bandaid
that allows us to work on switching to a more modern PRNG.

Submitted by: Steven Chamberlain <steven pyro eu org>
Approved by: so

git-svn-id: svn://svn.freebsd.org/base/stable/10@315227 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r314786: Import mpr(4) driver P12 to P14 diff from vendor site.
mav [Mon, 13 Mar 2017 06:52:29 +0000 (06:52 +0000)]
MFC r314786: Import mpr(4) driver P12 to P14 diff from vendor site.

This is mostly a version bump to stay in version number sync with firmware.
The only change there was cosmetic:  Display degraded speed message upon
receiving Active Cable Exception Event with DEGRADED reason code.

git-svn-id: svn://svn.freebsd.org/base/stable/10@315189 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r314807:
ngie [Mon, 13 Mar 2017 01:34:42 +0000 (01:34 +0000)]
MFC r314807:

Move ATF_TC_WITHOUT_HEAD(getgrent) near the testcase it annotates

git-svn-id: svn://svn.freebsd.org/base/stable/10@315185 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r314793,r314796,r314797,r314798,r314799,r314800,r314801,r314802,r314803,r314804...
ngie [Mon, 13 Mar 2017 01:17:57 +0000 (01:17 +0000)]
MFC r314793,r314796,r314797,r314798,r314799,r314800,r314801,r314802,r314803,r314804,r314805:

r314793:

Fix ATF_TP_ADD_TCS example in atf-c-api(3)

ATF_TP_ADD_TC should use `tp` as the second argument, not `tcs`, as
ATF_TP_ADD_TCS uses `tp` as its first argument.

Bump .Dd for the change.

r314796:

Fix atf-sh(3) manpage issues

- Fix spelling errors (specifiying -> specifying) [1]
- Escape '.' at start of lines using & to tell the roff processor
  that the line isn't meant to be treated as a command [2].

Bump .Dd for the change

r314797:

Fix grammar warning noted by igor

Remove surrounding ellipses in e.g. section and add a comma before and after
the e.g. reference.

r314798:

Fix out-of-order sections in atf-sh(1)

- `.Op` must be used in the SYNOPSIS section, not the NAME section.
- Move ATF_SHELL environment variable description up to first
  ENVIRONMENT section. Garbage collect the duplicate ENVIRONMENT
  section.

Bump .Dd for the change

r314799:

Fix manlint issues with atf-check(1)

- Use `.Bf Em`/`.Ef` instead of prefixing lines with `.Em`. The forms
  are equivalent with traditional roff, but unnecessarily verbose. The
  former form applies the .Em macro to the enclosed block.
- Move EXIT_STATUS section down so the section complies with section
  ordering specified by mdoc(7) and enforced by manlint(1).

Bump .Dd for the change

r314800:

Fix issues with atf-check(1) found by igor and refer to atf-check(1)

- Fix typo (specifiying -> specifying)
- Add atf-check(1) to SEE ALSO section for completeness. It's mentioned
  above, but by convention the SEE ALSO section should list all relevant
  references to other tools and APIs.

Bump .Dd for the change

r314801:

Fix igor/manlint issues with atf-c(3)

- Remove surrounding ellipses in i.e. section and add a comma before
  and after the i.e. reference [1].
- Fix typo (specifiying -> specifying) [1].
- Escape '.' at start of lines using & to tell the roff processor
  that the line isn't meant to be treated as a command [2].

Bump .Dd for the change

r314802:

Fix atf-c-api(3) manpage issues

- Fix typo (specifiying -> specifying).
- Remove surrounding ellipses in i.e. section and add a comma before
  and after the i.e. reference.

Bump .Dd for the change

r314803:

Fix typos

- specifiying -> specifying
- manged -> managed

Bump .Dd for the change

r314804:

Fix issues noted by igor/manlint

- Fix typos [1]:
-- manged -> managed
-- specifiying -> specifying
- Escape '.' at start of lines using & to tell the roff processor
  that the line isn't meant to be treated as a command [2].

Bump .Dd for the change

r314805:

Remove *-api(3) manpages removed in ATF 0.21

I overlooked the fact that these manpages had been removed upstream
and replaced with their non *-api(3) equivalents. Follow upstream's
lead and remove the unused manpages.

git-svn-id: svn://svn.freebsd.org/base/stable/10@315183 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r314637: sh: Add some already working tests that exercise new code paths
jilles [Sun, 12 Mar 2017 19:49:08 +0000 (19:49 +0000)]
MFC r314637: sh: Add some already working tests that exercise new code paths

git-svn-id: svn://svn.freebsd.org/base/stable/10@315179 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFH (r303289): update example section
des [Sun, 12 Mar 2017 13:42:40 +0000 (13:42 +0000)]
MFH (r303289): update example section

PR: 211361

git-svn-id: svn://svn.freebsd.org/base/stable/10@315154 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFH (r300602): the NAS identifier is a string, not an integer
des [Sun, 12 Mar 2017 13:36:14 +0000 (13:36 +0000)]
MFH (r300602): the NAS identifier is a string, not an integer

git-svn-id: svn://svn.freebsd.org/base/stable/10@315153 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFH (r314598): load default options before requesting ticket
des [Sun, 12 Mar 2017 13:23:23 +0000 (13:23 +0000)]
MFH (r314598): load default options before requesting ticket

PR: 213909

git-svn-id: svn://svn.freebsd.org/base/stable/10@315152 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFH (r314554): fix date in previous commit
des [Sun, 12 Mar 2017 13:20:07 +0000 (13:20 +0000)]
MFH (r314554): fix date in previous commit

Also remove mention of SKEIN-512 since it is not available in 10.

git-svn-id: svn://svn.freebsd.org/base/stable/10@315150 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFH (r314528): update to reflect the state of SHA-1
des [Sun, 12 Mar 2017 13:15:26 +0000 (13:15 +0000)]
MFH (r314528): update to reflect the state of SHA-1

git-svn-id: svn://svn.freebsd.org/base/stable/10@315148 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r314960:
kib [Sun, 12 Mar 2017 12:12:59 +0000 (12:12 +0000)]
MFC r314960:
Fix typo in comment.

git-svn-id: svn://svn.freebsd.org/base/stable/10@315145 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r314308: Fix LUN enabling on wildcard target, as done by CTL.
mav [Sun, 12 Mar 2017 06:20:28 +0000 (06:20 +0000)]
MFC r314308: Fix LUN enabling on wildcard target, as done by CTL.

git-svn-id: svn://svn.freebsd.org/base/stable/10@315140 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r314307: Add support for SIMs without autosense.
mav [Sun, 12 Mar 2017 06:18:41 +0000 (06:18 +0000)]
MFC r314307: Add support for SIMs without autosense.

If we asked to send sense data by setting CAM_SEND_SENSE, but SIM didn't
confirm transmission by setting CAM_SENT_SENSE, assume it was not sent.
Queue the I/O back to CTL for later REQUEST SENSE with ctl_queue_sense().
This is needed for error reporting on SPI HBAs like ahc(4)/ahd(4).

git-svn-id: svn://svn.freebsd.org/base/stable/10@315138 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r314321:
pfg [Sun, 12 Mar 2017 05:36:31 +0000 (05:36 +0000)]
MFC r314321:
dc(1): Merge minor changes from OpenBSD.

Prefer setvbuf() to setlinebuf() for portability.
Some style(9) and redundant tests for NULL.

These are only meant to ease up merging newer changes.

Obtained from: OpenBSD

git-svn-id: svn://svn.freebsd.org/base/stable/10@315135 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r314542:
ngie [Sun, 12 Mar 2017 04:58:57 +0000 (04:58 +0000)]
MFC r314542:

kern.cam.da.X.delete_method: add -width to .Bl macro call

Now the section width is set appropriately per the BIO_DELETE
parameter being described.

git-svn-id: svn://svn.freebsd.org/base/stable/10@315129 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r314545:
ngie [Sun, 12 Mar 2017 04:57:21 +0000 (04:57 +0000)]
MFC r314545:

Add missing section to .Xr macro calls for wpifw(4)

The driver manpage for wpifw(4) is missing, but will be added soon. This
fixes the other 2 .Xr calls lacking sections to match the 3rd,
syntactically correct, reference in the SEE ALSO section.

git-svn-id: svn://svn.freebsd.org/base/stable/10@315127 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r314233:
ngie [Sun, 12 Mar 2017 04:55:02 +0000 (04:55 +0000)]
MFC r314233:

Parameterize out the length of struct filed->f_lasttime as `MAXDATELEN`

This removes the hardcoded value for the field (16) and the equivalent
hardcoded lengths in logmsg(..).

This change is being done to help stage future work to add RFC5424/RFC5434
support to syslogd(8).

Obtained from: Isilon OneFS (dcd33d13da) (as part of a larger change)

git-svn-id: svn://svn.freebsd.org/base/stable/10@315124 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r314189,r314190,r314191:
ngie [Sun, 12 Mar 2017 04:53:27 +0000 (04:53 +0000)]
MFC r314189,r314190,r314191:

r314189:

Fix up NULL/'\0' uses and fix 2 derefs after NULL

CID: 10188981018899

r314190:

Fix some minor style nits: put parentheses around return values

r314191:

Fix up r314189

The conditional in do_buff_decode(..) after the while loop was accidentally
inverted. Only increment the pointer for fmt if it's not NUL.

git-svn-id: svn://svn.freebsd.org/base/stable/10@315122 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r314644:
ngie [Sun, 12 Mar 2017 04:41:27 +0000 (04:41 +0000)]
MFC r314644:

Fix "make depend" with geom_uzip.ko: add opt_geom.h to SRCS

git-svn-id: svn://svn.freebsd.org/base/stable/10@315119 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r314239:
ngie [Sun, 12 Mar 2017 04:32:31 +0000 (04:32 +0000)]
MFC r314239:

Add shutdown/poweroff support to rescue(8)

shutdown is a safer way to power off than reboot (in general), because of
the added shutdown process that it executes via /etc/rc.shutdown . It was
odd that it was missing from rescue(8) since reboot and friends were
added in past commits.

While here, alias poweroff to shutdown for parity with sbin/shutdown/Makefile

git-svn-id: svn://svn.freebsd.org/base/stable/10@315116 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r314240:
ngie [Sun, 12 Mar 2017 04:12:41 +0000 (04:12 +0000)]
MFC r314240:

Conditionally compile certain programs into rescue(8) if requested

MK_CCD - ccdconfig
MK_ROUTED - routed, rtquery

git-svn-id: svn://svn.freebsd.org/base/stable/10@315110 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r314896:
cy [Sat, 11 Mar 2017 18:06:20 +0000 (18:06 +0000)]
MFC r314896:

Remove extraneous arguments and options, which don't make sense for
a file documented in volume 5.

git-svn-id: svn://svn.freebsd.org/base/stable/10@315081 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r314768:
cy [Sat, 11 Mar 2017 17:57:22 +0000 (17:57 +0000)]
MFC r314768:

Fix mismerge of r280849.

Reported by: des

git-svn-id: svn://svn.freebsd.org/base/stable/10@315080 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r312886:
cy [Sat, 11 Mar 2017 17:46:59 +0000 (17:46 +0000)]
MFC r312886:

Fix lookup of original destination address when using a redirect rule.
Transparent proxying, e.g. to squid, is an example of this.

Obtained from: NetBSD ip_nat.c r1.17, ip_nat6.c r1.10

git-svn-id: svn://svn.freebsd.org/base/stable/10@315079 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r314274: l2arc: fix write size calculation broken by Compressed ARC commit
avg [Sat, 11 Mar 2017 15:30:35 +0000 (15:30 +0000)]
MFC r314274: l2arc: fix write size calculation broken by Compressed ARC commit

git-svn-id: svn://svn.freebsd.org/base/stable/10@315073 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r314666: ioat: don't specify inline for function with variable argument list
avg [Sat, 11 Mar 2017 15:26:41 +0000 (15:26 +0000)]
MFC r314666: ioat: don't specify inline for function with variable argument list

git-svn-id: svn://svn.freebsd.org/base/stable/10@315071 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoqlxgbe: add GCC_MS_EXTENSIONS to CFLAGS to make old base GCC happy
avg [Sat, 11 Mar 2017 15:21:34 +0000 (15:21 +0000)]
qlxgbe: add GCC_MS_EXTENSIONS to CFLAGS to make old base GCC happy

The module uses unnamed structure and union fields and base GCC in
stable/10 doesn't like it.
I think that that is a C11 feature, so it is courteous of more modern
compilers to not complain about it when compiling in C99 mode.

This is a direct commit as the change is not required in head.

Approved by: davidcs

git-svn-id: svn://svn.freebsd.org/base/stable/10@315069 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r303464 (by brooks@):
dchagin [Sat, 11 Mar 2017 08:40:59 +0000 (08:40 +0000)]
MFC r303464 (by brooks@):

Don't create pointless backups of generated files in "make sysent".

Any sensible workflow will include a revision control system from which
to restore the old files if required.  In normal usage, developers just
have to clean up the mess.

git-svn-id: svn://svn.freebsd.org/base/stable/10@315063 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC of r314281:
loos [Sat, 11 Mar 2017 07:54:05 +0000 (07:54 +0000)]
MFC of r314281:

Disable the driver managed queue for igb(4) when the legacy transmit
interface is used.

The legacy API (IGB_LEGACY_TX) is enabled when ALTQ is built into kernel.

As noted in altq(9), it is responsibility of the caller to protect this
queue against concurrent access and, in the igb case, the interface send
queue is protected by tx queue mutex.  This obviously cannot protect the
driver managed queue against concurrent access from different tx queues
and leads to numerous and quite strange panic traces (usually shown as
packets disappearing into thin air).

Improving the locking to cope with this means serialize all access to this
(single) queue and produces no gain, it actually affects the performance
quite noticeabily.

The driver managed queue is already disabled when an ALTQ queue discipline
is set on interface (in altq_enable()), because the driver managed queue
can interfere with ALTQ timing (whence the reports that setting an ALTQ
queue discipline on interface also fixes the issue).

Disabling this additional queue keeps the ability to use if_start() to
send packets to individual NIC queues while it simply eliminate the race.

This is a direct commit to stable/11 as -head driver does not support ALTQ
anymore.

PR: 213257
PR: 212413
Discussed with: sbruno
Tested by: Konstantin Kormashev <konstantin@netgate.com>
Obtained from: pfSense
Sponsored by: Rubicon Communications, LLC (Netgate)

git-svn-id: svn://svn.freebsd.org/base/stable/10@315060 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r314626
vangyzen [Fri, 10 Mar 2017 20:48:38 +0000 (20:48 +0000)]
MFC r314626

Fix grammar in some comments in subr_sleepqueue.c

While I'm here, remove trailing whitespace.

git-svn-id: svn://svn.freebsd.org/base/stable/10@315029 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r313820
vangyzen [Fri, 10 Mar 2017 20:38:18 +0000 (20:38 +0000)]
MFC r313820

pf: use inet_ntoa_r() instead of inet_ntoa(); maybe fix IPv6 OS fingerprinting

inet_ntoa() cannot be used safely in a multithreaded environment
because it uses a static local buffer. Instead, use inet_ntoa_r()
with a buffer on the caller's stack.

This code had an INET6 conditional before this commit, but opt_inet6.h
was not included, so INET6 was never defined.  Apparently, pf's OS
fingerprinting hasn't worked with IPv6 for quite some time.
This commit might fix it, but I didn't test that.

Relnotes: yes (if I/someone can test pf OS fingerprinting with IPv6)
Sponsored by: Dell EMC

git-svn-id: svn://svn.freebsd.org/base/stable/10@315028 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r314055
vangyzen [Fri, 10 Mar 2017 20:07:38 +0000 (20:07 +0000)]
MFC r314055

Make several improvements and corrections in the kenv(2) man page

Sponsored by: Dell EMC

git-svn-id: svn://svn.freebsd.org/base/stable/10@315024 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r313817
vangyzen [Fri, 10 Mar 2017 19:34:14 +0000 (19:34 +0000)]
MFC r313817

acpica: remove a superfluous NULL check

The address-of operator can't produce NULL (in practice).
Remove an unnecessary NULL check.

Sponsored by: Dell EMC

git-svn-id: svn://svn.freebsd.org/base/stable/10@315021 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r313841, r313850:
markj [Fri, 10 Mar 2017 18:52:37 +0000 (18:52 +0000)]
MFC r313841, r313850:
Prevent CPU migration when checking the DTrace nofault flag on x86.

git-svn-id: svn://svn.freebsd.org/base/stable/10@315012 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r314592: Fix JSON output.
mav [Fri, 10 Mar 2017 06:18:27 +0000 (06:18 +0000)]
MFC r314592: Fix JSON output.

git-svn-id: svn://svn.freebsd.org/base/stable/10@314992 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r314810:
kp [Thu, 9 Mar 2017 03:20:20 +0000 (03:20 +0000)]
MFC r314810:

pf: Fix a crash in low-memory situations

If the call to pf_state_key_clone() in pf_get_translation() fails (i.e. there's
no more memory for it) it frees skp. This is wrong, because skp is a
pf_state_key **, so we need to free *skp, as is done later in the function.
Getting it wrong means we try to free a stack variable of the calling
pf_test_rule() function, and we panic.

git-svn-id: svn://svn.freebsd.org/base/stable/10@314940 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r314145, r314158
pfg [Thu, 9 Mar 2017 02:59:02 +0000 (02:59 +0000)]
MFC r314145, r314158
vxge(4): double assignments.

Fix some suspicious code, likely caused by excessive copy-pasting.

Found with: coccinelle (da.cocci)

git-svn-id: svn://svn.freebsd.org/base/stable/10@314939 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoRevert 294545:
pfg [Thu, 9 Mar 2017 02:47:01 +0000 (02:47 +0000)]
Revert 294545:
Bringing back ext4: add support for reading sparse files

Add GCC_MS_EXTENSIONS to the CFLAGS in the module to make the old GCC in
base happy. This workaround is only required in stable/10.

git-svn-id: svn://svn.freebsd.org/base/stable/10@314937 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r314505:
pfg [Wed, 8 Mar 2017 22:39:45 +0000 (22:39 +0000)]
MFC r314505:
Split the ficl CFLAGS when they refer to an arch-specific include path.

This is a minimal attempt to keep consistency in the Makefiles so that
moving ficl to somwehere like contrib will be less error prone.

git-svn-id: svn://svn.freebsd.org/base/stable/10@314922 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r314061:
dim [Wed, 8 Mar 2017 07:58:29 +0000 (07:58 +0000)]
MFC r314061:

Add __int128-related symbols to libcxxrt's version map.  Put these into
the same CXXABI verions as recent libstdc++.

Note that __int128 types are only available on arches where long long is
128 bit wide.

Noticed by: harti

MFC r314104:

Surround any unmangled C++ names in libcxxrt's version map with 'extern
"C++"', otherwise ld refuses to make the symbols global in the final
library.  This causes the __int128-related symbols to go missing when
the library is stripped during installation.

Helpful hints: emaste

git-svn-id: svn://svn.freebsd.org/base/stable/10@314898 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC 313879
jpaetzel [Tue, 7 Mar 2017 18:31:03 +0000 (18:31 +0000)]
MFC 313879

MVF: 313876

7504 kmem_reap hangs spa_sync and administrative tasks

illumos/illumos-gate@405a5a0f5c3ab36cb76559467d1a62ba648bd809
https://github.com/illumos/illumos-gate/commit/405a5a0f5c3ab36cb76559467d1a62ba648bd80

https://www.illumos.org/issues/7504

  We see long spa_sync(). We are waiting to hold dp_config_rwlock for writer. Some
  other thread holds dp_config_rwlock for reader, then calls arc_get_data_buf(),
  which finds that arc_is_overflowing()==B_TRUE. So it waits (while holding
  dp_config_rwlock for reader) for arc_reclaim_thread to signal arc_reclaim_waiters_cv.
  Before signaling, arc_reclaim_thread does arc_kmem_reap_now(), which takes ~seconds.

Author: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Prakash Surya <prakash.surya@delphix.com>
Approved by: Dan McDonald <danmcd@omniti.com>

git-svn-id: svn://svn.freebsd.org/base/stable/10@314874 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r314058: zfs: lower priority of zio_write_issue threads by four
avg [Tue, 7 Mar 2017 15:27:23 +0000 (15:27 +0000)]
MFC r314058: zfs: lower priority of zio_write_issue threads by four

Obtained from: Panzura
Sponsored by: Panzura

git-svn-id: svn://svn.freebsd.org/base/stable/10@314857 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r314429:
kib [Tue, 7 Mar 2017 12:24:02 +0000 (12:24 +0000)]
MFC r314429:
Initialize pcb_save for thread0.

git-svn-id: svn://svn.freebsd.org/base/stable/10@314845 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r314374: Add safety check against too long CDB.
mav [Tue, 7 Mar 2017 05:57:18 +0000 (05:57 +0000)]
MFC r314374: Add safety check against too long CDB.

SBP-2 specification defined maximum CDB length as 12 bytes.  Newer SBP-3
specification allows CDB of any size, but this driver is too old.  Proper
solution would be to look on maximal ORB size supported by the target.

git-svn-id: svn://svn.freebsd.org/base/stable/10@314836 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r314627:
cy [Tue, 7 Mar 2017 05:35:14 +0000 (05:35 +0000)]
MFC r314627:

Fix leak (free str before returning when ctx's calloc fails).

Submitted by: trix_juniper.net (Tom Rix)
Reviewed by: cy, ngie
Discovered by: clang's static analyzer
Differential Revision: D9877

git-svn-id: svn://svn.freebsd.org/base/stable/10@314834 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r314430:
ae [Tue, 7 Mar 2017 03:53:09 +0000 (03:53 +0000)]
MFC r314430:
  When IPv6 fragments reassembly is complete, update mbuf's csum_data
  and csum_flags using information from all fragments. This fixes
  dropping of reassembled packets due to wrong checksum when the IPv6
  checksum offloading is enabled on a network card.

git-svn-id: svn://svn.freebsd.org/base/stable/10@314829 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r314242:
ngie [Tue, 7 Mar 2017 02:02:51 +0000 (02:02 +0000)]
MFC r314242:

Remove MK_CRYPT stub

It doesn't directly control what gets installed today; it indirectly
pulls other knobs (like MK_KERBEROS, etc).

git-svn-id: svn://svn.freebsd.org/base/stable/10@314824 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r314226:
ngie [Tue, 7 Mar 2017 02:01:32 +0000 (02:01 +0000)]
MFC r314226:

Use SRCTOP instead of .CURDIR relative paths with ".."

This simplifies pathing in make/displayed output

git-svn-id: svn://svn.freebsd.org/base/stable/10@314822 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r313438:
ngie [Tue, 7 Mar 2017 01:58:56 +0000 (01:58 +0000)]
MFC r313438:

Clean up trailing and leading whitespace for variables to make it
consistent with the rest of the file and style.Makefile(9) a bit
more

git-svn-id: svn://svn.freebsd.org/base/stable/10@314820 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r314450,r313439:
ngie [Tue, 7 Mar 2017 01:52:50 +0000 (01:52 +0000)]
MFC r314450,r313439:

r314450:

Add additional __FreeBSD_version guards around the hsearch_r testcases

The reasoning for this is the same as r276046: to ease MFCing the tests
to ^/stable/10 .

This was accidentally missed in r313439

r313439 | ngie | 2017-02-08 01:46:15 -0800 (Wed, 08 Feb 2017) | 25 lines

Merge content from ^/projects/netbsd-tests-upstream-01-2017 into ^/head

The primary end-goal of this drop is ease future merges with NetBSD and
collaborate further with the NetBSD project.

The goal was (largely, not completely as some items are still oustanding
in the NetBSD GNATS system) achieved by doing the following:
- Pushing as many changes required to port contrib/netbsd-tests
  back to NetBSD as possible, then pull the upstream applied changes
  back in to FreeBSD.
- Diff reduce with upstream where possible by:
-- Improving libnetbsd header, etc compat glue.
-- Using _SED variables to modify test scripts on the fly for items
   that could not be upstreamed to NetBSD.

As a bonus for this work, this change also introduces testcases for
uniq(1).

Many thanks to Christos for working with me to get many of the changes
back into the NetBSD project.

In collaboration with: Christos Zoulas <christos@netbsd.org>

git-svn-id: svn://svn.freebsd.org/base/stable/10@314817 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r314062
davidcs [Mon, 6 Mar 2017 20:35:03 +0000 (20:35 +0000)]
MFC r314062
add bus_dmamap_unload in ql_free_dmabuf()

git-svn-id: svn://svn.freebsd.org/base/stable/10@314791 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r314509 and r314578.
np [Mon, 6 Mar 2017 15:16:15 +0000 (15:16 +0000)]
MFC r314509 and r314578.

r314509:
cxgbe/iw_cxgbe: Do not check the size of the memory region being
registered.  T4/5/6 have no internal limit on this size.  This is
probably a copy paste from the T3 iw_cxgb driver.

r314578:
cxgbe/iw_cxgbe: Implement sq/rq drain operation.

ULPs can set a qp's state to ERROR and then post a work request on the
sq and/or rq.  When the reply for that work request comes back it is
guaranteed that all previous work requests posted on that queue have
been drained.

Sponsored by: Chelsio Communications

git-svn-id: svn://svn.freebsd.org/base/stable/10@314776 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r314338: Polish handling of different reset flavours.
mav [Mon, 6 Mar 2017 06:47:05 +0000 (06:47 +0000)]
MFC r314338: Polish handling of different reset flavours.

The biggest change is that ctl_remove_initiator() now generates I_T NEXUS
LOSS event, cleaning part of LUs state related to the initiator.

git-svn-id: svn://svn.freebsd.org/base/stable/10@314767 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r314326: Send TERMINATE to firmware when aborting active ATIO.
mav [Mon, 6 Mar 2017 06:45:35 +0000 (06:45 +0000)]
MFC r314326: Send TERMINATE to firmware when aborting active ATIO.

git-svn-id: svn://svn.freebsd.org/base/stable/10@314765 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r314496: Add check missed in r314257.
mav [Mon, 6 Mar 2017 06:43:17 +0000 (06:43 +0000)]
MFC r314496: Add check missed in r314257.

git-svn-id: svn://svn.freebsd.org/base/stable/10@314763 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r314387: Make ctl_queue_sense() not sleep.
mav [Mon, 6 Mar 2017 06:41:06 +0000 (06:41 +0000)]
MFC r314387: Make ctl_queue_sense() not sleep.

It may be called in non-sleepable frontend context.

git-svn-id: svn://svn.freebsd.org/base/stable/10@314761 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r314302: Return better error code in case of too long CDB.
mav [Mon, 6 Mar 2017 06:39:42 +0000 (06:39 +0000)]
MFC r314302: Return better error code in case of too long CDB.

Its more important for SPI HBAs, as they don't support CDBs above 12 bytes.
The new error code makes CAM to fall back to alternative commands.

git-svn-id: svn://svn.freebsd.org/base/stable/10@314759 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r314299, r314300: Fix residual length reporting in target mode.
mav [Mon, 6 Mar 2017 06:38:26 +0000 (06:38 +0000)]
MFC r314299, r314300: Fix residual length reporting in target mode.

This allows to properly handle cases when target wants to receive or send
more data then initiator wants to send or receive.  Previously in such
cases isp(4) returned CAM_DATA_RUN_ERR, while now it returns resid > 0.

git-svn-id: svn://svn.freebsd.org/base/stable/10@314757 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r314257: Add reporting SAS protocol, in case we ever have one.
mav [Mon, 6 Mar 2017 06:36:45 +0000 (06:36 +0000)]
MFC r314257: Add reporting SAS protocol, in case we ever have one.

git-svn-id: svn://svn.freebsd.org/base/stable/10@314755 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r314255: Reenable CTL_WITH_CA, optimizing it for lower memory usage.
mav [Mon, 6 Mar 2017 06:35:32 +0000 (06:35 +0000)]
MFC r314255: Reenable CTL_WITH_CA, optimizing it for lower memory usage.

This code was disabled due to its high memory usage.  But now we need this
functionality for cfumass(4) frontend, since USB MS BBB transport does not
support autosense.

git-svn-id: svn://svn.freebsd.org/base/stable/10@314753 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r314247: Axe out some forever disabled questionable functionality.
mav [Mon, 6 Mar 2017 06:33:18 +0000 (06:33 +0000)]
MFC r314247: Axe out some forever disabled questionable functionality.

This code is complicated enough even in its base shape.

git-svn-id: svn://svn.freebsd.org/base/stable/10@314751 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r314246: Improve CAM target frontend reference counting.
mav [Mon, 6 Mar 2017 06:32:14 +0000 (06:32 +0000)]
MFC r314246: Improve CAM target frontend reference counting.

Before this change it was possible to trigger some use-after-free panics
by disabling LUNs/ports under heavy load.

git-svn-id: svn://svn.freebsd.org/base/stable/10@314749 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r314208: Respecting r314204 tighten ATIO cleanup requirements.
mav [Mon, 6 Mar 2017 06:30:55 +0000 (06:30 +0000)]
MFC r314208: Respecting r314204 tighten ATIO cleanup requirements.

Every ATIO must complete with either successfully sent status or XPT_ABORT.

git-svn-id: svn://svn.freebsd.org/base/stable/10@314747 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r314204: Explicitly abort ATIO if CTIO sending status has failed.
mav [Mon, 6 Mar 2017 06:29:42 +0000 (06:29 +0000)]
MFC r314204: Explicitly abort ATIO if CTIO sending status has failed.

This helps SIM to free related resources in questionable cases.

git-svn-id: svn://svn.freebsd.org/base/stable/10@314745 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r314203: Fix missing xpt_done() for ATIO/INOT on missing LUN.
mav [Mon, 6 Mar 2017 06:28:30 +0000 (06:28 +0000)]
MFC r314203: Fix missing xpt_done() for ATIO/INOT on missing LUN.

git-svn-id: svn://svn.freebsd.org/base/stable/10@314743 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r314200: We can't access periph after ctlfe_free_ccb().
mav [Mon, 6 Mar 2017 06:26:43 +0000 (06:26 +0000)]
MFC r314200: We can't access periph after ctlfe_free_ccb().

git-svn-id: svn://svn.freebsd.org/base/stable/10@314740 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r314196: Unify ATIO/INOT CCBs requeuing.
mav [Mon, 6 Mar 2017 06:26:02 +0000 (06:26 +0000)]
MFC r314196: Unify ATIO/INOT CCBs requeuing.

git-svn-id: svn://svn.freebsd.org/base/stable/10@314739 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r314193: Some code cleanup.
mav [Mon, 6 Mar 2017 06:24:53 +0000 (06:24 +0000)]
MFC r314193: Some code cleanup.

git-svn-id: svn://svn.freebsd.org/base/stable/10@314737 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r314088: Slightly polish isp_dump_atpd().
mav [Mon, 6 Mar 2017 06:23:45 +0000 (06:23 +0000)]
MFC r314088: Slightly polish isp_dump_atpd().

git-svn-id: svn://svn.freebsd.org/base/stable/10@314735 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f