]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
6 years agoMFC: 319690
dexuan [Wed, 14 Jun 2017 13:44:32 +0000 (13:44 +0000)]
MFC: 319690

Approved by: re (marius)

r319690
hyperv/pcib: use the device serial number as PCI domain

Currently the PCI domain is initialized with the instance GUID in
vmbus_pcib_attach(). It turns out the GUID can change across VM reboot,
while some users want a persistent value for PCI domain. The solution is
that we can change to use the device serial number, which starts with 1
and is unique within a VM.

Obtained from: Haiyang Zhang
Sponsored by: Microsoft

6 years agoMFC r319825:
kib [Wed, 14 Jun 2017 05:12:09 +0000 (05:12 +0000)]
MFC r319825:
More accurately handle early EFER restoration on resume.

Approved by: re (delphij)

6 years agoMFC r307517, r314342, r316357, r317545, r317777:
rgrimes [Tue, 13 Jun 2017 22:34:42 +0000 (22:34 +0000)]
MFC r307517, r314342, r316357, r317545, r317777:

r307517:
Typo fixed: arbitraty -> arbitrary.
PR: 213559

r314342:
bhyve: document virtio-console in the manpage

r316357:
Minor style improvements in bhyve.8
Replace "as of now" with "at present". As the change is a really minor one,
don't bump .Dd.

r317545:
Document raw framebuffer device and XHCI device configurations.

r317777:
Improve documentation of fbuf device.

Approved by: grehan (mentor)
Approved by: re (gjb)

6 years agoMFC r317428 (cognet): fix arm64 MSI
emaste [Tue, 13 Jun 2017 18:59:34 +0000 (18:59 +0000)]
MFC r317428 (cognet): fix arm64 MSI

In arm_gicv2m_alloc_msi(), if we found a suitable irq range, leave the loop
before we increase irq again, or we'd end up choosing an irq, and then
really using the next one, even if it's not available.
Also in the inner loop, correct the end check so that we check every irq,
even the last one.
This makes the msk(4) adapter able to use MSI on Softiron Overdrive 1000.

PR: 219956
Approved by: re (gjb)

6 years agoMFC r319610:
allanjude [Tue, 13 Jun 2017 15:23:49 +0000 (15:23 +0000)]
MFC r319610:
  usr.sbin/sesutil: correct 'locate all off' to deactivate empty slot LEDs

PR: 217409
Approved by: re (marius)

6 years agoDocument r319884, make(1) version 20170510.
gjb [Tue, 13 Jun 2017 01:13:09 +0000 (01:13 +0000)]
Document r319884, make(1) version 20170510.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

6 years agoUpdate bmake to 20170510
sjg [Tue, 13 Jun 2017 00:22:15 +0000 (00:22 +0000)]
Update bmake to 20170510

Approved by: re@

6 years agoMFC r313398:
ngie [Mon, 12 Jun 2017 17:37:18 +0000 (17:37 +0000)]
MFC r313398:

Approved by: re (gjb)

Apply r274475's to expr.oxout.tab.c to fix the test on FreeBSD

YYINT on FreeBSD is int, not short

I'll work with the upstream maintainer or come up with a build
method of modifying their definitions on install instead of
having to modify tests to match our forked YYINT definition.

PR: 216891

6 years agoMFC r319571:
dchagin [Sun, 11 Jun 2017 09:33:09 +0000 (09:33 +0000)]
MFC r319571:

On success, getrandom() Linux system call returns the number of bytes that
were copied to the buffer supplied by the user.

PR: 219464
Submitted by: Maciej Pasternacki
Reported by: Maciej Pasternacki
Approved by: re (kib)

6 years agoMFC r318765:
allanjude [Sun, 11 Jun 2017 02:04:39 +0000 (02:04 +0000)]
MFC r318765:
Allow cpuset_{get,set}affinity in capabilities mode

Approved by: re (marius)

6 years agoMFC r319518:
kib [Sat, 10 Jun 2017 11:14:54 +0000 (11:14 +0000)]
MFC r319518:
Ensure that cached struct thread does not keep spurious td_su
reference on an UFS mount point.

MFC r319519:
Clean possible td_su reference on the struct mount being unmounted as
the last step of ffs_unmount().

Approved by: re (gjb)

6 years agoRename stable/11 from PRERELEASE to BETA1 as part of the 11.1-RELEASE
gjb [Thu, 8 Jun 2017 23:56:23 +0000 (23:56 +0000)]
Rename stable/11 from PRERELEASE to BETA1 as part of the 11.1-RELEASE
cycle.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

6 years agoMFC r317806:
glebius [Thu, 8 Jun 2017 22:13:29 +0000 (22:13 +0000)]
MFC r317806:
  The nandsim(4) simulator driver doesn't have any protection against
  races at least in its ioctl handler, and at the same time it creates
  device entry with 0666 permissions.

  To plug possible issues in it:
  - Mark it as needing Giant.
  - Switch device mode to 0600.

Submitted by: C Turt
Reviewed by: imp
Security: Possible double free in ioctl handler
Approved by: re (marius)

6 years agoMFC r318677:
glebius [Thu, 8 Jun 2017 22:12:10 +0000 (22:12 +0000)]
MFC r318677:
  Fix regression in ndis(4) after r286410. This adds a bunch of checks for
  whether this is a Ethernet or 802.11 device and does proper dereferencing.

  PR: 213237
  Submitted by: <ota j.email.ne.jp>
  Approved by: re (marius)

6 years agoMFC r319621:
gjb [Thu, 8 Jun 2017 17:54:27 +0000 (17:54 +0000)]
MFC r319621:

 Ensure ${_CW} is uppercase when passing '-c' to mk-vmimage.sh,
 otherwise with 'CLOUDWARE=vagrant-virtualbox', the path to the
 configuration file may be incorrect.

Approved by: re (marius)
Sponsored by: The FreeBSD Foundation

6 years agoMFC r319473:
dim [Thu, 8 Jun 2017 17:10:58 +0000 (17:10 +0000)]
MFC r319473:

For arm targets, place ABI at the end of the target triple

For some reason, we have been inserting the ABI specification into the
middle of the target triple, when building LLVM, like so:

    armv6-gnueabi-freebsd12.0

This is the wrong way around.  LLVM even auto-canonicalizes it to:

    armv6--freebsd12.0-gnueabi

Let's do this the right way in llvm.build.mk instead.  While here,
define a proper VENDOR macro which can be overridden easily.

Approved by: re (gjb)
Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D10846

6 years agoCurrently stable/11 is using custom DTS for beaglebone(-black) while CURRENT
manu [Thu, 8 Jun 2017 15:50:50 +0000 (15:50 +0000)]
Currently stable/11 is using custom DTS for beaglebone(-black) while CURRENT
is using the upstream ones from Linux.
U-Boot ports have been changed to use the upstream names so 11.1-PRERELEASE
doesn't boot.
Since we cannot MFC the DTS easily (a lot of drivers would have to be modified)
add links on the dts with upstream names.

This is a direct commit to stable/11

Approved by: re (marius)

6 years agoMFC r319603, r319608, r319609:
gjb [Thu, 8 Jun 2017 15:47:52 +0000 (15:47 +0000)]
MFC r319603, r319608, r319609:

 Create a hard link for sun7i-a20-cubieboard2.dtb to allow the
 cubieboard2 to find the correct dtb file.

Note: r319608 and r319609 are included, but are no-op changes to
the original change, and only included to prevent these commits
from showing up on the MFC tracking page.

Approved by: re (marius)
Sponsored by: The FreeBSD Foundation

6 years agoMFC r318970: Call VLAN_CAPABILITIES() when LAGG capabilities change.
mav [Thu, 8 Jun 2017 14:34:39 +0000 (14:34 +0000)]
MFC r318970: Call VLAN_CAPABILITIES() when LAGG capabilities change.

This makes VLAN on top of LAGG to expose proper capabilities if they are
changed after creation.

Approved by: re (marius)

6 years agoMFC r318966: Improve applying unified capabilities to the lagg ports.
mav [Thu, 8 Jun 2017 14:33:47 +0000 (14:33 +0000)]
MFC r318966: Improve applying unified capabilities to the lagg ports.

Some NICs have some capabilities dependent, so that disabling one
require disabling some other (TXCSUM/RXCSUM on em).  This code tries to
reach the consensus more insistently.

Approved by: re (marius)

6 years agoMFC r318907: Remove some code, dead from the day one.
mav [Thu, 8 Jun 2017 14:32:42 +0000 (14:32 +0000)]
MFC r318907: Remove some code, dead from the day one.

Approved by: re (marius)

6 years agoMFC r319556:
tuexen [Wed, 7 Jun 2017 12:50:54 +0000 (12:50 +0000)]
MFC r319556:
Fix the ICMP6 handling for TCP.

The ICMP6 packets might not be contained in a single mbuf. So don't
assume this. Keep the IPv4 and IPv6 code in sync and make explicit
that the syncache code only need the TCP sequence number, not the
complete TCP header.

Approved by: re (marius)

6 years agoMFC r318780:
kib [Wed, 7 Jun 2017 11:39:52 +0000 (11:39 +0000)]
MFC r318780:
Use __BSD_VISIBLE test instead checking for absense of _POSIX_SOURCE.

Approved by: re (marius)

6 years agoMFC r318781:
kib [Wed, 7 Jun 2017 11:30:28 +0000 (11:30 +0000)]
MFC r318781:
Add BIT_OR2(), BIT_AND2(), BIT_NAND2(), BIT_XOR() and BIT_XOR2().

Approved by: re (marius)

6 years agoMFC r318998:
cy [Tue, 6 Jun 2017 19:20:28 +0000 (19:20 +0000)]
MFC r318998:

Fix return value of ip_sync_nat. Previously, regardless of error it
always returned a return code of 0.

Obtained from: NetBSD ip_sync.c r1.5
Approved by: re (delphij)

6 years agoMFC r319076:
trasz [Tue, 6 Jun 2017 17:27:41 +0000 (17:27 +0000)]
MFC r319076:

Declutter rctl(8) by moving kernel build instructions into newly
created rctl(4).

Approved by: re (gjb)

6 years agoMFC r319075:
trasz [Tue, 6 Jun 2017 17:10:34 +0000 (17:10 +0000)]
MFC r319075:

Random tweaks to rctl(8).

This is just wording and formatting fixes.

MFC r319432:

Use proper capitalization with .Dd.

Approved by: re (gjb)

6 years agoMFC r319074:
trasz [Tue, 6 Jun 2017 17:00:21 +0000 (17:00 +0000)]
MFC r319074:

Minor tweaks to iscsi(4) and iscsid(8).

This is mostly wording and clarification of the userspace/kernel split.

Approved by: re (gjb)

6 years agoMFC r318943 (avg):
gjb [Tue, 6 Jun 2017 14:46:23 +0000 (14:46 +0000)]
MFC r318943 (avg):

 MFV r318942: 8166 zpool scrub thinks it repaired offline device

 https://www.illumos.org/issues/8166
  If we do a scrub while a leaf device is offline (via "zpool offline"),
  we will inadvertently clear the DTL (dirty time log) of the offline
  device, even though it is still damaged. When the device comes back
  online, we will incompletely resilver it, thinking that the scrub
  repaired blocks written before the scrub was started. The incomplete
  resilver can lead to data loss if there is a subsequent failure of a
  different leaf device.
  The fix is to never clear the DTL of offline devices. Note that if a
  device is onlined while a scrub is in progress, the scrub will be
  restarted.
  The problem can be worked around by running "zpool scrub" after
  "zpool online".
  See also https://github.com/zfsonlinux/zfs/issues/5806

PR: 219537
Approved by: re (kib)
Sponsored by: The FreeBSD Foundation

6 years agoMFC r319073:
trasz [Tue, 6 Jun 2017 14:40:53 +0000 (14:40 +0000)]
MFC r319073:

Random tweaks to cfiscsi(4) man page.

This improves wording and adds a few Xrs.

Approved by: re (gjb)

6 years agoRevert r319607, which documents items that existed in 11.0-RELEASE.
gjb [Tue, 6 Jun 2017 14:26:37 +0000 (14:26 +0000)]
Revert r319607, which documents items that existed in 11.0-RELEASE.

Submitted by: jhb
Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

6 years agoMFC r319072:
trasz [Tue, 6 Jun 2017 09:43:28 +0000 (09:43 +0000)]
MFC r319072:

Make ctld(8) mention cfiscsi(4).

Approved by: re (marius)

6 years agoMFC r318816:
trasz [Tue, 6 Jun 2017 09:23:12 +0000 (09:23 +0000)]
MFC r318816:

Don't end up manpage titles with a full stop.

Approved by: re (marius)

6 years agoMFC r318861:
trasz [Tue, 6 Jun 2017 08:55:11 +0000 (08:55 +0000)]
MFC r318861:

Create /net by default, for autofs.

Approved by: re (kib)

6 years agoMFC r318398:
trasz [Tue, 6 Jun 2017 08:33:19 +0000 (08:33 +0000)]
MFC r318398:

Bump default MAXTSIZ (kern.maxtsiz) from 128MB to 32GB. The old limit
prevents one from running eg clang built with debug; the new one is
arbitrary (equal to MAXDSIZ) and... well, should be quite future-proof.

Same fix might be applicable to other 64 bit architectures; I'll ask
their respective maintainers to make sure it won't break anything.

Approved by: re (kib)

6 years agoMFC r319369:
delphij [Tue, 6 Jun 2017 07:21:33 +0000 (07:21 +0000)]
MFC r319369:

 * limit size of buffers to RPC_MAXDATASIZE
 * don't leak memory
 * be more picky about bad parameters

From:

https://raw.githubusercontent.com/guidovranken/rpcbomb/master/libtirpc_patch.txt
https://github.com/guidovranken/rpcbomb/blob/master/rpcbind_patch.txt

via NetBSD.

Approved by: re (kib)

6 years agoDocument r295930, truss(1) '-H' flag.
gjb [Mon, 5 Jun 2017 18:56:45 +0000 (18:56 +0000)]
Document r295930, truss(1) '-H' flag.
Document r308154, cxgbe(4) additional virtual interface support.

Submitted by: jhb
Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

6 years agoMFC r319118:
ae [Mon, 5 Jun 2017 11:11:07 +0000 (11:11 +0000)]
MFC r319118:
  Disable IPsec debugging code by default when IPSEC_DEBUG kernel option
  is not specified.

  Due to the long call chain IPsec code can produce the kernel stack
  exhaustion on the i386 architecture. The debugging code usually is not
  used, but it requires a lot of stack space to keep buffers for strings
  formatting. This patch conditionally defines macros to disable building
  of IPsec debugging code.

  IPsec currently has two sysctl variables to configure debug output:
   * net.key.debug variable is used to enable debug output for PF_KEY
     protocol. Such debug messages are produced by KEYDBG() macro and
     usually they can be interesting for developers.
   * net.inet.ipsec.debug variable is used to enable debug output for
     DPRINTF() macro and ipseclog() function. DPRINTF() macro usually
     is used for development debugging. ipseclog() function is used for
     debugging by administrator.

  The patch disables KEYDBG() and DPRINTF() macros, and formatting buffers
  declarations when IPSEC_DEBUG is not present in kernel config. This
  reduces stack requirement for up to several hundreds of bytes.
  The net.inet.ipsec.debug variable still can be used to enable ipseclog()
  messages by administrator.

  PR: 219476

MFC r319412:
  Build kdebug_secreplay() function only when IPSEC_DEBUG is defined.
  This should fix the build on sparc.

Approved by: re (kib)

6 years agoMFC r319052:
dchagin [Sun, 4 Jun 2017 19:58:14 +0000 (19:58 +0000)]
MFC r319052:

Strip _binary_linux_locore_o_size from ${VDSO}.so as it is a low absolute
symbol, and this breaks symbol lookup in ddb.

Approved by: re (kib)

6 years agoMFC r317601:
dchagin [Sun, 4 Jun 2017 19:56:21 +0000 (19:56 +0000)]
MFC r317601:

Fix symlinkat() which use the newdfd argument to look up the old path,
while it should use it for the new path instead.

Approved by: re (kib)

6 years agoMFC r318194,r319481:
bdrewery [Sun, 4 Jun 2017 19:09:50 +0000 (19:09 +0000)]
MFC r318194,r319481:

  r318194:
    Tell bmake (meta mode) to ignore changes to /usr/local/etc/libmap.d/*
  r319481:
    META_MODE: Move ignoring of /usr/local/etc/libmap.d to proper place.

Approved by: re (gjb)

6 years agoMFC r319413:
hselasky [Sun, 4 Jun 2017 08:45:13 +0000 (08:45 +0000)]
MFC r319413:
Free hardware queue resource after port is stopped in the mlx4en(4)
driver. Else if the port is up the resource might still be busy and
the MTT free will fail.

PR: 216493
Approved by: re (kib)
Sponsored by: Mellanox Technologies

6 years agoMFC r319414:
hselasky [Sun, 4 Jun 2017 08:25:28 +0000 (08:25 +0000)]
MFC r319414:
Allow communication between functions on the same host when using the
mlx4en(4) driver in SRIOV mode.

Place a copy of the destination MAC address in the send WQE only under
SRIOV/eSwitch configuration or when the device is in selftest. This
allows communication between functions on the same host.

PR: 216493
Approved by: re (kib)
Sponsored by: Mellanox Technologies

6 years agoMFC r319294:
ngie [Sun, 4 Jun 2017 02:21:38 +0000 (02:21 +0000)]
MFC r319294:

Approved by: re (gjb)

Fix "make rebase" after ^/head@r315776

"make rebase" can be used for rebasing the output files from mkimg
after making a change to mkimg. This will come in handy soon, per
bug 219673.

6 years agoMFC r316503,r316504,r316505:
ngie [Sat, 3 Jun 2017 20:39:48 +0000 (20:39 +0000)]
MFC r316503,r316504,r316505:

Approved by: re (gjb)

r316503:

Clean up trailing whitespace

r316504:

Clean up more trailing whitespace in the licensing tort that
happened to be spaces, not tabs

r316505:

Don't assume NAME_MAX is 255

Query the filesystem limit via getconf(3) instead

6 years agoMFC r318974: uart: add AMT SOL PCI ID
emaste [Sat, 3 Jun 2017 03:15:57 +0000 (03:15 +0000)]
MFC r318974: uart: add AMT SOL PCI ID

I adjusted the description to be similar to existing AMT entries.

PR: 219384
Approved by: re (gjb)

7 years agoMFC r312919 (by rwatson)
asomers [Fri, 2 Jun 2017 15:11:43 +0000 (15:11 +0000)]
MFC r312919 (by rwatson)

Fix build of aio_test on MIPS, where the compiler warns about the local
variable 'err' shadowing the global function err(3).  Which it does.

Sponsored by: DARPA, AFRL
Approved by:  re

7 years agoDocument r319388, cxgbetool(8) addition.
gjb [Fri, 2 Jun 2017 14:08:08 +0000 (14:08 +0000)]
Document r319388, cxgbetool(8) addition.

Submitted by: jhb
Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

7 years agoMFC r318734:
ae [Fri, 2 Jun 2017 09:54:41 +0000 (09:54 +0000)]
MFC r318734:
  Fix possible double releasing for SA reference.

  There are two possible ways how crypto callback are called: directly from
  caller and deffered from crypto thread.

  For inbound packets the direct call chain is the following:
   IPSEC_INPUT() method -> ipsec_common_input() -> xform_input() ->
   -> crypto_dispatch() -> crypto_invoke() -> crypto_done() ->
   -> xform_input_cb() -> ipsec[46]_common_input_cb() -> netisr_queue().

  The SA reference is held while crypto processing is not finished.
  The error handling code wrongly expected that crypto callback always called
  from the crypto thread context, and it did SA reference releasing in
  xform_input_cb(). But when the crypto callback called directly, in case of
  error (e.g. data authentification failed) the error handling in
  ipsec_common_input() also did SA reference releasing.

  To fix this, remove error handling from ipsec_common_input() and do it
  in xform_input() before crypto_dispatch().

  PR: 219356

MFC r318738:
  Fix possible double releasing for SA and SP references.

  There are two possible ways how crypto callback are called: directly from
  caller and deffered from crypto thread.

  For outbound packets the direct call chain is the following:
   IPSEC_OUTPUT() method -> ipsec[46]_common_output() ->
   -> ipsec[46]_perform_request() -> xform_output() ->
   -> crypto_dispatch() -> crypto_invoke() -> crypto_done() ->
   -> xform_output_cb() -> ipsec_process_done() -> ip[6]_output().

  The SA and SP references are held while crypto processing is not finished.
  The error handling code wrongly expected that crypto callback always called
  from the crypto thread context, and it did references releasing in
  xform_output_cb(). But when the crypto callback called directly, in case of
  error the error handling code in ipsec[46]_perform_request() also did
  references releasing.

  To fix this, remove error handling from ipsec[46]_perform_request() and do it
  in xform_output() before crypto_dispatch().

Approved by: re (kib)

7 years agoMFC r318210,r318211:
ngie [Fri, 2 Jun 2017 01:00:40 +0000 (01:00 +0000)]
MFC r318210,r318211:

Approved by: re (gjb)

r318210:

ssp_test:read:: query the value of MAXPATHLEN via getconf(1)

In the event the value of PATH_MAX was changed, the assumption that
MAXPATHLEN is 1024 (and hence the buffer length required to trigger
SSP to fail for read(2)) would be invalidated. Query getconf(1) for
the actual value of MAXPATHLEN via _XOPEN_PATH_MAX instead, and
increment the value by 1 to ensure that the SSP support tests the
stack smashing support properly.

r318211:

Fix up previous commit

- Apply the logic to the FreeBSD block
- Fix a typo with the getconf(1) call that I would have caught, were
  it not for the fact that I got the blocks wrong.
- Consolidate the hardcoded buffer sizes to the NetBSD block.

This would have been discovered had I run the test on a system where
PATH_MAX != 1024 (I don't have that at my disposal right at this moment).

MFC with: r318210

7 years agoMFC r319167:
mjg [Thu, 1 Jun 2017 18:39:54 +0000 (18:39 +0000)]
MFC r319167:

mtx: fix whitespace damage in _mtx_trylock_flags_

7 years agoMFC r318676
davidcs [Thu, 1 Jun 2017 18:35:04 +0000 (18:35 +0000)]
MFC r318676
Check for IPV6 TCP/UDP CSUM offload in pkt header during transmits.

Submitted by:Shminderjit.Singh@cavium.com

7 years agoNote groff(1) is planned for deprecation as of 12.0.
gjb [Thu, 1 Jun 2017 17:07:13 +0000 (17:07 +0000)]
Note groff(1) is planned for deprecation as of 12.0.

Submitted by: rgrimes
Sponsored by: The FreeBSD Foundation

7 years agoMFC r318895: Fix several problems with mapping code in mps(4).
slm [Thu, 1 Jun 2017 16:55:03 +0000 (16:55 +0000)]
MFC r318895: Fix several problems with mapping code in mps(4).
MFC r318896: Fix several problems with mapping code in mpr(4).

-Add several comments describing what the mapping code is doing.
-Added a callout timer to improve check for missing devices when discovery has
 completed so that missing counts are incremented correctly.
-Fix problems with missing counts not being saved to the HBA.
-Update man pages mps(4) and mpr(4) to include a description of the use
 use_phy_num sysctl variable.
-Remove channel field in the mapping structure because it's not used.
-Improve logging by using mps_dprint or mpr_dprint instead of printf and adding
 more logging where appropriate.
-Add check for a bad index before writing mapping entries to controller.
-The high missing count check in the mapping table was using the incorrect
 initial value, which could lead to a bad result.
-The usage of the IN_USE flag for volume mapping was changed to be more
 intuitive, and was not being used correctly.
-The check for a free DPM entry was changed, as this was completely wrong.
-Updates to the missing count for volumes were not being done correctly, so this
 function was completely rewritten.
-_mapping_add_to_removal_table() was overly complicated and incorrectly used, so
 this function was rewritten.
-Missing counts for all devices were not being incremented properly, so this
 functionality was added.
-The search for space in the mapping table for missing enclosures was not
 calculating the found space correctly due to not breaking out of a loop when
 required, and the num_found variable was not being reset when needed.
-Retries when a device fails to get added due to a full mapping table were
 removed because this is unneccessary.
-mps_mapping_is_reinit_required() and mpr_mapping_is_reinit_required() were
 removed because they were not being used.
-Some functions were renamed to avoid confusion between Target IDs and SAS IDs.
-_mapping_check_update_ir_mt_idx() was removed because it was overly
 complicating volume mapping.
-The setting of the maxtargets variable was changed to include max volumes.
-The setting of the initiator_id variable was changed to be the invalid target
 ID after all targets, including volumes. Previously, this was set to the last
 valid target ID.
-Don't exclude target IDs of RAID components or check for a reuse of a target ID
 for RAID components.
-Some endienness was added.

Approved by: ken, mav

7 years agoMFC r318582
vangyzen [Thu, 1 Jun 2017 16:03:01 +0000 (16:03 +0000)]
MFC r318582

Remove old spinlock_debug code from libc

This no longer seems useful.  Remove it.

This was prompted by a "cast discards volatile qualifier" warning
in libthr when WARNS=6.

Sponsored by: Dell EMC

7 years agoDocument r319435, mpr(4) tri-mode support.
gjb [Thu, 1 Jun 2017 15:57:58 +0000 (15:57 +0000)]
Document r319435, mpr(4) tri-mode support.

Sponsored by: The FreeBSD Foundation

7 years agoReorder the NAT_T and IPSEC_NAT_T sentences.
gjb [Thu, 1 Jun 2017 15:57:57 +0000 (15:57 +0000)]
Reorder the NAT_T and IPSEC_NAT_T sentences.

Submitted by: bjk
Sponsored by: The FreeBSD Foundation

7 years agoFix grammar: s/warning/warnings/
gjb [Thu, 1 Jun 2017 15:57:57 +0000 (15:57 +0000)]
Fix grammar: s/warning/warnings/

Submitted by: bjk
Sponsored by: The FreeBSD Foundation

7 years agoFix a grammar nit.
gjb [Thu, 1 Jun 2017 15:57:56 +0000 (15:57 +0000)]
Fix a grammar nit.

Submitted by: bjk
Sponsored by: The FreeBSD Foundation

7 years agoMFC r308217, r308301, r311958, r312437, r318188, r318427, r318679
slm [Thu, 1 Jun 2017 15:39:09 +0000 (15:39 +0000)]
MFC r308217, r308301, r311958, r312437, r318188, r318427, r318679

r308217:
Add a fallback to the device mapper logic.  We've seen systems in the field
that are apparently misconfigured by the manufacturer and cause the mapping
logic to fail.  The fallback allows drive numbers to be assigned based on the
PHY number that they're attached to.  Add sysctls and tunables to overrid
this new behavior, but they should be considered only necessary for debugging.

Reviewed by:  imp, smh
Obtained from: Netflix
MFC after: 3 days
Sponsored by: D8403

r308301:
Record the LogInfo field when reporting the IOCStatus.  Helps in
debugging errors.

Submitted by: slm
Obtained from: Netflix
MFC after: 3 days

r311958:
Print out the number of queues/MSIx vectors.

Sponsored by: Netflix

r312437:
Rework the debug print API. Event printing no longer gets special handling.
All of the printing from the tables file now has wrappers so that the
handling is cleaner and it's possible to print something out (say, during
development) without having to fight the global debug flags. This re-org
will also make it easier to have the tables be compiled out at build time
if desired.

Other than fixing some minor bugs, there are no user-visible changes from
this change

Sponsored by: Netflix, Inc.
Differential Revision: D9238

r318188:
Improve error messages during command timeout for the mpr and mps
drivers.

Sponsored by: Netflix

r318427:
Add tri-mode support (SAS/SATA/PCIe).

This includes NVMe device support and adds support for the following adapters:
    SAS 3408
    SAS 3416
    SAS 3508
    SAS 3516
    SAS 3616
    SAS 3708
    SAS 3716

Reviewed by:    ken, scottl, asomers, mav
Approved by: ken, scottl, mav
MFC after:      2 weeks
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D10095

r318679:
Fix powerpc compiler error.

Approved by: ken

7 years agoMFC r318954
vangyzen [Thu, 1 Jun 2017 15:12:51 +0000 (15:12 +0000)]
MFC r318954

rtld: fix warnings about redundant declarations

Fix warnings about redundant declarations in rtld
when libthr in increased to WARNS=6.

Sponsored by: Dell EMC

7 years agoWhen a SYN-ACK is received in SYN-SENT state, RFC 793 requires the
tuexen [Thu, 1 Jun 2017 14:58:26 +0000 (14:58 +0000)]
When a SYN-ACK is received in SYN-SENT state, RFC 793 requires the
validation of SEG.ACK as the first step. If the ACK is not acceptable,
a RST segment should be sent and the segment should be dropped.
Up to now, the segment was partially processed.
This patch moves the check for the SEG.ACK validation up to the front
as required.

Reviewed by: hiren, gnn
Differential Revision: https://reviews.freebsd.org/D10424

7 years agoMFC r318539 r318580 r318581 r318584 r318749 r318952 r318953 r318955
vangyzen [Thu, 1 Jun 2017 14:49:53 +0000 (14:49 +0000)]
MFC r318539 r318580 r318581 r318584 r318749 r318952 r318953 r318955

libthr: fix warnings at WARNS=6

Fix warnings about the following when WARNS=6 (which I will commit soon):

- casting away const
- no previous 'extern' declaration for non-static variable
- others as explained by #pragmas and comments
- unused parameters

libthr: disable thread-safety warnings

These warnings don't make sense for code that implements
the locking primitives.

libthr: change CHECK_AND_INIT_RWLOCK to an inline function

This was prompted by a compiler warning about 'ret' shadowing
a local variable in the callers of the macro.

libthr: Use CLI flags instead of pragmas to disable warnings

People tweaking the build system or compilers tend to look into
the Makefile and not into the source.  Having some warning controls
in the Makefile and some in the source code is surprising.

Pragmas have the advantage that they leave the warnings enabled
for more code, but that advantage isn't very relevant in these cases.

libthr: fix warnings from GCC when WARNS=6

Fix warnings about:
- redundant declarations
- a local variable shadowing a global function (dlinfo)
- an old-style function definition (with an empty parameter list)
- a variable that is possibly used uninitialized

libthr: prevent setcontext() from masking SIGTHR

__thr_setcontext() mistakenly tested for the presence of SIGCANCEL
in its local ucontext_t instead of the parameter. Therefore,
if a thread calls setcontext() with a context whose signal mask
contains SIGTHR (a.k.a. SIGCANCEL), that signal will be blocked,
preventing the thread from being cancelled or suspended.

Sponsored by: Dell EMC

7 years agoFix grammar.
gjb [Thu, 1 Jun 2017 14:47:59 +0000 (14:47 +0000)]
Fix grammar.

Submitted by: vangyzen
Sponsored by: The FreeBSD Foundation

7 years agoFix a typo.
gjb [Thu, 1 Jun 2017 14:47:06 +0000 (14:47 +0000)]
Fix a typo.

Submitted by: vangyzen
Sponsored by: The FreeBSD Foundation

7 years agoDocument r310372, libmd fd(4) function additions.
gjb [Thu, 1 Jun 2017 14:39:13 +0000 (14:39 +0000)]
Document r310372, libmd fd(4) function additions.

Submitted by: emaste
Sponsored by: The FreeBSD Foundation

7 years agoDocument r305845, UEFI boot loader build reproducibility.
gjb [Thu, 1 Jun 2017 14:39:12 +0000 (14:39 +0000)]
Document r305845, UEFI boot loader build reproducibility.
Document r307631, groff(1) reproducibility fixes.
Document r309183, makewhatis(1) reproducibility fixes.
Document r312249, newvers.sh reproducibility fixes.
Document r312730, WITH_REPRODUCIBLE_BUILD src.conf(5) knob.

Submitted by: emaste

Sponsored by: The FreeBSD Foundation

7 years agoDocument r305837, readelf(1) ARM program and section header reporting.
gjb [Thu, 1 Jun 2017 14:39:11 +0000 (14:39 +0000)]
Document r305837, readelf(1) ARM program and section header reporting.
Document r305844, ELF Tool Chain updated to r3490.
Document r309125, strings(1) exit status fix.

Submitted by: emaste
Sponsored by: The FreeBSD Foundation

7 years agoDocument r305514, getdtablesize(2) in capability mode.
gjb [Thu, 1 Jun 2017 14:39:10 +0000 (14:39 +0000)]
Document r305514, getdtablesize(2) in capability mode.
Document r305516, kern.proc.nfds in capability mode.
Document r306213, bspatch(1) capsicum support.

Submitted by: emaste
Sponsored by: The FreeBSD Foundation

7 years agoMFC r318832: MFV r316923: 8026 retire zfs_throttle_delay and zfs_throttle_resolution
avg [Thu, 1 Jun 2017 14:07:17 +0000 (14:07 +0000)]
MFC r318832: MFV r316923: 8026 retire zfs_throttle_delay and zfs_throttle_resolution

7 years agoMFC r318830: MFV r316921: 8027 tighten up dsl_pool_dirty_delta
avg [Thu, 1 Jun 2017 14:05:28 +0000 (14:05 +0000)]
MFC r318830: MFV r316921: 8027 tighten up dsl_pool_dirty_delta

7 years agoMFC r318450:
kib [Thu, 1 Jun 2017 13:20:47 +0000 (13:20 +0000)]
MFC r318450:
Add tests for some cases in r318298.

PR: 219154

7 years agoMFC r317730:
tuexen [Thu, 1 Jun 2017 12:33:33 +0000 (12:33 +0000)]
MFC r317730:
Add support for listen() call.

MFC r317731:
Add Socklent for handling args of type socklen_t.

MFC r317732:
Decode the third argument of socket().

MFC r317736:
Add support for [gs]etsockopt().

MFC r317737:
Decode the fourth argument of sendto and recvfrom call.

MFC r317739:
Add support for sendmsg() and recvmsg().

MFC r317747:
Add support for socket option names related to the IPPROTO_SCTP level.

MFC r317748:
Add support for socket option names related to the IPPROTO_IPV6 level.

MFC r317750:
Add support for sctp_generic_sendmsg() and sctp_generic_recvmsg().

MFC r317789:
Add support for socket option names related to the level IPPROTO_UDPLITE.

MFC r318879:
Improve the decoding of the third argument of the socket() call.

Decoding of the third argument depends on the first one. For doing this,
add a corresponding function to libsysdecode.

Thanks to jhb@ for suggesting this.

7 years agoMFC r319096: zfs_lookup: fix bogus arguments to lookup of "snapshot" directory
avg [Thu, 1 Jun 2017 11:47:56 +0000 (11:47 +0000)]
MFC r319096: zfs_lookup: fix bogus arguments to lookup of "snapshot" directory

7 years agoMFC r318649:
tuexen [Thu, 1 Jun 2017 10:03:41 +0000 (10:03 +0000)]
MFC r318649:

The connect() system call should return -1 and set errno to EAFNOSUPPORT
if it is called on a TCP socket
 * with an IPv6 address and the socket is bound to an
   IPv4-mapped IPv6 address.
 * with an IPv4-mapped IPv6 address and the socket is bound to an
   IPv6 address.
Thanks to Jonathan T. Leighton for reporting this issue.

Reviewed by: bz, gnn
Differential Revision: https://reviews.freebsd.org/D9163

7 years agoMFC r317597:
tuexen [Thu, 1 Jun 2017 09:21:25 +0000 (09:21 +0000)]
MFC r317597:

Allow SCTP to use the hostcache.

This patch allows the MTU stored in the hostcache to be used as an
initial value for SCTP paths. When an ICMP PTB message is received,
store the MTU in the hostcache.

7 years agoMFC r317592:
tuexen [Thu, 1 Jun 2017 09:18:03 +0000 (09:18 +0000)]
MFC r317592:

Don't set the DF-bit on timer based retransmissions.

7 years agoMFC r317558:
tuexen [Thu, 1 Jun 2017 09:14:43 +0000 (09:14 +0000)]
MFC r317558:

Set the DF bit for responses to out-of-the-blue packets.

7 years agoMFC r317512:
tuexen [Thu, 1 Jun 2017 09:00:38 +0000 (09:00 +0000)]
MFC r317512:

armv8 has support for optional CRC32C instructions. This patch checks if they are
available and if that is true make use of them.
Thank you very much to Andrew Turner for providing help and review the patch!

Reviewed by: andrew
Differential Revision: https://reviews.freebsd.org/D10499

7 years agoMFC 317464:
tuexen [Thu, 1 Jun 2017 08:58:39 +0000 (08:58 +0000)]
MFC 317464:

Fix an issue with MTU calculation if an ICMP message is received
for an SCTP/UDP packet.

7 years agoMFC r317457:
tuexen [Thu, 1 Jun 2017 08:48:16 +0000 (08:48 +0000)]
MFC r317457:

Use consistently uint32_t for mtu values.

This does not change functionality, but this cleanup is need for further
improvements of ICMP handling.

7 years agoMFC r317244:
tuexen [Thu, 1 Jun 2017 08:42:53 +0000 (08:42 +0000)]
MFC r317244:

Represent "a syncache overflow hasn't happend yet" by using
-(SYNCOOKIE_LIFETIME + 1) instead of INT64_MIN, since it is
good enough and works when time_t is int32 or int64.
This fixes the issue reported by cy@ on i386.

Reported by: cy

7 years agoMFC r317208:
tuexen [Thu, 1 Jun 2017 08:32:35 +0000 (08:32 +0000)]
MFC r317208:

Syncoockies can be used in combination with the syncache. If the cache
overflows, syncookies are used.
This patch restricts the usage of syncookies in this case: accept
syncookies only if there was an overflow of the syncache recently.
This mitigates a problem reported in PR217637, where is syncookie was
accepted without any recent drops.
Thanks to glebius@ for suggesting an improvement.

PR: 217637
Reviewed by: gnn, glebius
Differential Revision: https://reviews.freebsd.org/D10272

7 years agoMFC r316743:
tuexen [Thu, 1 Jun 2017 08:29:08 +0000 (08:29 +0000)]
MFC r316743:

The sysctl variable net.inet.tcp.drop_synfin is not honored in all states,
for example not in SYN-SENT.
This patch adds code to check the sysctl variable in other states than
LISTEN.
Thanks to ae and gnn for providing comments.

Reviewed by: gnn
Differential Revision: https://reviews.freebsd.org/D9894

7 years agoMFC r316038:
tuexen [Thu, 1 Jun 2017 08:25:45 +0000 (08:25 +0000)]
MFC r316038:

Tweak the Makefiles a bit to allow using "tcp" in MODULES_OVERRIDE
to build the tcp modules.

7 years agoMFC r314155:
tuexen [Thu, 1 Jun 2017 08:19:45 +0000 (08:19 +0000)]
MFC r314155:

TCP window updates are only sent if the window can be increased by at
least 2 * MSS. However, if the receive buffer size is small, this might
be impossible. Add back a criterion to send a TCP window update if
the window can be increased by at least half of the receive buffer size.
This condition was removed in r242252. This patch simply brings it back.

PR: 211003
Reviewed by: gnn
Differential Revision: https://reviews.freebsd.org/D9475

7 years agoMFC r313032:
tuexen [Thu, 1 Jun 2017 08:15:33 +0000 (08:15 +0000)]
MFC r313032:

Ensure that the variable bail is always initialized before used.

7 years agoMFC r313031:
tuexen [Thu, 1 Jun 2017 08:12:44 +0000 (08:12 +0000)]
MFC r313031:

Take the SCTP common header into account when computing the
space available for chunks. This unbreaks the handling of
ICMPV6 packets indicating "packet too big". It just worked
for IPv4 since we are overbooking for IPv4.

7 years agoMFC r313030:
tuexen [Thu, 1 Jun 2017 08:09:54 +0000 (08:09 +0000)]
MFC r313030:

Remove a duplicate debug statement.

7 years agoMFC r312722:
tuexen [Thu, 1 Jun 2017 08:07:09 +0000 (08:07 +0000)]
MFC r312722:

Fix a bug where the overhead of the I-DATA chunk was not considered.

7 years agoMFC r312063:
tuexen [Thu, 1 Jun 2017 08:04:09 +0000 (08:04 +0000)]
MFC r312063:

Ensure that the buffer length and the length provided in the IPv4
header match when using a raw socket to send IPv4 packets and
providing the header. If they don't match, let send return -1
and set errno to EINVAL.

Before this patch is was only enforced that the length in the header
is not larger then the buffer length.

PR: 212283
Reviewed by: ae, gnn
Differential Revision: https://reviews.freebsd.org/D9161

7 years agoRegenerate src.conf(5)
ngie [Thu, 1 Jun 2017 06:58:43 +0000 (06:58 +0000)]
Regenerate src.conf(5)

7 years agoMFC r314579,r314785:
ngie [Thu, 1 Jun 2017 06:56:32 +0000 (06:56 +0000)]
MFC r314579,r314785:

r314579 (by np):

Add cxgbetool(8) to the base system.

Move cxgbetool from tools/tools to usr.sbin. Compile and install it on
platforms where cxgbe(4) is built by default.  Knobs (WITH_CXGBETOOL and
WITHOUT_CXGBETOOL) have been added so that the user can override the
default setting.

r314785:

Fix some trivial manlint warnings

Sentences should begin on new lines, per manlint.

Bump .Dd for the change

7 years agoMFC r318437:
ngie [Thu, 1 Jun 2017 06:42:21 +0000 (06:42 +0000)]
MFC r318437:

Revert local changes to find_progenv accidentally committed in r318436

MFC with: r318436

7 years agoMFC r318436:
ngie [Thu, 1 Jun 2017 06:41:24 +0000 (06:41 +0000)]
MFC r318436:

usr.bin/getconf: add some initial tests

Items tested via this commit are:
- Some basic POSIX constants.
- Some valid programming environments with -v.
- Some invalid programming environments via -v.

NOTE: this test makes assumptions about ILP32/LP32 vs LP64 that are
currently not true on all architectures to avoid hardcoding some
architectures in the tests. I'm working on improving getconf(1) to be
more sane about handling ILP32/LP32 vs LP64. Future commits are coming
soon to address this.

Tested with: amd64, i386

7 years agoMFC r318434:
ngie [Thu, 1 Jun 2017 06:39:57 +0000 (06:39 +0000)]
MFC r318434:

Make the `.gperf.c` suffix rule depend on fake-gperf.awk

Parameterize out fake-gperf.awk to avoid duplicating the path

7 years agoMFC r318177:
ngie [Thu, 1 Jun 2017 06:36:40 +0000 (06:36 +0000)]
MFC r318177:

Unconditionally install udp(4) and udplite(4) again

I added this to the MK_USB != no block in error in r278202.

7 years agoMFC r319157:
ngie [Thu, 1 Jun 2017 06:35:37 +0000 (06:35 +0000)]
MFC r319157:

fma_test: mute a warning about unreachable code on amd64 by restructuring
the #ifdef block to only handle the rest of the logic in the loop in the
#else case.

CID: 1346844

7 years agoMFC r319158:
ngie [Thu, 1 Jun 2017 06:34:35 +0000 (06:34 +0000)]
MFC r319158:

logarithm_test: assert that feclearexcept succeeds

This helps ensure that test preconditons are fulfilled.

CID: 1346572

7 years agoMFC r318175,r318178,r318179:
ngie [Thu, 1 Jun 2017 06:26:35 +0000 (06:26 +0000)]
MFC r318175,r318178,r318179:

r318175:

procstat(1): clarify the Signal Disposition section

- Fix a typo (SIGIGN -> SIG_IGN). Use .Dv when referencing SIG_IGN.
- Use semi-colons as soft breaks when separating sentences for
  the FLAGS section.
- Tweak wording for C slightly to flow better and to be a bit
  more technically correct (signals with handlers installed will
  be caught by the target program).
- Reference signal(3) in the SEE ALSO section.

r318178:

procstat(1): document all possible `PRO` (network protocol) values

Reference the appropriate section 4 manpages for networking
protocols.

r318179:

procstat(1): also reference icmp(4) and sctp(4)

This was missed in the previous commit by accident.

MFC with: r318178