]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/log
FreeBSD/stable/10.git
5 years agoMFC r342071: ng_bpf.4: fix EXAMPLES: do not activate promiscuous mode
eugen [Mon, 17 Dec 2018 07:03:36 +0000 (07:03 +0000)]
MFC r342071: ng_bpf.4: fix EXAMPLES: do not activate promiscuous mode

PR: 102719

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

5 years agoMFC r334648:
hselasky [Thu, 13 Dec 2018 10:34:26 +0000 (10:34 +0000)]
MFC r334648:
Add support for SIMCom SIM7600E.

PR: 226066
Sponsored by: MSI/FUNTORO

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

5 years agoMFC r341650:
cy [Thu, 13 Dec 2018 03:12:15 +0000 (03:12 +0000)]
MFC r341650:

Remove an ugly Ultrix hack. Ultrix has been AWOL since the last ice
age, more to come.

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

5 years agoMFC r341585:
hselasky [Wed, 12 Dec 2018 13:14:41 +0000 (13:14 +0000)]
MFC r341585:
mlx5en: Improve configuration of HW LRO.

In order to enable HW LRO, both the "hw_lro" sysctl in the mlx5en(4) config
space must be set, and the ifconfig(8) LRO capability must be set. Any other
settings will disable HW LRO.

Sponsored by:   Mellanox Technologies

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

5 years agoAs part of the general cleanup of the ipfilter code, special cases
cy [Tue, 11 Dec 2018 01:49:06 +0000 (01:49 +0000)]
As part of the general cleanup of the ipfilter code, special cases
are committed separately to document fixing them separately from
the general cleanup. In this case we don't want to hide the utter
brokenness of what is being fixed.

Clean up a discombobulated block of #if's, with one block unreachable.
ip_fil.c is used in ipftest which is used to dry-run test ipfilter
rules in userspace without loading them in the kernel. The call to
(*ifp->if_output) matches that in the FreeBSD kernel.

Further testing and work will be required to make ipftest fully
functional.

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

5 years agoMFC r341377, r341388 (fixup):
cy [Sat, 8 Dec 2018 17:50:00 +0000 (17:50 +0000)]
MFC r341377, r341388 (fixup):

Restore handling of PMTU discovery, removed through an unifdef(1)
following the MFV of r254219 into r255332. In addition the 'FreeBSD'
macro was never defined in ipfilter 5.1.2 thus it never would have
been enabled in the first place.

This work is prompted by a general cleanup of the IP Filter code
prompted by working to resolve a PR. More to follow.

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

5 years agoMFC r341384:
cy [Sat, 8 Dec 2018 17:28:52 +0000 (17:28 +0000)]
MFC r341384:

Remove IFF_DRVRLOCK as it is used in IRIX only (and we all know IRIX
is dead). This includes collaterally removing code shared by HP/UX,
SGI, and Linux, where IP Filter will in all likelihood for various
reasons never run again.

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

5 years agoMFC r341280:
cy [Fri, 7 Dec 2018 21:42:41 +0000 (21:42 +0000)]
MFC r341280:

Clean up a rather useless conditional structure member definition.

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

5 years agoMFC r336641: fix incorrect operator in the AUDITPIPE_SET_QLIMIT bounds check
avg [Thu, 6 Dec 2018 13:32:51 +0000 (13:32 +0000)]
MFC r336641: fix incorrect operator in the AUDITPIPE_SET_QLIMIT bounds check

PR: 229983

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

5 years agoMFC r341265:
cy [Thu, 6 Dec 2018 04:28:39 +0000 (04:28 +0000)]
MFC r341265:

Remove an old comment/code and replace with a comment that
directly references a NetBSD commit.

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

5 years agoMFC r341484: Always treat firmware request and response sizes as unsigned.
emaste [Wed, 5 Dec 2018 21:51:39 +0000 (21:51 +0000)]
MFC r341484: Always treat firmware request and response sizes as unsigned.

This fixes an incomplete bounds check on the guest-supplied request
size where a very large request size could be interpreted as a negative
value and not be caught by the bounds check.

Submitted by: jhb
Reported by: Reno Robert
Security: CVE-2018-17160

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

5 years agoMFC r298454 (araujo): Use MIN()/MAX() macros from sys/param.h.
emaste [Wed, 5 Dec 2018 21:49:39 +0000 (21:49 +0000)]
MFC r298454 (araujo): Use MIN()/MAX() macros from sys/param.h.

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

5 years agoMFC r323010: hv_vss.4: Fix spelling of 'responsibility'
emaste [Tue, 4 Dec 2018 14:07:45 +0000 (14:07 +0000)]
MFC r323010: hv_vss.4: Fix spelling of 'responsibility'

PR: 221300
Submitted by: Fabian Keil
Obtained from: ElectroBSD

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

5 years agoMFC r340095: Remove apparently unused 0-byte files that cause grief on Windows
emaste [Mon, 3 Dec 2018 02:38:15 +0000 (02:38 +0000)]
MFC r340095: Remove apparently unused 0-byte files that cause grief on Windows

r235274 added a sort regression test (it operates by comparing output
against GNU sort).  The commit included a number of 0-byte files, one
of which ends in a trailing . which reportedly breaks svn/git checkouts
on Windows.

It appears these were added accidentally, so just remove them.

PR: 232479

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

5 years agoMFC r340868:
cy [Sat, 1 Dec 2018 18:17:51 +0000 (18:17 +0000)]
MFC r340868:

An OSF/1 ifdef makes absolutley no sense in a FreeBSD specific source
file.

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

5 years agoMFC r340909:
cy [Sat, 1 Dec 2018 18:09:17 +0000 (18:09 +0000)]
MFC r340909:

Combine two lines into one following unifdef for r255332.

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

5 years agoMFC r340765
arybchik [Fri, 30 Nov 2018 10:00:09 +0000 (10:00 +0000)]
MFC r340765

sfxge(4): cleanup: move into right place

Due to incorrect merge the piece of code was put in incorrect
place and diverge from libefx in other locations.

Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18024

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

5 years agoThis is a direct commit to the stable/10 branch. This would have been
cy [Fri, 30 Nov 2018 06:47:01 +0000 (06:47 +0000)]
This is a direct commit to the stable/10 branch. This would have been
MFC r340754 except that etc/rc.d has been moved in HEAD which would
have resulted in a tree conflict if merged.

Allow forced start of ipmon in special cases where testing is desired
(or other special cases) and when ipfilter is disabled in rc.conf but
started by other means.

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

5 years agoMFC r340260: Avoid buffer underwrite in icmp_error
emaste [Thu, 29 Nov 2018 20:14:09 +0000 (20:14 +0000)]
MFC r340260: Avoid buffer underwrite in icmp_error

icmp_error allocates either an mbuf (with pkthdr) or a cluster depending
on the size of data to be quoted in the ICMP reply, but the calculation
failed to account for the additional padding that m_align may apply.

Include the ip header in the size passed to m_align.  On 64-bit archs
this will have the net effect of moving everything 4 bytes later in the
mbuf or cluster.  This will result in slightly pessimal alignment for
the ICMP data copy.

Also add an assertion that we do not move m_data before the beginning of
the mbuf or cluster.

Reported by: A reddit user
Security: CVE-2018-17156
Sponsored by: The FreeBSD Foundation

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

5 years agoMFC r339818: rcorder(8):
eugen [Mon, 26 Nov 2018 13:36:30 +0000 (13:36 +0000)]
MFC r339818: rcorder(8):

  Add support for /etc/rc.resume, so it calls
  "rcorder -k resume" and runs scripts containing "KEYWORD: resume"
  with single "resume" argument.

  Working example is the port sysutils/cpupdate that defines
  extra_commands="resume" to reload CPU microcode cleared
  by suspend/resume sequence.

  This change does nothing for a system having no scripts with
  KEYWORD: resume.

PR: 227866
Differential Revision: https://reviews.freebsd.org/D15247

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

5 years agomakewhatis: do not try to operate on read-only mounted
eugen [Mon, 26 Nov 2018 13:08:34 +0000 (13:08 +0000)]
makewhatis: do not try to operate on read-only mounted
directories just to fail later. This is direct commit to stable/10
instead of MFC r339817 due to makewhatis.local being moved
in recent branches.

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

5 years agoPrevent ip_input() from panicing due to unprotected access
eugen [Mon, 26 Nov 2018 12:47:12 +0000 (12:47 +0000)]
Prevent ip_input() from panicing due to unprotected access
to INADDR_HASH. This is direct commit to stable/10 instead of MFC r339808
due to significant differences in code base.

PR: 220078
Differential Revision: https://reviews.freebsd.org/D12457
Tested-by: Cassiano Peixoto and others

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

5 years agoPrevent stf(4) from panicing due to unprotected access
eugen [Mon, 26 Nov 2018 12:19:30 +0000 (12:19 +0000)]
Prevent stf(4) from panicing due to unprotected access
to INADDR_HASH. This is direct commit to stable/10
instead of MFC r339806 due to significant differences
in code base.

PR: 220078
Differential Revision: https://reviews.freebsd.org/D12457
Tested-by: Cassiano Peixoto and others

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

5 years agoPrevent multicast code from panicing due to unprotected access
eugen [Mon, 26 Nov 2018 11:51:44 +0000 (11:51 +0000)]
Prevent multicast code from panicing due to unprotected access
to INADDR_HASH. This is direct commit to stable/10 instead of MFC r339807
due to significant difference in code base.

PR:                    220078
Tested-by: Cassiano Peixoto and others

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

5 years agoMFC r339816: mount_msdosfs
eugen [Mon, 26 Nov 2018 11:23:01 +0000 (11:23 +0000)]
MFC r339816: mount_msdosfs

  mount_msdosfs: do not fail mounts requiring locale name conversion table
  that is already present in a kernel statically.

  For example, the command "mount_msdosfs -L ru_RU.KOI8-R" fails with error
  "mount_msdosfs: msdosfs_iconv: File exists" for a kernel having
  options LIBICONV and MSDOSFS_ICONV. After this change, it mounts
  successfully.

MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D16951

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

5 years agoMFC: r339007, r340543, r340654
marius [Thu, 22 Nov 2018 13:18:58 +0000 (13:18 +0000)]
MFC: r339007, r340543, r340654

- Add ACPI identifier for AMD eMMC 5.0 controller [1]
- Add a quirk handling for AMDI0040 controllers allowing them to do HS400. [2]

Submitted by: Rajesh Kumar [1], Shreyank Amartya (original version) [2]

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

5 years agoMFC: r340495
marius [Wed, 21 Nov 2018 18:54:38 +0000 (18:54 +0000)]
MFC: r340495

- Restore setting the clock for devices which support the default/legacy
  transfer mode only (lost with r321385). [1]
- Similarly, don't try to set the power class on MMC devices that comply
  to version 4.0 of the system specification but are operated in default/
  legacy transfer or 1-bit bus mode as no power class is specified for
  these cases. Trying to set a power class nevertheless resulted in an -
  albeit harmless - error message.

PR: 231713 [1]

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

5 years agoUnbreak build after r340671. This is direct commit to stable/10.
eugen [Tue, 20 Nov 2018 11:19:02 +0000 (11:19 +0000)]
Unbreak build after r340671. This is direct commit to stable/10.

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

5 years agoMFC r339558: New sysctl: net.inet.icmp.error_keeptags
eugen [Tue, 20 Nov 2018 10:45:46 +0000 (10:45 +0000)]
MFC r339558: New sysctl: net.inet.icmp.error_keeptags

  Currently, icmp_error() function copies FIB number from original packet
  into generated ICMP response but not mbuf_tags(9) chain.
  This prevents us from easily matching ICMP responses corresponding
  to tagged original packets by means of packet filter such as ipfw(8).
  For example, ICMP "time-exceeded in-transit" packets usually generated
  in response to traceroute probes lose tags attached to original packets.

  This change adds new sysctl net.inet.icmp.error_keeptags
  that defaults to 0 to avoid extra overhead when this feature not needed.

  Set net.inet.icmp.error_keeptags=1 to make icmp_error() copy mbuf_tags
  from original packet to generated ICMP response.

PR: 215874

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

5 years agoMFC r340254:
hselasky [Mon, 19 Nov 2018 09:50:06 +0000 (09:50 +0000)]
MFC r340254:
Put a size limit on the opensm.log and use bzip2(1).

Discussed with: markj@
Sponsored by: Mellanox Technologies

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

5 years agoMFC r339472: rc.initdiskless: fix commentary grammar after r339465
eugen [Mon, 19 Nov 2018 06:52:20 +0000 (06:52 +0000)]
MFC r339472: rc.initdiskless: fix commentary grammar after r339465

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

5 years agoMFC r339465: rc.initdiskless: add support for auxiliary NVRAM.
eugen [Mon, 19 Nov 2018 06:39:00 +0000 (06:39 +0000)]
MFC r339465: rc.initdiskless: add support for auxiliary NVRAM.

  Currently, rc.inidiskless assumes that local system configuration
  changes are kept in some mountable file system. For example,
  nanobsd uses dedicated partition mounted as /cfg for this.

  However, small embedded devices like MIPS routers may have no enough flash
  space to keep full-blown file system but have only one or couple
  small flash blocks to keep persistent local configuration overrides.

  This change extends rc.initdiskless and introduces ability to run auxiliary
  command /conf/T/M/extract that is supposed to extract configuration overrides
  from such local storage.

  For example, the command /conf/default/etc/extract may contain something like:

  cd "$1" && bsdcpio --quiet -idu < /dev/map/cfg

  bsdcpio command extracts compressed archive from the storage to /etc
  assuming the storage is exposed by the kernel as /dev/map/cfg to userland.

PR: 204215

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

5 years agoMFC: r339999
rmacklem [Sun, 18 Nov 2018 23:48:15 +0000 (23:48 +0000)]
MFC: r339999
Fix NFS client vnode locking to avoid a crash during forced dismount.

A crash was reported where the crash occurred in nfs_advlock() when the
NFS_ISV4(vp) macro was being executed. This was caused by the vnode
being VI_DOOMED due to a forced dismount in progress.
This patch fixes the problem by locking the vnode before executing the
NFS_ISV4() macro.

PR: 232673

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

5 years agoMFC r340248:
hselasky [Sun, 11 Nov 2018 12:34:19 +0000 (12:34 +0000)]
MFC r340248:
Don't read the USB audio sync endpoint when we don't use it to save
isochronous bandwidth.

Sponsored by: Mellanox Technologies

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

5 years agoMFC r340212:
hselasky [Sat, 10 Nov 2018 10:32:55 +0000 (10:32 +0000)]
MFC r340212:
Sometimes the complete split packet may be queued too early and the
transaction translator will return a NAK. Ignore this message and
retry the complete split instead.

Sponsored by: Mellanox Technologies

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

5 years agoMFC r340089:
hselasky [Fri, 9 Nov 2018 08:47:54 +0000 (08:47 +0000)]
MFC r340089:
Use correct type for IOCTL request argument.
This fixes signed IOCTL value warnings in uhsoctl().

Submitted by: Marcin Cieslak <saper@saper.info>
Sponsored by: Mellanox Technologies

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

5 years agoMFC r339595: nfsrvd_readdirplus: for some errors, do not fail the entire request
avg [Tue, 6 Nov 2018 14:22:44 +0000 (14:22 +0000)]
MFC r339595: nfsrvd_readdirplus: for some errors, do not fail the entire request

Sponsored by: Panzura

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

5 years agoMFC: 339585
whu [Wed, 31 Oct 2018 06:24:07 +0000 (06:24 +0000)]
MFC: 339585

    r339585:
Do not drop UDP traffic when TXCSUM_IPV6 flag is on

PR: 231797
Submitted by: whu
Reviewed by: dexuan
Obtained from: Kevin Morse
Sponsored by: Microsoft

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

5 years agoMFC r339848: Import tzdata 2018g
philip [Wed, 31 Oct 2018 02:02:41 +0000 (02:02 +0000)]
MFC r339848: Import tzdata 2018g

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

5 years agoMFC 338408: Don't directly dereference a user pointer in the VPD ioctl.
jhb [Tue, 30 Oct 2018 21:31:32 +0000 (21:31 +0000)]
MFC 338408: Don't directly dereference a user pointer in the VPD ioctl.

The PCIOCLISTVPD ioctl on /dev/pci is used to fetch a list of VPD
key-value pairs for a specific PCI function.  It is used by
'pciconf -l -V'.  The list is stored in a userland-supplied buffer as
an array of variable-length structures where the key and data length
are stored in a fixed-size header followed by the variable-length
value as a byte array.  To facilitate walking this array in userland,
<sys/pciio.h> provides a PVE_NEXT() helper macro to return a pointer
to the next array element by reading the the length out of the current
header and using it to compute the address of the next header.

To simplify the implementation, the ioctl handler was also using
PVE_NEXT() when on the user address of the user buffer to compute the
user address of the next array element.  However, the PVE_NEXT() macro
when used with a user address was reading the value's length by
indirecting the user pointer.  The value was ready after the current
record had been copied out to the user buffer, so it appeared to work
on architectures where user addresses are directly dereferencable from
the kernel (all but powerpc and i386 after the 4:4 split).  The recent
enablement of SMAP on amd64 caught this violation however.  To fix,
add a variant of PVE_NEXT() for use in the ioctl handler that takes an
explicit value length.

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

5 years agoMFC r339366
davidcs [Mon, 29 Oct 2018 21:31:23 +0000 (21:31 +0000)]
MFC r339366
Add support for Error Recovery

Submitted by:Vaishali.Kulkarni@cavium.com

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

5 years agoMFC r338734
davidcs [Mon, 29 Oct 2018 21:14:48 +0000 (21:14 +0000)]
MFC r338734

Fixed isses:
  State check before enqueuing transmit task in bxe_link_attn() routine.
  State check before invoking bxe_nic_unload in bxe_shutdown().

Submitted by:Vaishali.Kulkarni@cavium.com

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

5 years agoMFC r337528: add an option for ddb ps command to print process arguments
avg [Mon, 29 Oct 2018 12:48:30 +0000 (12:48 +0000)]
MFC r337528: add an option for ddb ps command to print process arguments

Sponsored by: Panzura

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

5 years agoMFC r303648: Fix ddb "show proc" to show full arguments
avg [Mon, 29 Oct 2018 12:45:08 +0000 (12:45 +0000)]
MFC r303648: Fix ddb "show proc" to show full arguments

PR: 200052

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

5 years agoMFC r339587:
hselasky [Mon, 29 Oct 2018 12:11:27 +0000 (12:11 +0000)]
MFC r339587:
Added support for formula-based arbitrary baud rates, in contrast to
the current fixed values, which enables use of rates above 1 Mbps.
Improved the detection of HXD chips, and the status flag handling as
well.

Submitted by: Gabor Simon <gabor.simon75@gmail.com>
PR: 225932
Differential revision: https://reviews.freebsd.org/D16639
Sponsored by: Mellanox Technologies

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

5 years agoMFC r339582:
hselasky [Thu, 25 Oct 2018 14:56:19 +0000 (14:56 +0000)]
MFC r339582:
Drop sequencer mutex around uiomove() and make sure we don't move more bytes
than is available, else a panic might happen.

Found by: Peter Holm <peter@holm.cc>
Sponsored by: Mellanox Technologies

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

5 years agoMFC r339581:
hselasky [Thu, 25 Oct 2018 14:35:52 +0000 (14:35 +0000)]
MFC r339581:
Fix off-by-one which can lead to panics.

Found by: Peter Holm <peter@holm.cc>
Sponsored by: Mellanox Technologies

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

5 years agoMFC r339584:
slavash [Thu, 25 Oct 2018 14:12:48 +0000 (14:12 +0000)]
MFC r339584:
mlx5: Notify user that the ConnectX-6 shutdown its port due to power limitation

If power exceed the slot limit, or slot limit is unknown the ConnectX-6
firmware will shutdown its port.
Inform the user via debug message.

Approved by:    hselasky (mentor), kib (mentor)
Sponsored by:   Mellanox Technologies

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

5 years agoMFC r339509: Fix loader.conf(5) "password" feature
dteske [Wed, 24 Oct 2018 23:21:12 +0000 (23:21 +0000)]
MFC r339509: Fix loader.conf(5) "password" feature

Restore the ability to prevent the user from interrupting the boot process
without first entering the password stored in loader.conf(5).

PR: kern/207069
Reported by: david@dcrosstech.com
Sponsored by: Smule, Inc.

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

5 years agoMFC r339462: make upgrade from previous FreeBSD versions less painful
eugen [Wed, 24 Oct 2018 05:15:46 +0000 (05:15 +0000)]
MFC r339462: make upgrade from previous FreeBSD versions less painful
and make previously working configuration like this work again:

gif_interfaces="gif0"
gifconfig_gif0="1.1.1.1 2.2.2.2"
ifconfig_gif0="inet 192.168.1.1 192.168.1.2 netmask 255.255.255.252"

PR: 204700

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

5 years agoMFC r339503: Import tzdata 2018f
philip [Tue, 23 Oct 2018 01:42:43 +0000 (01:42 +0000)]
MFC r339503: Import tzdata 2018f

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

5 years agoMFC r339388:
hselasky [Fri, 19 Oct 2018 08:40:25 +0000 (08:40 +0000)]
MFC r339388:
Fix for reception of large full speed isochronous frames via the transaction
translator, when using the DWC OTG USB controller driver. Make sure to re-try
getting the complete split packets until a DATA0 packet is received. Larger
isochronous frames may be split into multiple MDATA packets terminated
by a single DATA0 packet.

PR: 230434
Sponsored by: Mellanox Technologies

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

5 years agoMFC r339211:
jamie [Wed, 17 Oct 2018 16:17:56 +0000 (16:17 +0000)]
MFC r339211:

  Fix the test prohibiting jails from sharing IP addresses.

  It's not supposed to be legal for two jails to contain the same IP address,
  unless both jails contain only that one address.  This is the behavior
  documented in jail(8), and is there to prevent confusion when multiple
  jails are listening on IADDR_ANY.

  VIMAGE jails (now the default for GENERIC kernels) test this correctly,
  but non-VIMAGE jails have been performing an incomplete test when nested
  jails are used.

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

5 years agoMFC r338200: Adding device ID for Terratec SiXPack 5.1+.
avatar [Wed, 10 Oct 2018 22:51:45 +0000 (22:51 +0000)]
MFC r338200: Adding device ID for Terratec SiXPack 5.1+.

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

5 years agoMFC r338993:
hselasky [Fri, 5 Oct 2018 07:50:44 +0000 (07:50 +0000)]
MFC r338993:
When multiple threads are involved receiving completion events in LibUSB
make sure there is always a master polling thread, by setting the "ctx_handler"
field in the context. Else the reception of completion events can stop.
This happens if event threads are created and destroyed during runtime.

Found by: Ludovic Rousseau <ludovic.rousseau+freebsd@gmail.com>
PR: 231742
Sponsored by: Mellanox Technologies

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

5 years agoSelectivly backport fix for firmware command hang when switching from
hselasky [Tue, 2 Oct 2018 16:01:33 +0000 (16:01 +0000)]
Selectivly backport fix for firmware command hang when switching from
polling-based firmware commands to event based firmware commands.

This is a direct commit.

Linux commit:
a7e1f04905e5b2b90251974dddde781301b6be37

Sponsored by: Mellanox Technologies

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

5 years agoDocument EN-18:09 through EN-18:12.
gjb [Mon, 1 Oct 2018 18:15:25 +0000 (18:15 +0000)]
Document EN-18:09 through EN-18:12.

Sponsored by: The FreeBSD Foundation

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

5 years agoMFC r337222:
asomers [Mon, 1 Oct 2018 18:00:52 +0000 (18:00 +0000)]
MFC r337222:

Fix LOCAL_PEERCRED with socketpair(2)

Enable the LOCAL_PEERCRED socket option for unix domain stream sockets
created with socketpair(2). Previously, it only worked with unix domain
stream sockets created with socket(2)/listen(2)/connect(2)/accept(2).

PR: 176419
Reported by: Nicholas Wilson <nicholas@nicholaswilson.me.uk>
Differential Revision: https://reviews.freebsd.org/D16350

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

5 years agoMFC r336871, r336874
asomers [Mon, 1 Oct 2018 16:23:00 +0000 (16:23 +0000)]
MFC r336871, r336874

r336871:
getrusage(2): fix return value under 32-bit emulation

According to the man page, getrusage(2) should return EFAULT if the rusage
argument lies outside of the process's address space. But due to an
oversight in r100384, that's never been the case during 32-bit emulation.
Fix it.

PR: 230153
Reported by: tests(7)
Reviewed by: cem
Differential Revision: https://reviews.freebsd.org/D16500

r336874:
freebsd32_getrusage(2): skip freebsd32_rusage_out on error

PR: 230153
Reported by: kib
X-MFC-With: 336871
Differential Revision: https://reviews.freebsd.org/D16500

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

5 years agoMFC r337973:
asomers [Mon, 1 Oct 2018 16:14:38 +0000 (16:14 +0000)]
MFC r337973:

Add Modbus Application Protocol to /etc/services

IANA reassigned ports 502 and 802 on 2014-06-10

PR: 213276
Submitted by: Mark.Martinec@ijs.si

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

5 years agoMFC r338216:
asomers [Mon, 1 Oct 2018 16:11:09 +0000 (16:11 +0000)]
MFC r338216:

tftpd: Fix data corruption bug with netascii

Transferring files in netascii format requires, among other things,
translating all CR characters to a CR,NUL pair. tftpd does this correctly
except when the CR occurs as the last octet of a packet. In that case, it
erroneously drops the NUL which should be part of the following packet. The
bug was caused by using 0 as a sentinel value in a variable that could
legitimately hold 0. Fix it by switching the sentinel value to -1.

PR: 178055
Reported by: Richard <rsitze@gmail.com>
Reviewed by: cem
Differential Revision: https://reviews.freebsd.org/D16853

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

5 years agoMFC r337779:
asomers [Mon, 1 Oct 2018 16:10:27 +0000 (16:10 +0000)]
MFC r337779:

tftp: Close a resource leak when putting files

Reported by: Coverity
CID: 1394842

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

5 years agoMFC r336609:
asomers [Mon, 1 Oct 2018 16:09:20 +0000 (16:09 +0000)]
MFC r336609:

Fix several Coverity warnings in tftp

Some of the changes are in the libexec/tftpd directory, but to functions that
are only used by tftp(1) (they share some code).

* strcpy => strlcpy (1006793100679410067961006741)
* Unchecked return value and TOCTTOU (1009314)
* NULL pointer dereference (10180351018036)

Reported by: Coverity
CID: 100679310067941006796100674110093141018035
CID: 1018036

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

5 years agoMFC r336605:
asomers [Mon, 1 Oct 2018 16:08:27 +0000 (16:08 +0000)]
MFC r336605:

Fix multiple Coverity warnings in tftpd(8)

* Initialize uninitialized variable (CID 1006502)
* strcpy => strlcpy (CID 100679210067911006790)
* Check function return values (CID 100944210094411009440)
* Delete dead code in receive_packet (not reported by Coverity)
* Remove redundant alarm(3) in receive_packet (not reported by Coverity)

Reported by: Coverity
CID: 1006502100679210067911006790100944210094411009440
Differential Revision: https://reviews.freebsd.org/D11287

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

5 years agoMFC r336587:
asomers [Mon, 1 Oct 2018 16:07:32 +0000 (16:07 +0000)]
MFC r336587:

tftpd(8): when completing an WRQ, flush the file before acknowleding receipt

tftpd(8) should flush a newly written file to disk before ACKing the final DATA
packet.  Otherwise there is a narrow race window when a subsequent read may not
see the file.  This is somewhat related to r330710, but the race window is much
smaller.  Hopefully this will fix the intermittent tests in Jenkins.

Reported by: Jenkins

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

5 years agoMFC r338827:
mm [Fri, 28 Sep 2018 22:02:01 +0000 (22:02 +0000)]
MFC r338827:
Sync libarchive with vendor.

Relevant vendor changes:
  PR #1019: Add allocation check for the zip_entry struct
  Oss-Fuzz #10192: Handle whitespace-only ACL fields correctly

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

5 years agoMFC 337673: Add an overview section to bus_dma.9.
jhb [Fri, 28 Sep 2018 17:40:06 +0000 (17:40 +0000)]
MFC 337673: Add an overview section to bus_dma.9.

Describe the role of tags and mapping objects as abstractions.
Describe static vs dynamic transaction types and give a brief overview
of the set of functions and object life cycles used for static vs
dynamic.

While here, fix a few other typos and expand a bit on parent tags.

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

5 years agoThere are various cases where we modify the inp_vflag and inp_inc.inc_flags
gordon [Thu, 27 Sep 2018 18:48:50 +0000 (18:48 +0000)]
There are various cases where we modify the inp_vflag and inp_inc.inc_flags
fields during a syscall, but don't restore those fields if the operation
fails.  This can leave the inp structure in an inconsistent state and cause
various problems.

Restore the inp_vflag and inp_inc.inc_flags fields when the underlying
operation fails and the inp could be in an inconsistent state.

This is a direct commit to the branch as the code is different enough in
the other branches to make it difficult to resolve a merge.

Submitted by: jtl@
Reported by: Jakub Jirasek, Secunia Research at Flexera
Reviewed by: jhb@
Approved by: so
Security: FreeBSD-EN-18:11.listen
Security: CVE-2018-6925

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

5 years agoMFC r338982.
gordon [Thu, 27 Sep 2018 18:44:40 +0000 (18:44 +0000)]
MFC r338982.

Clear stack allocated data structure to prevent kernel memory leak.

Reported by: Thomas Barabosch, Fraunhofer FKIE
Reviewed by: wes@
Approved by: so
Security: FreeBSD-EN-18:12.mem
Security: CVE-2018-17155

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

5 years agoMFC r338724:
markj [Mon, 24 Sep 2018 14:50:44 +0000 (14:50 +0000)]
MFC r338724:
Fix an nvpair leak in vdev_geom_read_config().

PR: 230704

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

5 years agoMFC r338754:
gjb [Fri, 21 Sep 2018 15:58:08 +0000 (15:58 +0000)]
MFC r338754:
 Update the pkg-stage.sh script used to populate packages on the
 dvd1.iso installation medium from including KDE4 to KDE5, as the
 KDE4-based ports have been marked as deprecated in the Ports
 Collection.

Sponsored by: The FreeBSD Foundation

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

5 years agoMFC r317659, r317752:
mav [Wed, 19 Sep 2018 19:54:13 +0000 (19:54 +0000)]
MFC r317659, r317752:
Make some UART consoles to not spin wait for data to be sent.

At least with Tx FIFO enabled it shows me ~10% reduction of verbose boot
time with serial console at 115200 baud.

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

5 years agoMFC r308750:
mav [Wed, 19 Sep 2018 19:52:53 +0000 (19:52 +0000)]
MFC r308750:
Add support for UART found in the Ingenic XBurst system on chips.

These CPUs has non-standard UART enable bit hidden in the UART FIFO
Control Register.

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

5 years agoMFC r338600:
mm [Wed, 19 Sep 2018 09:41:44 +0000 (09:41 +0000)]
MFC r338600:
Update libarchive to 3.3.3

As all important changes have already been merged from libarchive git
this is just a version number bump, documentation update and some
polishing for cpio tests. Other source code changes are not relevant to
FreeBSD.

Relnotes: yes

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

5 years agoMFC r338679:
hselasky [Wed, 19 Sep 2018 08:12:41 +0000 (08:12 +0000)]
MFC r338679:
Improve LibUSB debugging by simultaneously allowing both function
and transfer prints. Make sure the debug level comes from the
correct USB context.

Found by: Ludovic Rousseau <ludovic.rousseau+freebsd@gmail.com>
PR: 231264
Sponsored by: Mellanox Technologies

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

5 years agoMFC r338616:
hselasky [Wed, 19 Sep 2018 07:57:30 +0000 (07:57 +0000)]
MFC r338616:
Fix issues about cancelling USB transfers in LibUSB when the USB device has
been detached. When a USB device has been detached the kernel file handle
stops responding to commands. USB applications which continue to run after
the USB device has been detached, depend on LibUSB generated events to tear
down its pending USB transfers. Add code to handle the needed cleanup when
processing the USB transfer(s) fails and prevent new USB transfer(s) from
being submitted.

Found by: Ludovic Rousseau <ludovic.rousseau+freebsd@gmail.com>
PR: 231076
Sponsored by: Mellanox Technologies

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

5 years agoMFC r309748 (by glebius):
dim [Tue, 18 Sep 2018 20:46:55 +0000 (20:46 +0000)]
MFC r309748 (by glebius):

Treat R_X86_64_PLT32 relocs as R_X86_64_PC32.

If we load a binary that is designed to be a library, it produces
relocatable code via assembler directives in the assembly itself
(rather than compiler options).  This emits R_X86_64_PLT32 relocations,
which are not handled by the kernel linker.

Submitted by: gallatin
Reviewed by: kib
PR: 231451

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

5 years agoAdd xml:id for diff reduction.
gjb [Thu, 13 Sep 2018 15:58:03 +0000 (15:58 +0000)]
Add xml:id for diff reduction.

Sponsored by: The FreeBSD Foundation

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

5 years agoDocument SA-18:12 and EN-18:08.
gjb [Thu, 13 Sep 2018 15:55:22 +0000 (15:55 +0000)]
Document SA-18:12 and EN-18:08.

Sponsored by: The FreeBSD Foundation

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

5 years agoMFC: r333614, r333647, r338275, r338280, r338513
marius [Thu, 13 Sep 2018 10:18:50 +0000 (10:18 +0000)]
MFC: r333614, r333647, r338275, r338280, r338513

- Let mmcsd_ioctl() ensure appropriate privileges via priv_check(9).
- If present, take advantage of the R/W cache of eMMC revision 1.5 and
  later devices. These caches work akin to the ones found in HDDs/SSDs
  that ada(4)/da(4) also enable if existent, but likewise increase the
  likelihood of data loss in case of a sudden power outage etc. On the
  other hand, write performance is up to twice as high for e. g. 1 GiB
  files depending on the actual chip and transfer mode employed.
  For maximum data integrity, the usage of eMMC caches can be disabled
  via the hw.mmcsd.cache tunable.
- Get rid of the NOP mmcsd_open().
- Obtain the bus mode (MMC or SD) from the directly superordinated
  bus rather than reaching up to the bridge and use the cached mode
  in mmcsd_delete(), too.
- Use le32dec(9) for decoding EXT_CSD values where it makes sense. [1]
- Locally cache some instance variable values in mmc_discover_cards()
  in order to improve the code readability a bit.

Obtained from: NetBSD [1]

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

5 years agoMFC: r333613
marius [Thu, 13 Sep 2018 09:26:16 +0000 (09:26 +0000)]
MFC: r333613

The broken DDR52 support of Intel Bay Trail eMMC controllers rumored
in the commit log of r321385 has been confirmed via the public VLI54
erratum. Thus, stop advertising DDR52 for these controllers.
Note that this change should hardly make a difference in practice as
eMMC chips from the same era as these SoCs most likely support HS200
at least, probably even up to HS400ES.

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

5 years agoMFC: r338261, r338512
marius [Thu, 13 Sep 2018 09:20:07 +0000 (09:20 +0000)]
MFC: r338261, r338512

- According to section 2.2.5 of the SDHCI specification version 4.20,
  SDHCI_TRNS_ACMD12 is to be set only for multiple-block read/write
  commands without data length information, so don't unconditionally
  set this bit. The result matches what e. g. Linux does.
- Section 2.2.19 of the SDHCI specification version 4.20 states that
  SDHCI_ACMD12_ERR should be only valid if SDHCI_INT_ACMD12ERR is set
  and hardware may clear SDHCI_ACMD12_ERR when SDHCI_INT_ACMD12ERR is
  cleared (differing silicon behavior is specifically allowed, though).
  Thus, read SDHCI_ACMD12_ERR before clearing SDHCI_INT_ACMD12ERR.
  While at it, use the 16-bit accessor rather than the 32-bit one for
  reading the 16-bit SDHCI_ACMD12_ERR.
- SDHCI_INT_TUNEERR isn't one of the ROC bits in SDHCI_INT_STATUS so
  clear it explicitly.
- Add missing prototypes and sort them.
- Explicitly compare a pointer to NULL. The __builtin_expect() of clang
  3.4.1 otherwise isn't able to cope with the expression.

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

5 years agoFix incorrect display of the sys.class.infiniband.xxx.ports.1.rate sysctl
hselasky [Wed, 12 Sep 2018 10:53:22 +0000 (10:53 +0000)]
Fix incorrect display of the sys.class.infiniband.xxx.ports.1.rate sysctl
entry in ibcore by adding support for new rate types.

This is a direct commit.

Sponsored by: Mellanox Technologies

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

5 years agoMFC 338603:
gordon [Wed, 12 Sep 2018 05:03:30 +0000 (05:03 +0000)]
MFC 338603:
Correct ELF header parsing code to prevent invalid ELF sections from
disclosing memory.

Submitted by: markj
Reported by: Thomas Barabosch, Fraunhofer FKIE
Approved by: so
Security: FreeBSD-SA-18:12.elf
Security: CVE-2018-6924
Sponsored by: The FreeBSD Foundation

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

5 years agoMFC r338492:
hselasky [Mon, 10 Sep 2018 08:10:52 +0000 (08:10 +0000)]
MFC r338492:
Add support for receive side scaling stride, RSSS, in mlx5en(4).

The receive side scaling stride parameter is a value which define the interval
between active receive side queues. The traffic for the inactive queues is
redirected to the nearest active queue by use of modulus. The default value
of this parameter is one, which means all receive side queues are used.

The point of this feature is to redirect more traffic to fewer receive side
queues in order to take more advantage of sorted large receive offload,
sorted LRO. The sorted LRO works better when more packets are accumulated
per service interval.

Sponsored by: Mellanox Technologies

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

5 years agoMFC r338490:
hselasky [Mon, 10 Sep 2018 08:06:34 +0000 (08:06 +0000)]
MFC r338490:
Don't stall transmit queue on drops in mlx5en(4).

When a transmitted packet is dropped don't stall the transmit queue.

Sponsored by: Mellanox Technologies

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

5 years agoMFC r338489:
hselasky [Mon, 10 Sep 2018 08:03:52 +0000 (08:03 +0000)]
MFC r338489:
Maximum number of mbuf frags is off-by-one for worst case scenario in mlx5en(4).

Inspecting the PRM no more than 0x3F data segments, DS, of size 16 bytes is
allowed.

Worst case scenario summary of DS usage:
Header is fixed: 2 DS
Maximum inlining: 98 => (98 - 2) / 16 = 6 DS
Remainder: 0x3F - 2 - 6 = 55 DS (mbuf frags)

Previously a value of 56 DS was used and this would work in the
normal case because not all inline data area was used up.

Sponsored by: Mellanox Technologies

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

5 years agoMFC r316623: fix build after incomplete MFC r338544 by me.
eugen [Sun, 9 Sep 2018 18:40:30 +0000 (18:40 +0000)]
MFC r316623: fix build after incomplete MFC r338544 by me.

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

5 years agoMFC r316615 by sevan: Remove the last vestiges of FDC_DEBUG & FD_DEBUG
eugen [Sun, 9 Sep 2018 18:10:35 +0000 (18:10 +0000)]
MFC r316615 by sevan: Remove the last vestiges of FDC_DEBUG & FD_DEBUG

PR:             105608
Submitted by:   Differential Revision:  https://reviews.freebsd.org/D10303

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

5 years agoMFC r338126: MFV r338092: ntp 4.2.8p12.
delphij [Sat, 8 Sep 2018 04:10:26 +0000 (04:10 +0000)]
MFC r338126: MFV r338092: ntp 4.2.8p12.

Relnotes: yes

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

5 years agoMFC: r338304
marius [Wed, 5 Sep 2018 20:47:51 +0000 (20:47 +0000)]
MFC: r338304

The read accessors generated by __BUS_ACCESSOR() have the problem that
they don't check the result of BUS_READ_IVAR(9) and silently return stack
garbage on failure in case a bus doesn't implement a particular instance
variable for example. With MMC bridges not providing MMCBR_IVAR_RETUNE_REQ,
yet, this in turn can cause mmc(4) to get into a state in which re-tuning
seems to be necessary but is inappropriate, causing mmc_wait_for_request()
to fail. Thus, don't use __BUS_ACCESSOR() for mmcbr_get_retune_req() and
instead provide a version of the latter which returns retune_req_none if
reading MMCBR_IVAR_RETUNE_REQ fails.

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

5 years agoAvoid printing extraneous function names when searching man page
cy [Wed, 5 Sep 2018 01:33:30 +0000 (01:33 +0000)]
Avoid printing extraneous function names when searching man page
database (apropos, man -k). This commit Replaces .SS with .SH,
similar to the man page provided by original heimdal (as in port).

PR: 230573
Submitted by: yuripv@yuripv.net

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

5 years agoMFC r337522:
delphij [Mon, 3 Sep 2018 06:57:25 +0000 (06:57 +0000)]
MFC r337522:

In read_zones(), check if the file name actually fit in the buffer
and make sure it would terminate with nul with strlcpy().

Reviewed by: imp (earlier revision)
Differential Revision: https://reviews.freebsd.org/D16595

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

5 years agoMFC r338038: Extending the delay cycles to give the codec more time to pump ADC data...
avatar [Sun, 26 Aug 2018 13:03:58 +0000 (13:03 +0000)]
MFC r338038: Extending the delay cycles to give the codec more time to pump ADC data across the AC-link.

Without this patch, some CS4614 cards will need users to reload the driver manually or
the hardware won't be initialised properly. Something like:

# kldload snd_csa
# kldunload snd_csa
# kldload snd_csa

Tested with: Terratec SiXPack 5.1+

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

5 years agoMFC r336420,336433,336593,336621,336622,336624,337394,337401,338141
cperciva [Sun, 26 Aug 2018 05:28:17 +0000 (05:28 +0000)]
MFC r336420,336433,336593,336621,336622,336624,337394,337401,338141

Teach the EC2 AMI upload code to:
* Mark EBS snapshots as public,
* Announce new AMIs to an SNS topic, and
* Place the SVN branch and revision into the AMI "description".

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

5 years agoMFC 338013: bsnmpd(8): fix and optimize interface description processing
eugen [Sat, 25 Aug 2018 10:42:44 +0000 (10:42 +0000)]
MFC 338013: bsnmpd(8): fix and optimize interface description processing

* correctly prepare a buffer to obtain interface description from a kernel
  and truncate long description instead of dropping it altogether and
  spamming logs;
* skip calling strlen() for each description and each SNMP request
  for MIB-II/ifXTable's ifAlias.
* teach bsnmpd to allocate memory dynamically for interface descriptions
  to decrease memory usage for common case and not to break
  if long description occurs;

PR: 217763
Reviewed by: harti and others
Differential Revision: https://reviews.freebsd.org/D16459

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

5 years agoMFC: r337438
rmacklem [Fri, 24 Aug 2018 22:48:19 +0000 (22:48 +0000)]
MFC: r337438
Allow newnfs_request() to retry all callback RPCs with an NFSERR_DELAY reply.

The code in newnfs_request() retries RPCs that get a reply of NFSERR_DELAY,
but exempts certain NFSv4 operations. However, for callback RPCs, there
should not be any exemptions at this time. The code would have erroneously
exempted the CBRECALL callback, since it has the same operation number as
the CLOSE operation.
This patch fixes this by checking for a callback RPC (indicated by clp != NULL)
and not checking for exempt operations for callbacks.
This would have only affected the NFSv4 server when delegations are enabled
(they are not enabled by default) and the client replies to CBRECALL with
NFSERR_DELAY. This may never actually happen.
Spotted during code inspection.

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

5 years agoMFC r338120: config(8): Allow escape-quoted empty strings
kevans [Thu, 23 Aug 2018 02:20:09 +0000 (02:20 +0000)]
MFC r338120: config(8): Allow escape-quoted empty strings

For use with things like BOOT_TAG=\"\" -- there are valid reasons to allow
empty strings, especially as these are usually being passed through as
options. The same argument could perhaps be made for the unquoted
variant in things like MODULES_OVERRIDE="", but it's not immediately clear
that this is an issue so I've left it untouched.

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

5 years agoMFC r337456:
pfg [Wed, 22 Aug 2018 04:21:25 +0000 (04:21 +0000)]
MFC r337456:
msdosfs: fixes for Undefined Behavior.

These were found by the Undefined Behaviour GsoC project at NetBSD:

Do not change signedness bit with left shift.
While there avoid signed integer overflow.
Address both issues with using unsigned type.

msdosfs_fat.c:512:42, left shift of 1 by 31 places cannot be represented
in type 'int'
msdosfs_fat.c:521:44, left shift of 1 by 31 places cannot be represented
in type 'int'
msdosfs_fat.c:744:14, left shift of 1 by 31 places cannot be represented
in type 'int'
msdosfs_fat.c:744:24, signed integer overflow: -2147483648 - 1 cannot be
represented in type 'int [20]'
msdosfs_fat.c:840:13, left shift of 1 by 31 places cannot be represented
in type 'int'
msdosfs_fat.c:840:36, signed integer overflow: -2147483648 - 1 cannot be
represented in type 'int [20]'

Detected with micro-UBSan in the user mode.

Hinted from: NetBSD (CVS 1.33)

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

5 years agoMFC r338047:
cy [Wed, 22 Aug 2018 01:43:11 +0000 (01:43 +0000)]
MFC r338047:

The bucket index is subtracted by one at lines 2304 and 2314.  When 0 it
becomes -1, except these are unsigned integers, so they become very large
numbers. Thus are always larger than the maximum bucket; the hash table
insertion fails causing NAT to fail.

This commit ensures that if the index is already zero it is not reduced
prior to insertion into the hash table.

PR: 208566

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