]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
5 years agoAdd 'v' modifier to the ddb 'show pginfo' command to display vm_page
kib [Sun, 30 Dec 2018 15:58:18 +0000 (15:58 +0000)]
Add 'v' modifier to the ddb 'show pginfo' command to display vm_page
backing the provided kernel virtual address.

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

5 years agoBump __FreeBSD_version since r342628 changed size of struct linux_cdev
kib [Sun, 30 Dec 2018 15:55:30 +0000 (15:55 +0000)]
Bump __FreeBSD_version since r342628 changed size of struct linux_cdev
on tier-1 i386 architecture.

Requested by: hselasky
MFC after: 1 week
Sponsored by: Mellanox Technologies

5 years agoFix linux_destroy_dev() behaviour when there are still files open from
kib [Sun, 30 Dec 2018 15:46:45 +0000 (15:46 +0000)]
Fix linux_destroy_dev() behaviour when there are still files open from
the destroying cdev.

Currently linux_destroy_dev() waits for the reference count on the
linux cdev to drain, and each open file hold the reference.
Practically it means that linux_destroy_dev() is blocked until all
userspace processes that have the cdev open, exit.  FreeBSD devfs does
not have such problem, because device refcount only prevents freeing
of the cdev memory, and separate 'active methods' counter blocks
destroy_dev() until all threads leave the cdevsw methods.  After that,
attempts to enter cdevsw methods are refused with an error.

Implement somewhat similar mechanism for LinuxKPI cdevs.  Demote cdev
refcount to only mean a hold on the linux cdev memory.  Add sirefs
count to track both number of threads inside the cdev methods, and for
single-bit indicator that cdev is being destroyed.  In the later case,
the call is redirected to the dummy cdev.

Reviewed by: markj
Discussed with: hselasky
Tested by: zeising
MFC after: 1 week
Sponsored by: Mellanox Technologies
Differential revision: https://reviews.freebsd.org/D18606

5 years agoImplement zap_vma_ptes() for managed device objects.
kib [Sun, 30 Dec 2018 15:38:07 +0000 (15:38 +0000)]
Implement zap_vma_ptes() for managed device objects.

Reviewed by: markj
Discussed with: hselasky
Tested by: zeising
MFC after: 1 week
Sponsored by: Mellanox Technologies
Differential revision: https://reviews.freebsd.org/D18606

5 years agoAdd Copyright.
tsoome [Sun, 30 Dec 2018 15:34:12 +0000 (15:34 +0000)]
Add Copyright.

Reported by: Rodney W. Grimes

5 years agoUse IDX_TO_OFF().
kib [Sun, 30 Dec 2018 15:28:31 +0000 (15:28 +0000)]
Use IDX_TO_OFF().

Reviewed by: markj
Discussed with: hselasky
Tested by: zeising
MFC after: 1 week
Sponsored by: Mellanox Technologies
Differential revision: https://reviews.freebsd.org/D18606

5 years agoloader: create bio_alloc and bio_free for bios bounce buffer
tsoome [Sun, 30 Dec 2018 09:35:47 +0000 (09:35 +0000)]
loader: create bio_alloc and bio_free for bios bounce buffer

We do have 16KB buffer space defined in pxe.c, move it to bio.c and implement
bio_alloc()/bio_free() interface to make it possible to use this space for
other BIOS calls (notably, from biosdisk.c).

MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D17131

5 years agoProperly set svn:mimetype for zh_CN.UTF-8.src.
delphij [Sun, 30 Dec 2018 08:30:11 +0000 (08:30 +0000)]
Properly set svn:mimetype for zh_CN.UTF-8.src.

MFC after: 2 weeks

5 years agoImport tzdata 2018h
philip [Sun, 30 Dec 2018 08:22:35 +0000 (08:22 +0000)]
Import tzdata 2018h

Changes: https://github.com/eggert/tz/blob/2018h/NEWS

MFC after: 3 days

5 years agoMove ASSERT_VOP_LOCKED to top of ufs_vinit() as it should be true
mckusick [Sun, 30 Dec 2018 06:03:20 +0000 (06:03 +0000)]
Move ASSERT_VOP_LOCKED to top of ufs_vinit() as it should be true
when the function is entered.

Suggested by: kib

5 years agoFor consistency with FFS2's fifoops2 and both versions of FFS's
mckusick [Sun, 30 Dec 2018 05:03:41 +0000 (05:03 +0000)]
For consistency with FFS2's fifoops2 and both versions of FFS's
vnodeops make FFS1's fifoops1 use ffs_lock. Also delete ffs_reallocblks
from fifoops1 which is needed only for fifoops2 because of its
support for extended attributes that need to allocate blocks.

Suggested by: kib

5 years agoTCP_PAWS_IDLE is does not exist in NetBSD and illumos. In FreeBSD
cy [Sun, 30 Dec 2018 04:25:48 +0000 (04:25 +0000)]
TCP_PAWS_IDLE is does not exist in NetBSD and illumos. In FreeBSD
TCP_PAWS_IDLE is defined in netinet/tcp_seq.h, however this header
isn't included explicitly or implicitly at this point therefore
as far ipfilter is concerned TCP_PAWS_IDLE is not defined. Remove
the #ifdef and include netinet/tcp.h unconditionally.

MFC after: 1 week

5 years agonet80211: fix duplicate sequence number bump for non-AMPDU QoS frames.
avos [Sun, 30 Dec 2018 03:03:53 +0000 (03:03 +0000)]
net80211: fix duplicate sequence number bump for non-AMPDU QoS frames.

This should be a part of r312972.

MFC after: 4 days

5 years agocxgbe(4): Attach to two T540 variants.
np [Sun, 30 Dec 2018 01:57:11 +0000 (01:57 +0000)]
cxgbe(4): Attach to two T540 variants.

MFC after: 1 week

5 years agoports.7: Add an example of getting dependencies without building them
0mp [Sun, 30 Dec 2018 00:27:28 +0000 (00:27 +0000)]
ports.7: Add an example of getting dependencies without building them

While here, improve formatting of the EXAMPLES section in general.

Reviewed by: bcr
Approved by: bcr (doc)
Approved by: krion (mentor, implicit), mat (mentor, implicit)
Differential Revision: https://reviews.freebsd.org/D18682

5 years agoAdd a note that the use of -B option does not guarantee a size of fragment
crees [Sat, 29 Dec 2018 23:08:59 +0000 (23:08 +0000)]
Add a note that the use of -B option does not guarantee a size of fragment
if -z option also used.

Recommend the use of zip(1) if compressed files of predictable size needed.

PR: docs/41089
Submitted by: Sevan Janiyan
Reported by: areilly@bigpond.net.au

While here, pet igor

Reviewed by: bcr
Differential Revision: https://reviews.freebsd.org/D18686

5 years agostyle.mdoc.5: Suggest preferred formatting for EXAMPLES
0mp [Sat, 29 Dec 2018 23:00:20 +0000 (23:00 +0000)]
style.mdoc.5: Suggest preferred formatting for EXAMPLES

Add an example of how to format examples in EXAMPLES sections. The
suggested format is heavily based on zfs.8.

While here, capitalize subsection titles.

Reviewed by: bcr
Approved by: bcr (doc),
Approved by: krion (mentor, implicit), mat (mentor, implicit)
Differential Revision: https://reviews.freebsd.org/D18681

5 years agoSimplify jail ID printing on process exit
kp [Sat, 29 Dec 2018 21:36:02 +0000 (21:36 +0000)]
Simplify jail ID printing on process exit

As suggested by kib@, we don't need to check p_ucred, because that's only NULL
during process creation, and cr_prison is never NULL.

5 years agoUpdate to Zstandard 1.3.8
cem [Sat, 29 Dec 2018 21:18:01 +0000 (21:18 +0000)]
Update to Zstandard 1.3.8

This merge brings in a couple new files, which needed to be attached to the
build; a new dependency on <limits.h>, which must be stubbed; and a name
change in the Context parameter constants, from ZSTD_p_foo to ZSTD_c_foo.

Significantly, it fixes a kernel build error with GCC where floating-point
functions were included in the kernel build, by hiding them under the same
compile-time #ifdef that already covered their invocation.  That issue was
introduced to FreeBSD in the 1.3.7 update and tracked upstream here:

  https://github.com/facebook/zstd/issues/1386

The full 1.3.8 release notes can be found on Github:

  https://github.com/facebook/zstd/releases/tag/v1.3.8

Relnotes: yes

5 years agoRemove legacy rc.d infrastructure references from rc(8)
ngie [Sat, 29 Dec 2018 20:02:20 +0000 (20:02 +0000)]
Remove legacy rc.d infrastructure references from rc(8)

Legacy rc.d scripts (.sh extension) have not been supported since
r193118. Remove the outdated references to the legacy format, as they
are no longer valid.

Bug: 193936
MFC after: 1 week
Reviewed by: cress, emaste (mentor)
Differential Revision: https://reviews.freebsd.org/D18666

5 years agoRemove duplicate include of sys/mbuf.h.
cy [Sat, 29 Dec 2018 18:11:17 +0000 (18:11 +0000)]
Remove duplicate include of sys/mbuf.h.

Reported by: Trond Endrest <Trond.Endrestol@ximalas.info>
MFC after: 3 days

5 years agoFor hw.{physmem,realmem,usermem} MIBs, clamp instead truncating.
kib [Sat, 29 Dec 2018 15:55:44 +0000 (15:55 +0000)]
For hw.{physmem,realmem,usermem} MIBs, clamp instead truncating.

If the memory size does not fit into u_long, current code truncates
the returned value and returns complete nonsense.  Make the result
slightly more useful by clamping it at ULONG_MAX.

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

5 years agoi386: Fix allocation of the KVA frame for pmap_quick_enter_page().
kib [Sat, 29 Dec 2018 15:49:03 +0000 (15:49 +0000)]
i386: Fix allocation of the KVA frame for pmap_quick_enter_page().

Due to the typo, it shared the frame with the CMAP1 transient mapping.

In collaboration with: pho
MFC after: 3 days
Sponsored by: The FreeBSD Foundation (kib)

5 years agoPull in r342863 from upstream llvm trunk (by Hans Wennborg):
dim [Sat, 29 Dec 2018 15:21:51 +0000 (15:21 +0000)]
Pull in r342863 from upstream llvm trunk (by Hans Wennborg):

  Remove debug printf leftover from r342397

PR: 234480
MFC after: 6 weeks
X-MFC-With: r341825

5 years agoPull in r342397 from upstream llvm trunk (by Amara Emerson):
dim [Sat, 29 Dec 2018 15:13:49 +0000 (15:13 +0000)]
Pull in r342397 from upstream llvm trunk (by Amara Emerson):

  Revert "Revert r342183 "[DAGCombine] Fix crash when store merging
  created an extract_subvector with invalid index.""

  Fixed the assertion failure.

  Differential Revision: https://reviews.llvm.org/D51831

This fixes 'Assertion failed: ((VT.getVectorNumElements() +
N2C->getZExtValue() <= N1.getValueType().getVectorNumElements()) &&
"Extract subvector overflow!"), function getNode' when building the
multimedia/aom port (with AVX2 enabled).

Reported by: jbeich
PR: 234480
MFC after: 6 weeks
X-MFC-With: r341825

5 years agoMake kernel print jail ID when logging a process exit
kp [Sat, 29 Dec 2018 14:48:51 +0000 (14:48 +0000)]
Make kernel print jail ID when logging a process exit

Kernel now includes jail ID when logging a process exit. jid is 0 for unjailed
processes.

Submitted by: Marie Helene Kvello-Aune <freebsd@mhka.no>
Relnotes: yes
Sponsored by: Modirum MDPay
Differential Revision: https://reviews.freebsd.org/D18618

5 years agoimport zstd 1.3.8
cem [Sat, 29 Dec 2018 06:51:10 +0000 (06:51 +0000)]
import zstd 1.3.8

5 years agoar: detect and error out on 32-bit symbol table overflow
emaste [Fri, 28 Dec 2018 22:47:55 +0000 (22:47 +0000)]
ar: detect and error out on 32-bit symbol table overflow

BSD ar currently does not support the /SYM64/ 64-bit symbol table, and
previously truncated to 32-bits, silently producing corrupted archives
larger than 4GB.

This is another overflow case in addtion to r342575.

PR: 234454
Reported by: Aijaz Baig, imp
MFC after: 2 weeks
MFC with: r342575
Sponsored by: The FreeBSD Foundation

5 years agoImprove the efibootmgr(8) man page
bcran [Fri, 28 Dec 2018 21:26:45 +0000 (21:26 +0000)]
Improve the efibootmgr(8) man page

Fix formatting, typos, and attempt to improve the wording.

Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D18646

5 years agoAdd a style.mdoc(5) manual page.
0mp [Fri, 28 Dec 2018 19:49:58 +0000 (19:49 +0000)]
Add a style.mdoc(5) manual page.

The aim of this manual page is to act as a style and formatting guide for
mdoc(7) manual pages. Currently, mdoc(7) does not provide much guidance
when it comes to the usage of macros making it difficult to format manual
pages in a consistent way.

Reviewed by: bcr
Approved by: bcr (doc), krion (mentor, implicit), mat (mentor, implicit)
Differential Revision: https://reviews.freebsd.org/D18394

5 years agoMake sh(1) collapse $HOME into "~" in PS1.
trasz [Fri, 28 Dec 2018 17:51:40 +0000 (17:51 +0000)]
Make sh(1) collapse $HOME into "~" in PS1.

Reviewed by: jilles
MFC after: 2 weeks
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D18663

5 years agoSimplify the way we set the default sh(1) PS1. No functional changes.
trasz [Fri, 28 Dec 2018 17:50:40 +0000 (17:50 +0000)]
Simplify the way we set the default sh(1) PS1.  No functional changes.

Reviewed by: jilles
MFC after: 2 weeks
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D18662

5 years agoar: detect and error out on 32-bit symbol table overflow
emaste [Fri, 28 Dec 2018 17:00:12 +0000 (17:00 +0000)]
ar: detect and error out on 32-bit symbol table overflow

BSD ar currently does not support the /SYM64/ 64-bit symbol table, and
previously truncated to 32-bits, silently producing corrupted archives
larger than 4GB.

Note that this is only a partial fix; additional checks will come.

PR: 234454
Reported by: Aijaz Baig, imp
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation

5 years agoFix WITHOUT_NLS build after r342551.
kib [Fri, 28 Dec 2018 16:08:49 +0000 (16:08 +0000)]
Fix WITHOUT_NLS build after r342551.

Reported by: gj
MFC after: 13 days
Sponsored by: The FreeBSD Foundation

5 years agoThere is no way of escaping literal $ signs in auto_master(5), which
crees [Fri, 28 Dec 2018 15:11:22 +0000 (15:11 +0000)]
There is no way of escaping literal $ signs in auto_master(5), which
makes for difficulty with hidden Samba shares; shares with $ at the end
of their name.  This enables the use of ${DOLLAR} to work around this.

Reviewed by: bcr (man page)
Approved by: trasz
Differential Revision: https://reviews.freebsd.org/D7048

5 years agopfind, pfind_any: Correct zombie logic
jilles [Fri, 28 Dec 2018 13:32:14 +0000 (13:32 +0000)]
pfind, pfind_any: Correct zombie logic

SVN r340744 erroneously changed pfind() to return any process including
zombies and pfind_any() to return only non-zombie processes.

In particular, this caused kill() on a zombie process to fail with [ESRCH].
There is no direct test case for this but /usr/tests/bin/sh/builtins/kill1.0
occasionally triggers it (as reported by lwhsu).

Conversely, returning zombies from pfind() seems likely to violate
invariants and cause panics, but I have not looked at this.

PR: 233646
Reviewed by: mjg, kib, ngie
Differential Revision: https://reviews.freebsd.org/D18665

5 years agolibm: Include float.h to get LDBL_MANT_DIG
jhibbits [Fri, 28 Dec 2018 01:34:08 +0000 (01:34 +0000)]
libm: Include float.h to get LDBL_MANT_DIG

The long double aliases of double functions are only exposed as aliases if
LDBL_MANT_DIG is 53 (same as DBL_MANT_DIG).  Without float.h included these
files were not exposing weak aliases as expected, leading to link failures
if programs use the *l functions.  This should fix editors/calligra on
targets with 64-bit long double, which uses erfl and erfcl.  Found on
powerpc64.

Reviewed by: kargl@

5 years agobeinstall: try to save progress from pkg updates.
will [Thu, 27 Dec 2018 23:27:48 +0000 (23:27 +0000)]
beinstall: try to save progress from pkg updates.

This is primarily aimed at failed updates due to package conflicts, and
affects treatment of failed updates.  Whereas before potentially a large
number of packages would need to be synced for each attempt, they can now
be persisted.  Requires rsync.  There may be better ways to implement this,
e.g. using secondary cache path that is only used on followup attempts and
then wiped on success, which avoids polluting current cache.

5 years agoFix incorrectly inserted copyright in r342557.
mav [Thu, 27 Dec 2018 22:44:07 +0000 (22:44 +0000)]
Fix incorrectly inserted copyright in r342557.

Reported by: rgrimes
MFC after: 1 month

5 years agoSwitch from mutexes to atomics in GEOM_DEV I/O path.
mav [Thu, 27 Dec 2018 19:15:24 +0000 (19:15 +0000)]
Switch from mutexes to atomics in GEOM_DEV I/O path.

Mutexes in I/O path there were used twice per I/O to atomically access
several variables to close and/or destroy the device on last request
completion.  I found the way to fit all required info into one integer,
suitable for atomic operations.  It opened race window on device close,
but addition of timeout to the msleep() there should cover it.

Profiling shows removal of significant spinning time on those mutexes
and IOPS increase from ~600K to >800K to NVMe on 72-core systems.

MFC after: 1 month
Sponsored by: iXsystems, Inc.

5 years agoReimplement nvd(4) detach handling.
mav [Thu, 27 Dec 2018 18:28:19 +0000 (18:28 +0000)]
Reimplement nvd(4) detach handling.

Previous code typically crashed in case of NVMe device unplug or even clean
detach while some I/Os are still in flight.  To fix this the new code calls
disk_gone() and waits for confirmation of all references gone before calling
disk_destroy(), freeing other resources and allowing controller detach.

While there, fix disk lists locking and reimplement unit numbers assignment.

MFC after: 1 month
Sponsored by: iXsystems, Inc.

5 years agovnet.9: clarify VNET sponsorship
emaste [Thu, 27 Dec 2018 16:50:28 +0000 (16:50 +0000)]
vnet.9: clarify VNET sponsorship

The FreeBSD Foundation and NLnet Foundation sponsored the original work,
and the Foundation sponsored followon work and integration efforts by
bz@.

Sponsored by: The FreeBSD Foundation

5 years agoiscsictl.8: Add missing flag parameters
0mp [Thu, 27 Dec 2018 14:44:01 +0000 (14:44 +0000)]
iscsictl.8: Add missing flag parameters

- Add missing parameters to flags in the description of available options.
- Remove spaces between alternative parameters and "|".
- Align descriptions of options to the longest option.
- Use em dash instead of a hyphen.

Reviewed by: bcr
Approved by: doc (bcr)
Approved by: krion (mentor, implicit), mat (mentor, implicit)
Differential Revision: https://reviews.freebsd.org/D18608

5 years agoPass VM_PROT_EXECUTE to vm_fault for instruction faults.
andrew [Thu, 27 Dec 2018 14:14:41 +0000 (14:14 +0000)]
Pass VM_PROT_EXECUTE to vm_fault for instruction faults.

We need to tell vm_fault the reason for the fault was because we tried to
execute from the memory location. Without this it may return with success
as we only request read-only memory, then we return to the same location
and try to execute from the same memory address. This leads to an infinite
loop raising the same fault and returning to the same invalid location.

MFC after: 1 week
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D18511

5 years agoBump sys_errlist size to keep ABI backward-compatible for some time.
kib [Thu, 27 Dec 2018 13:02:15 +0000 (13:02 +0000)]
Bump sys_errlist size to keep ABI backward-compatible for some time.

Addition of the new errno values requires adding new elements to
sys_errlist array, which is actually ABI-incompatible, since ELF
records the object size.  Expand array in advance to 150 elements so
that we have our users to go over the issue only once, at least until
more than 53 new errors are added.

I did not bumped the symbol version, same as it was not done for
previous increases of the array size.  Runtime linker only copies as
much data into binary object on copy relocation as the binary'object
specifies.  This is not fixable for binaries which access sys_errlist
directly.

While there, correct comment and calculation of the temporary buffer
size for the message printed for unknown error.  The on-stack buffer
is used only for the number and delimiter since r108603.

Requested by: mckusick
Reviewed by: mckusick, yuripv
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential revision: https://reviews.freebsd.org/D18656

5 years agoAmend the `-i batt' option description and explain that the battery
danfe [Thu, 27 Dec 2018 08:48:54 +0000 (08:48 +0000)]
Amend the `-i batt' option description and explain that the battery
is specified by its number (index), starting with zero.  Previously,
sometimes users would try to literally invoke `acpiconf -i batt' in
their console and become confused as to why this did not work.

Approved by: bcr (manpages)
Differential Revision: https://reviews.freebsd.org/D18659

5 years agoAdd USB quirk for SPL Crimson Rev 1.
hselasky [Thu, 27 Dec 2018 08:29:05 +0000 (08:29 +0000)]
Add USB quirk for SPL Crimson Rev 1.

PR: 234380
MFC after: 1 week
Sponsored by: Mellanox Technologies

5 years agoWhen loading an inode from disk, verify that its mode is valid.
mckusick [Thu, 27 Dec 2018 07:18:53 +0000 (07:18 +0000)]
When loading an inode from disk, verify that its mode is valid.
If invalid, return EINVAL. Note that inode check-hashes greatly
reduce the chance that these errors will go undetected.

Reported by:  Christopher Krah <krah@protonmail.com>
Reported as:  FS-5-UFS-2: Denial Of Service in nmount-3 (ffs_read)
Reviewed by:  kib
MFC after:    1 week
Sponsored by: Netflix

M    sys/fs/ext2fs/ext2_vnops.c
M    sys/kern/vfs_subr.c
M    sys/ufs/ffs/ffs_snapshot.c
M    sys/ufs/ufs/ufs_vnops.c

5 years agoRemove another empty #ifdef block. This empty block also exists in
cy [Thu, 27 Dec 2018 04:53:53 +0000 (04:53 +0000)]
Remove another empty #ifdef block. This empty block also exists in
the upstream HEAD.

MFC after: 3 days

5 years agoAdd descriptions to NVMe interrupts.
mav [Wed, 26 Dec 2018 23:41:52 +0000 (23:41 +0000)]
Add descriptions to NVMe interrupts.

MFC after: 1 month

5 years agoMFV r342532: 5882 Temporary pool names
avg [Wed, 26 Dec 2018 11:03:14 +0000 (11:03 +0000)]
MFV r342532: 5882 Temporary pool names

Note that this commit brings only formatting changes that were done
during the final review of the illumos change, because FreeBSD got the
main changes before illumos.

illumos/illumos-gate@04e56356520b98d5a93c496b10f02530bb6647e0
https://github.com/illumos/illumos-gate/commit/04e56356520b98d5a93c496b10f02530bb6647e0

https://www.illumos.org/issues/5882
  This is an import of the temporary pool names functionality from ZoL:
  https://github.com/zfsonlinux/zfs/commit/e2282ef57edc79cdce2a4b9b7e3333c56494a807
  https://github.com/zfsonlinux/zfs/commit/26b42f3f9d03f85cc7966dc2fe4dfe9216601b0e
  https://github.com/zfsonlinux/zfs/commit/2f3ec9006146844af6763d1fa4e823fd9047fd54
  https://github.com/zfsonlinux/zfs/commit/00d2a8c92f614f49d23dea5d73f7ea7eb489ccf1
  https://github.com/zfsonlinux/zfs/commit/83e9986f6eefdf0afc387f06407087bba3ead4e9
  https://github.com/zfsonlinux/zfs/commit/023bbe6f017380f4a04c5060feb24dd8cdda9fce
  It is intended to assist the creation and management of virtual machines
  that have their rootfs on ZFS on hosts that also have their rootfs on
  ZFS. These situations cause SPA namespace collisions when the standard
  name rpool is used in both cases. The solution is either to give each
  guest pool a name unique to the host, which is not always desireable, or
  boot a VM environment containing an ISO image to install it, which is
  cumbersome.

MFC after: 1 week
Sponsored by: Panzura

5 years agoDriver version upgrade.
kadesai [Wed, 26 Dec 2018 10:48:39 +0000 (10:48 +0000)]
Driver version upgrade.

Submitted by: Sumit Saxena <sumit.saxena@broadcom.com>
Reviewed by:  Kashyap Desai <Kashyap.Desai@broadcom.com>
Approved by:  ken
MFC after:  3 days
Sponsored by:   Broadcom Inc

5 years agoProblem statement:
kadesai [Wed, 26 Dec 2018 10:47:52 +0000 (10:47 +0000)]
Problem statement:
Due to hardware errata in Aero controllers, reads to certain
fusion registers could intermittently return all zeroes.
This behavior is transient in nature and subsequent reads will return
valid value.

Fix:
For Aero controllers, any read will retry the read operations
from certain registers for maximum three times, if read returns zero.

Submitted by: Sumit Saxena <sumit.saxena@broadcom.com>
Reviewed by:  Kashyap Desai <Kashyap.Desai@broadcom.com>
Approved by:  ken
MFC after:  3 days
Sponsored by:   Broadcom Inc

5 years agoThis patch will add support for 32 bit atomic request descriptor for Aero adapters.
kadesai [Wed, 26 Dec 2018 10:47:08 +0000 (10:47 +0000)]
This patch will add support for 32 bit atomic request descriptor for Aero adapters.

For Aero adapters-
1. Driver will use 32 bit atomic descriptor to fire IOs and DCMDs.
2. Driver will use 64 bit request descriptor to fire IOC INIT.
3. If Aero firmware supports 32 bit atomic descriptor, then only driver will use it
otherwise driver will use 64 bit request descriptor.

For rest of adapters(Ventura, Invader and Thunderbolt), driver will use 64 bit request
descriptors only.

Submitted by: Sumit Saxena <sumit.saxena@broadcom.com>
Reviewed by:  Kashyap Desai <Kashyap.Desai@broadcom.com>
Approved by:  ken
MFC after:  3 days
Sponsored by:   Broadcom Inc

5 years agoThis patch will add support for latest generation MegaRAID adapters- Aero(39xx).
kadesai [Wed, 26 Dec 2018 10:46:23 +0000 (10:46 +0000)]
This patch will add support for latest generation MegaRAID adapters- Aero(39xx).
Driver will throw a warning message when a Configurable secure type controller is
encountered.

Submitted by: Sumit Saxena <sumit.saxena@broadcom.com>
Reviewed by:  Kashyap Desai <Kashyap.Desai@broadcom.com>
Approved by:  ken
MFC after:  3 days
Sponsored by:   Broadcom Inc

5 years agoUpdate mpr driver version to v23.00.00.00-fbsd
kadesai [Wed, 26 Dec 2018 10:44:30 +0000 (10:44 +0000)]
Update mpr driver version to v23.00.00.00-fbsd

Submitted by: Sreekanth Reddy <sreekanth.reddy@broadcom.com>
Reviewed by:  Kashyap Desai <Kashyap.Desai@broadcom.com>
Approved by:  ken
MFC after:  3 days
Sponsored by:   Broadcom Inc

5 years agoUpdate copyright information
kadesai [Wed, 26 Dec 2018 10:43:31 +0000 (10:43 +0000)]
Update copyright information

Submitted by: Sreekanth Reddy <sreekanth.reddy@broadcom.com>
Reviewed by:  Kashyap Desai <Kashyap.Desai@broadcom.com>
Approved by:  ken
MFC after:  3 days
Sponsored by:   Broadcom Inc

5 years agoOn Aero/Sea A0 cards retry MPT Fusion registers reads for max three times
kadesai [Wed, 26 Dec 2018 10:42:45 +0000 (10:42 +0000)]
On Aero/Sea A0 cards retry MPT Fusion registers reads for max three times

Due to HW Errta on Aero/Sea A0 chipset on secure boot mode & on heavy IO load,
sometimes read operation on MPT Fusion registers will give zero value,
So, as a workaround driver will retry the MPT Fusion register
read operation for max three times upon reading zero value form these
registers.

Submitted by: Sreekanth Reddy <sreekanth.reddy@broadcom.com>
Reviewed by:  Kashyap Desai <Kashyap.Desai@broadcom.com>
Approved by:  ken
MFC after:  3 days
Sponsored by:   Broadcom Inc

5 years agoEnable atomic type descriptor support only for Sea & Aero cards
kadesai [Wed, 26 Dec 2018 10:41:53 +0000 (10:41 +0000)]
Enable atomic type descriptor support only for Sea & Aero cards

Enable atomic type descriptor support only for Sea & Aero cards,
due to HW errata this atomic descriptor support has to be disabled
on Ventura cards.

Submitted by: Sreekanth Reddy <sreekanth.reddy@broadcom.com>
Reviewed by:  Kashyap Desai <Kashyap.Desai@broadcom.com>
Approved by:  ken
MFC after:  3 days
Sponsored by:   Broadcom Inc

5 years agoAdd Sea,Aero adapter support
kadesai [Wed, 26 Dec 2018 10:41:14 +0000 (10:41 +0000)]
Add Sea,Aero adapter support

Added deviceID's for Sea,Aero to mpr Driver
Aero:
        0x00E0 Invalid
        0x00E1 Configurable Secure
        0x00E2 Hard Secure
        0x00E3 Tampered
Sea:
        0x00E4 Invalid
        0x00E5 Configurable Secure
        0x00E6 Hard Secure
        0x00E7 Tampered

For Tampered & Invalid type cards, driver will claim the device & quit the probe function with below error message,
"HBA is in Non Secure mode"

for Configurable Secure type cards, driver will display below message in .probe() callback function,
"HBA is in Configurable Secure mode"

Submitted by: Sreekanth Reddy <sreekanth.reddy@broadcom.com>
Reviewed by:  Kashyap Desai <Kashyap.Desai@broadcom.com>
Approved by:  ken
MFC after:  3 days
Sponsored by:   Broadcom Inc

5 years agoAdded support for NVMe Task Management
kadesai [Wed, 26 Dec 2018 10:40:27 +0000 (10:40 +0000)]
Added support for NVMe Task Management

Following list of changes done in the driver as a part of TM handling on the NVMe drives.
Below changes are only applicable on NVMe drives and only when custom NVMe TM handling bit is set to zero by IOC.

1. Issue LUN reset & Target reset TMs with Target reset method field set to Protocol Level reset (0x3),
2. For LUN & target reset TMs use the timeout value as ControllerResetTO value provided by firmware using PCie Device Page 0,
3. If LUN reset fails to terminates the IO then directly escalate to host reset instead of going for target reset TM,
4. For Abort TM use the timeout value as NVMeAbortTO value given by the IOC using Manufacturing Page 11,
5. Log message "PCie Host Reset failed" message up on receiving P

Submitted by: Sreekanth Reddy <sreekanth.reddy@broadcom.com>
Reviewed by:  Kashyap Desai <Kashyap.Desai@broadcom.com>
Approved by:  ken
MFC after:  3 days
Sponsored by:   Broadcom Inc

5 years agoCopy back the Sense data at proper location expected by the application
kadesai [Wed, 26 Dec 2018 10:39:22 +0000 (10:39 +0000)]
Copy back the Sense data at proper location expected by the application

typedef struct mps_pass_thru
{
               uint64_t               PtrRequest;
               uint64_t               PtrReply;
               uint64_t               PtrData;
               uint32_t               RequestSize;
               uint32_t               ReplySize;
               uint32_t               DataSize;
               uint32_t               DataDirection;
               uint64_t               PtrDataOut;
               uint32_t               DataOutSize;
               uint32_t               Timeout;
} mps_pass_thru_t, * ptrmpssas_pass_thru_t;

In the above mps_pass_thru structure; Application expects PrtReply buffer
should contain both MPI reply followed by sense data. So, updated driver
to copy sense data at PtrReply + sizeof(MPI2 reply) location where
application wants the driver to copy back the sense data info.

Submitted by: Sreekanth Reddy <sreekanth.reddy@broadcom.com>
Reviewed by:  Kashyap Desai <Kashyap.Desai@broadcom.com>
Approved by:  ken
MFC after:  3 days
Sponsored by:   Broadcom Inc

5 years agoUpdate MPI header files version to 2.00.52 from 2.00.48
kadesai [Wed, 26 Dec 2018 10:38:12 +0000 (10:38 +0000)]
Update MPI header files version to 2.00.52 from 2.00.48

Submitted by: Sreekanth Reddy <sreekanth.reddy@broadcom.com>
Reviewed by:  Kashyap Desai <Kashyap.Desai@broadcom.com>
Approved by:  ken
MFC after:  3 days
Sponsored by:   Broadcom Inc

5 years agoMFV r342469: 9630 add lzc_rename and lzc_destroy to libzfs_core
avg [Wed, 26 Dec 2018 10:37:41 +0000 (10:37 +0000)]
MFV r342469: 9630 add lzc_rename and lzc_destroy to libzfs_core

illumos/illumos-gate@049ba636fa37a2892809192fc671bff9158a01cd
https://github.com/illumos/illumos-gate/commit/049ba636fa37a2892809192fc671bff9158a01cd

https://www.illumos.org/issues/9630
  Rename and destroy are very useful operations that deserve to be in
  libzfs_core.  And they are not hard to implement too.

MFC after: 2 weeks
Relnotes: maybe

5 years agobectl: use jail id as the default jail name for a boot environment
kevans [Tue, 25 Dec 2018 15:18:41 +0000 (15:18 +0000)]
bectl: use jail id as the default jail name for a boot environment

By default, bectl is setting the jail 'name' parameter to the boot
environment name, which causes an error when the boot environment name is
not a valid jail name. With the attached fix, when no name is supplied, the
default jail name will be the jail id - this is is the same behavior as the
jail command.

Additionally, this commit addresses two other bugs that prevented unjailing
in scenarios where the jail name does not match the boot environment name:

1. In 'bectl_locate_jail', 'mountpoint' is used to resolve the boot
  environment path, but really 'mounted' should be used. 'mountpoint' is the
  path where the zfs dataset will be mounted. 'mounted' is the path where
  the dataset is actually mounted.

2. in 'bectl_search_jail_paths', 'jail_getv' would fail after the first
  call. Which is fine, if the boot environment you're unjailing is the next
  one up. According to 'man jail_getv', it's expecting name and value
  strings. 'jail_getv' is being passed an integer for the lastjid, so amend
  that to use a string instead.

Test cases have been amended to reflect the bugs found.

PR: 233637
Submitted by: Rob <rob.fx907_gmail.com>
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D18607

5 years agoFix reading of USB sample rate descriptor for SPL Crimson Rev 1.
hselasky [Tue, 25 Dec 2018 10:15:48 +0000 (10:15 +0000)]
Fix reading of USB sample rate descriptor for SPL Crimson Rev 1.

Read first one entry, then try to read the full rate descriptor table.

PR: 234380
MFC after: 1 week
Sponsored by: Mellanox Technologies

5 years agoIncrease MTX_POOL_SLEEP_SIZE from 128 to 1024.
mav [Mon, 24 Dec 2018 23:52:35 +0000 (23:52 +0000)]
Increase MTX_POOL_SLEEP_SIZE from 128 to 1024.

This value remained unchanged for 15 years, and now this bump reduces
lock spinning in GEOM and BIO layers while doing ~1.6M IOPS to 4 NVMe
on 72-core system from ~25% to ~5% by the cost of additional 28KB RAM.

While there, align struct mtx_pool fields to cache lines.

MFC after: 1 month

5 years agoRemove CAM SIM lock from NVMe SIM.
mav [Mon, 24 Dec 2018 23:28:11 +0000 (23:28 +0000)]
Remove CAM SIM lock from NVMe SIM.

CAM does not require SIM lock since FreeBSD 10.4, and NVMe code never
required it at all, using per-queue locks instead.  This formally allows
parallel request submission in CAM mode as much as single per-device and
per-queue locks of CAM allow.

MFC after: 1 month

5 years agoEnable sys/random.h #include from C++
cem [Mon, 24 Dec 2018 19:37:10 +0000 (19:37 +0000)]
Enable sys/random.h #include from C++

And bump __FreeBSD_version, just in case.

PR: 234180
Submitted by: Ralf van der Enden <tremere AT cainites.net>
MFC after: 5 days

5 years agoDragonFly 5.4.0, 5.4.1 and FreeBSD 12.0 releases added.
maxim [Mon, 24 Dec 2018 16:36:39 +0000 (16:36 +0000)]
DragonFly 5.4.0, 5.4.1 and FreeBSD 12.0 releases added.

5 years agoActivate support for efibootmgr(8) -b --bootnum parameter
bcran [Mon, 24 Dec 2018 15:38:36 +0000 (15:38 +0000)]
Activate support for efibootmgr(8) -b --bootnum parameter

Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D18647

5 years agoClarify kld_list format
crees [Mon, 24 Dec 2018 10:47:48 +0000 (10:47 +0000)]
Clarify kld_list format

PR: docs/234248
Submitted by: David Fiander
Submitted by: Miroslav Lachman

5 years agoFurther refactoring for task management commands. Also fix a related
scottl [Mon, 24 Dec 2018 06:14:32 +0000 (06:14 +0000)]
Further refactoring for task management commands.  Also fix a related
typo from the previous commit.

5 years agoCommands for user-initated device resets should come from the high-priority
scottl [Mon, 24 Dec 2018 05:54:36 +0000 (05:54 +0000)]
Commands for user-initated device resets should come from the high-priority
allocator.  Prior to this change, they would leak from the normal allocator.

5 years agoFirst step in refactoring and fixing the error recovery and task management
scottl [Mon, 24 Dec 2018 05:05:38 +0000 (05:05 +0000)]
First step in refactoring and fixing the error recovery and task management
code in the mpr and mps drivers.  Eliminate duplicated code and fix some
comments.

5 years agoRemove an empty #if block.
cy [Mon, 24 Dec 2018 01:12:43 +0000 (01:12 +0000)]
Remove an empty #if block.

The interesting thing is that looking through Darren's commit logs,
the line containing an extern ppsratecheck() definition was removed
from the v5-1-RELEASE branch but not from HEAD (I have taken his
CVS tree and converted it to GIT). There is a commit adding an
additional #if defined to the empty block. I can only assume that
this was intentional for something later. Looking through HEAD the
extern ppsratecheck() is there. However if we put it back it would
conflict with a static ppsratecheck() definition in fil.c when
building ipftest.

Therefore we remove this empty block.

ppsratecheck() is a function in the FreeBSD kernel. However ipftest
cannot call the ppsratecheck() in the kernel. Therefore one exists in
fil.c for use when building the userland ipftest utility which
approximates the packet filter in userland for testing of ipfilter
rules against packets captured with tcpdump.

MFC after: 1 week

5 years agoRegister a pre-commit review for ipfilter.
cy [Mon, 24 Dec 2018 01:12:22 +0000 (01:12 +0000)]
Register a pre-commit review for ipfilter.

5 years agoFix mismatch from r342379.
pfg [Sun, 23 Dec 2018 20:51:13 +0000 (20:51 +0000)]
Fix mismatch from r342379.

5 years agonvdimm SPA geom: Update bio fields needed for devstat_end_transaction_bio().
kib [Sun, 23 Dec 2018 19:14:31 +0000 (19:14 +0000)]
nvdimm SPA geom: Update bio fields needed for devstat_end_transaction_bio().

Reported by: bde
MFC after: 1 week
Sponsored by: The FreeBSD Foundation

5 years agoAllocate v_object for the new snapshot vnode.
kib [Sun, 23 Dec 2018 18:54:09 +0000 (18:54 +0000)]
Allocate v_object for the new snapshot vnode.

The vnode is not opened, so it ends up with the malloced buffers otherwise.

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

5 years agoProperly test for vmio buffer in bnoreuselist().
kib [Sun, 23 Dec 2018 18:52:02 +0000 (18:52 +0000)]
Properly test for vmio buffer in bnoreuselist().

The presence of allocated v_object does not imply that the buffer is
necessary VMIO kind.  Buffer might has been allocated before the
object created, then the buffer is malloced.  Although we try to avoid
such situation, it seems to be still legitimate.

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

5 years agogai_strerror() - Update string error messages according to RFC 3493.
pfg [Sun, 23 Dec 2018 18:15:48 +0000 (18:15 +0000)]
gai_strerror() - Update string error messages according to RFC 3493.

Error messages in gai_strerror(3) vary largely among OSs.

For new software we largely replaced the obsoleted EAI_NONAME and
with EAI_NODATA but we never updated the corresponding message to better
match the intended use. We also have references to ai_flags and ai_family
which are not very descriptive for non-developer end users.

Bring new new error messages based on informational RFC 3493, which has
obsoleted RFC 2553, and make them consistent among the header adn
manpage.

MFC after: 1 month
Differentical Revision: D18630

5 years agoRemove NETBSD_PF. NETBSD_PF is a flag that defines whether the pfil(9)
cy [Sun, 23 Dec 2018 05:10:36 +0000 (05:10 +0000)]
Remove NETBSD_PF. NETBSD_PF is a flag that defines whether the pfil(9)
framework is available. pfil(9) has been in FreeBSD since FreeBSD 5
and according to svn log was first committed to HEAD in 2000, therefore
it is safe to say the check is no longer needed in FreeBSD.

pfil(9) first appeared in NetBSD 1.3 (hence the name NETBSD_PF).
Therefore it is safe to say that it is supported by every NetBSD system
today. The framework also exists in illumos.

As ipfilter code is shared and exchanged between FreeBSD and NetBSD, and
at some point in the future illumos too, and as all three platforms have
pfil(9), the redundant NETBSD_PF #defines and #ifdefs are removed.

MFC after: 1 week

5 years agoMerge bmake-20181221
sjg [Sun, 23 Dec 2018 01:05:52 +0000 (01:05 +0000)]
Merge bmake-20181221

5 years agoFix devstat on md devices, second attempt. r341765 depends on
bde [Sat, 22 Dec 2018 22:59:11 +0000 (22:59 +0000)]
Fix devstat on md devices, second attempt.  r341765 depends on
g_io_deliver() finishing initialization of the bio, but g_io_deliver()
actually destroys the bio.  INVARIANTS makes the bug obvious by
overwriting the bio with garbage.

Restore the old order for calling devstat (except don't restore not calling
it for the error case), and translate to the devstat KPI so that this order
works.

Reviewed by: kib

5 years agoRemove the last vestiges of HP/UX from a FreeBSD-only ipfilter
cy [Sat, 22 Dec 2018 21:49:25 +0000 (21:49 +0000)]
Remove the last vestiges of HP/UX from a FreeBSD-only ipfilter
source file.

MFC after: 1 week

5 years agonetmap: fix txsync check in netmap poll
vmaffione [Sat, 22 Dec 2018 16:23:42 +0000 (16:23 +0000)]
netmap: fix txsync check in netmap poll

To check if txsync can be skipped, it is necessary to look for
unseen TX space. However, this means comparing ring->cur
against ring->tail, rather than ring->head against ring->tail
(like nm_ring_empty() does).
This change also adds some more comments to explain the optimization
performed at the beginning of netmap_poll().

MFC after: 3 days
Sponsored by: Sunny Valley Networks

5 years agonetmap: fix bug in netmap_poll() optimization
vmaffione [Sat, 22 Dec 2018 15:15:45 +0000 (15:15 +0000)]
netmap: fix bug in netmap_poll() optimization

The bug was introduced by r339639, although it is present in the upstream
netmap code since 2015. It is due to resetting the want_rx variable to
POLLIN, rather than resetting it to POLLIN|POLLRDNORM.
It only affects select(), which uses POLLRDNORM. poll() is not affected,
because it uses POLLIN.
Also, it only affects FreeBSD, because Linux skips the optimization
implemented by the piece of code where the bug occurs.

MFC after: 3 days
Sponsored by: Sunny Valley Networks

5 years agoifconfig.4, lagg.4: fix documentation bug: -use_flowid needs to be used
eugen [Sat, 22 Dec 2018 11:38:54 +0000 (11:38 +0000)]
ifconfig.4, lagg.4: fix documentation bug: -use_flowid needs to be used
to force local hash computation and disable usage of RSS hash
provided by driver.

PR: 234242
MFC after: 1 week

5 years agoOops, rounddown() for the start was misspelled roundup() in r342295,
bde [Sat, 22 Dec 2018 09:31:55 +0000 (09:31 +0000)]
Oops, rounddown() for the start was misspelled roundup() in r342295,
so only aligned starts worked.  This broke releasing caches in most
cases where the i/o size is smaller than the fs block size.

5 years agoconfig(8): Remove all instances of an option when opting out
kevans [Sat, 22 Dec 2018 06:08:06 +0000 (06:08 +0000)]
config(8): Remove all instances of an option when opting out

Quick follow-up to r342362: options can appear multiple times now, so
clean up all of them as needed. For non-OPTIONS options, this has no effect
since they're already de-duplicated.

MFC after: 1 week
X-MFC-With: r342362

5 years agoconfig(8): Allow duplicate options to be specified
kevans [Sat, 22 Dec 2018 06:02:34 +0000 (06:02 +0000)]
config(8): Allow duplicate options to be specified

config(8)'s option handling has been written to allow duplicate options; if
the value changes, then the latest value is used and an informative message
is printed to stderr like so:

/usr/src/sys/amd64/conf/TEST: option "VERBOSE_SYSINIT" redefined from 0 to 1

Currently, this is only a possibility for cpu types, MAXUSERS, and
MACHINE_ARCH. Anything else duplicated in a config file will use the first
value set and error about duplicated options on subsequent appearances,
which is arguably unfriendly since one could specify:

include GENERIC
nooptions VERBOSE_SYSINIT
options VERBOSE_SYSINIT

to redefine the value later anyways.

Reported by: mmacy
MFC after: 1 week

5 years agoTry the first 256 units with nvmecontrol devlist.
imp [Fri, 21 Dec 2018 23:22:37 +0000 (23:22 +0000)]
Try the first 256 units with nvmecontrol devlist.

The nvmecontrol code that did the devlist assumed that we had a
tightly-packed allocation of units. Since pci writing exists, this
isn't the case. Loop over the first 256 units, which is a reasonable
number of possible units.

Sponsored by: Netflix

5 years agoFix clobbering of the fatchain cache for clustered i/o's when full
bde [Fri, 21 Dec 2018 21:17:45 +0000 (21:17 +0000)]
Fix clobbering of the fatchain cache for clustered i/o's when full
clustering is not done.  The bug caused extreme slowness for large
files in some cases.

There is no way to tell VOP_BMAP() how many blocks are wanted, so for
all file systems it has to waste time in some cases by searching for
more contiguous blocks than will be accessed.  For msdosfs, it also
clobbered the fatchain cache in these cases by advancing the cache to
point to the chain entry for block that won't be read.  This makes
the cache useless for the next sequential i/o (or VOP_BMAP()), so the
fat chain is searched from the beginning.  The cache only has 1 relevant
entry, so it is similarly useless for random i/o.

Fix this by only advancing the cache to point to the chain entry for
the first block that will be read.  Clustering uses results from
VOP_BMAP(), so when more than 1 block is read by clustering, the cache
is not advanced as optimally as before, but it is at most 1 cluster
size behind and searching the chain through the blocks for this cluster
doesn't take too long.

5 years agoRemove unused macros from t4_tom.h.
np [Fri, 21 Dec 2018 20:46:45 +0000 (20:46 +0000)]
Remove unused macros from t4_tom.h.

5 years agomps(4), mpr(4): remove SATA ID command cancellation hack
cem [Fri, 21 Dec 2018 20:30:52 +0000 (20:30 +0000)]
mps(4), mpr(4): remove SATA ID command cancellation hack

Add a generic mechanism to override mp?_wait_command's timeout behavior,
which continues to invoke reinit by default.  Invokers who set
cm_timeout_handler may avoid automatic reinit and do their own handling.

Adapt mp?sas_get_sata_identify to this mechanism and remove its callout
hack.

Reviewed by: scottl
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D18614

5 years agomps(4), mpr(4): Fix lifetime of command buffer for mp?sas_get_sata_identify
cem [Fri, 21 Dec 2018 20:29:16 +0000 (20:29 +0000)]
mps(4), mpr(4): Fix lifetime of command buffer for mp?sas_get_sata_identify

In the event that the ID command timed out, mps(4)/mpr(4) did not free the
command until it could be cancelled.  However, it freed the associated
buffer (cm_data).  Fix the lifetime issue by freeing the associated buffer
only after Abort Task or controller reset.

Reviewed by: scottl
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D18612

5 years agoQuick fix for initialization of mnt_iosize_max. (This limit controls
bde [Fri, 21 Dec 2018 20:12:43 +0000 (20:12 +0000)]
Quick fix for initialization of mnt_iosize_max.  (This limit controls
mainly clustering and read-ahead.)  Copy the initialization from ffs,
and also copy a couple of lines of ffs's nearby style for initialization
order and whitespace.

A correct fix would de-duplicate the initialization and fix bitrot in it
instead of adding another instance of the duplication.  Complications to
use the size preferred by the device have been reduced to hard-coding
slightly pessimal and/or inconsistent defaults, using large code that was
almost needed to support the complications.

For msdosfs, the result was that mnt_iosize_max was DFTLPHYS (64K) but is
now MAXPHYS (128K).

5 years agoFix passing wrong variables to nvlist_destroy() after r333446.
mav [Fri, 21 Dec 2018 17:22:15 +0000 (17:22 +0000)]
Fix passing wrong variables to nvlist_destroy() after r333446.

Reported by: Alexander Fedorov (IT-Grad.ru)
MFC after: 5 days

5 years agonetmap: update nmreplay(8)
vmaffione [Fri, 21 Dec 2018 14:45:10 +0000 (14:45 +0000)]
netmap: update nmreplay(8)

Small modifications to the nmreplay man page.
Used igor and mandoc tools to fix warnings and errors.

Reviewed by: bcr
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D18629