]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/log
FreeBSD/stable/10.git
6 years agoMFC r323448: bsdinstall: Ignore error return from newaliases(1)
emaste [Thu, 14 Sep 2017 01:24:17 +0000 (01:24 +0000)]
MFC r323448: bsdinstall: Ignore error return from newaliases(1)

This was originally added as "exit $SUCCESS" but with nothing to set the
SUCCESS variable. Thus it became an exit with no argument, which just
exits with the status of the preceding command.

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

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

6 years agoMFC: r323382, MFV: r323381
marius [Wed, 13 Sep 2017 21:56:49 +0000 (21:56 +0000)]
MFC: r323382, MFV: r323381

Permit a deflateParams() parameter change as soon as possible.

This change fixes compression errors seen when the embedded Tomcat
web server of a UniFi Controller zlib compresses responses. Given
that Tomcat just uses Java/OpenJDK which in turn employs zlib for
its compression/decompression support, this bug might very well
affect other applications, too.

PR: 222136
Approved by: re (gjb)

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

6 years agoMFC r320069: Add ZFS to Linux statfs ftype
emaste [Sat, 9 Sep 2017 14:30:16 +0000 (14:30 +0000)]
MFC r320069: Add ZFS to Linux statfs ftype

PR: 220086
Approved by: re (gjb)
Sponsored by: The FreeBSD Foundation

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

6 years agoMFC r322374: bsdinstall: record DHCP config after obtaining lease
emaste [Sat, 9 Sep 2017 01:23:30 +0000 (01:23 +0000)]
MFC r322374: bsdinstall: record DHCP config after obtaining lease

Previously we added an ifconfig_$INTERFACE line to rc.conf for each
unsuccessful DCHP attempt.

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

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

6 years agoMFC r322677: pw usermod: handle empty secondary group lists (-G '')
emaste [Fri, 8 Sep 2017 21:16:23 +0000 (21:16 +0000)]
MFC r322677: pw usermod: handle empty secondary group lists (-G '')

"pw usermod someuser -G ''" is supposed make sure that someuser
doesn't have any secondary group memberships.

Previouly it was a nop because split_groups() only intitialised
"groups" if at least one group was specified. As a result the
existing secondary group memberships were kept.

PR: 221417
Submitted by: Fabian Keil
Approved by: re (kib)
Obtained from: ElectroBSD
Relnotes: yes

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

6 years agoMFC r322678: pw useradd: Validate the user name before creating the entry
emaste [Fri, 8 Sep 2017 21:02:15 +0000 (21:02 +0000)]
MFC r322678: pw useradd: Validate the user name before creating the entry

Previouly it was possible to create users with spaces in the name with:
pw useradd -u 1234 -g 1234 -n 'test user'

The "-g 1234" is relevant, without it the name was already rejected
as expected:

[fk@test ~]$ sudo pw useradd -u 1234 -n 'test user'
pw: invalid character ` ' at position 4 in userid/group name

Bug unintentionally found with a salt config without explicit name entry:

test user:
  user.present:
    - uid: 1234
    - gid: 1234
    - fullname: Test user
    - shell: /usr/local/bin/bash
    - home: /home/test
    - groups:
      - wheel
      - salt

"Luckily" salt modules rarely bother with input validation either ...

PR: 221416
Submitted by: Fabian Keil
Approved by: re (kib)
Obtained from: ElectroBSD

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

6 years agoMFC r323002: zfs: do not advertise unsupported hash algorithms
emaste [Fri, 8 Sep 2017 20:41:49 +0000 (20:41 +0000)]
MFC r323002: zfs: do not advertise unsupported hash algorithms

illumos 4185 ("add new cryptographic checksums to ZFS: SHA-512, Skein,
Edon-R") was intentionally merged only partially in r289422, without
adding support for skein, sha512 and edonr on FreeBSD.

Support for skein and sha512 was added later on (in head), but none of
these are supported in stable/10. Prior to this commit zfs(8) correctly
rejected these algorithms, but with an error message that claimed
support:

fk@r500 ~ $zfs set checksum=edonr tank
cannot set property for 'tank': 'checksum' must be one of 'on | off |
  fletcher2 | fletcher4 | sha256 | sha512 | skein | edonr'

(This commit removes sha512 and skein in addition to edonr from the
merge of head's r323002.)

PR: 204055
Submitted by: Fabian Keil
Approved by: re (kib)
Obtained from: ElectroBSD

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

6 years agoUpdate stable/10 to BETA4 in preparation for 10.4-BETA4 builds.
marius [Fri, 8 Sep 2017 00:11:58 +0000 (00:11 +0000)]
Update stable/10 to BETA4 in preparation for 10.4-BETA4 builds.

Approved by: re (implicit)

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

6 years ago- Ever since the workaround for the silicon bug of TSO4 causing MAC hangs
marius [Fri, 8 Sep 2017 00:11:35 +0000 (00:11 +0000)]
- Ever since the workaround for the silicon bug of TSO4 causing MAC hangs
  was committed in r295133 (MFCed to stable/10 in r295287), CSUM_TSO gets
  always disabled by em(4) on the first invocation of em_init_locked() as
  at that point no link is established, yet. In turn, this causes CSUM_TSO
  also to be off when em(4) is used as a parent device for vlan(4), i. e.
  besides IFCAP_TSO4, IFCAP_VLAN_HWTSO effectively doesn't work either.

  In head an attempt to fix this was made with r308345, but that revision
  had several problems on its own. One of which was that r308345 caused
  IFCAP_TSO4 to also be cleared from both the interface capability and
  capability enable bits. Thus, once a link switched from gigabit to a
  lower speed, TSO no longer could be enabled, even not via ifconfig(8).
  So this change moves the aforementioned WAR to em_update_link_status()
  like r308345 did, but only alters the hardware assist bits accordingly,
  leaving IFCAP_TSO4 flags alone.

  Still, this isn't the only problem r308345 had. Another one is that there
  just is no way to atomically flush TSO-using descriptors already queued
  at the point in time a link speed switch to below GbE occurs. Thus, such
  in-flight descriptors still may hang the MAC. Moreover, at least currently
  there also is no way of triggering a reconfiguration of vlan(4) when the
  state of IFCAP_VLAN_HWTSO support changes at runtime, causing vlan(4) to
  continue employing TSO. Last but not least, testing shows that - despite
  all the WARs for TSO-related silicon bugs in em(4) - at least 82579 still
  may hang at gigabit speed with IFCAP_TSO4 enabled. Therefore, this change
  further removes IFCAP_TSO4 and IFCAP_VLAN_HWTSO from interface capability
  enable bits as set by em(4). While at it, the use of CSUM_TCP is replaced
  with CSUM_IP_TSO as em(4) only implements support for IFCAP_TSO4 but not
  IFCAP_TSO6 (although in principle available with a subset of the supported
  MACs).

  At the bottom line, this change allows IFCAP_TSO4 and IFCAP_VLAN_HWTSO to
  be used again with em(4), but these hardware offloading capabilities now
  need to be explicitly enabled via ifconfig(8). Beware that it's only
  considered safe to do so (and also only may work) in environments where
  the link speed is not to be expected to change from GbE. Moreover, em(4)
  appears to still be missing some more TSO workarounds for at least some
  models, specifically the 82579 (I could not find an errata sheet and
  "specification update" respectively for these latter, though, and the
  generic ICH8 one doesn't list any TSO related bugs).

- Let igb_tso_setup() handle EtherType protocols that are unsupported or
  for which support hasn't been compiled in gracefully instead of calling
  panic(9).

- Make em_allocate_{legacy,msix}() and lem_allocate_irq() match their
  prototypes WRT static.

This is a direct commit to stable/10 as corresponding code is no longer
present in head.

Approved by: re (gjb, kib)

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

6 years agoMFC: r321293
marius [Thu, 7 Sep 2017 23:28:35 +0000 (23:28 +0000)]
MFC: r321293

date: avoid crash on invalid time

PR: 220828
Approved by: re (kib)

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

6 years agoMFC r323278: Fix an incorrectly used conditional causing buffer overflow.
gordon [Thu, 7 Sep 2017 19:23:08 +0000 (19:23 +0000)]
MFC r323278: Fix an incorrectly used conditional causing buffer overflow.

Reported by: Thomas Jarosch of Intra2net AG
Reviewed by: emaste, jhb
Approved by: re (marius)
Security: CVE-2017-1000249

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

6 years agoMFC r322073:
cy [Wed, 6 Sep 2017 20:01:19 +0000 (20:01 +0000)]
MFC r322073:

Fix matchcing of NATed ICMP queries (resolving NATed MTU discovery).

Approved by: re (kib)

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

6 years agoMFC r322810 and r322830:
hselasky [Wed, 6 Sep 2017 15:33:23 +0000 (15:33 +0000)]
MFC r322810 and r322830:
Add new mlx5ib(4) driver to the kernel source tree which supports
Remote DMA over Converged Ethernet, RoCE, for the ConnectX-4 series of
PCI express network cards.

There is currently no user-space support and this driver only supports
kernel side non-routable RoCE V1. The krping kernel module can be used
to test this driver. Full user-space support including RoCE V2 will be
added as part of the ongoing upgrade to ibcore from Linux 4.9. Otherwise
this driver is feature equivalent to mlx4ib(4). The mlx5ib(4) kernel
module will only be built when WITH_OFED=YES is specified.

Approved by: re (marius)
Sponsored by: Mellanox Technologies

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

6 years agoMFC r323001:
dim [Tue, 5 Sep 2017 17:32:14 +0000 (17:32 +0000)]
MFC r323001:

In compiler-rt, a few assembler implementations for i386 floating point
conversion functions use SSE2 instructions, but these are not guarded by
#ifdef __SSE2__, and there is no implementation using general purpose
registers.  For these functions, use the generic C variants instead,
otherwise they will cause SIGILL on older processors.

Approved by: re (kib)
Reported by: bsdpr@phoe.frmug.org
PR: 221733

MFC r323014:

Follow-up to r323001: if the actually selected CPUTYPE is capable of
SSE2 instructions, we can use them.

Suggested by: jkim
PR: 221733

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

6 years agoUpgrade OpenSSH to 7.3p1.
des [Fri, 1 Sep 2017 22:52:18 +0000 (22:52 +0000)]
Upgrade OpenSSH to 7.3p1.

This is the last version of OpenSSH which does not break compatibility
more than we can live with in a stable branch.  Further commits will
follow to backport some bug fixes from newer versions.

The sshd breakage in the previous attempt was due to an upstream bug
(a 0 was changed to a 1 while refactoring send_rexec_state() in sshd.c)
which only manifested itself when sshd was built with SSH 1 support.

Approved by: re@

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

6 years agoRevert OpenSSH 7.3p1; something went wrong between testing and committing.
des [Fri, 1 Sep 2017 21:48:36 +0000 (21:48 +0000)]
Revert OpenSSH 7.3p1; something went wrong between testing and committing.

Approved by: re@

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

6 years agoUpgrade OpenSSH to 7.3p1.
des [Fri, 1 Sep 2017 21:24:32 +0000 (21:24 +0000)]
Upgrade OpenSSH to 7.3p1.

This is the last version of OpenSSH which does not break compatibility
more than we can live with in a stable branch.  Further commits will
follow to backport some bug fixes from newer versions.

Approved by: re@

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

6 years agoFix a typo in the hard link creation for a WANDBOARD DTB file. Just
marius [Fri, 1 Sep 2017 19:11:47 +0000 (19:11 +0000)]
Fix a typo in the hard link creation for a WANDBOARD DTB file. Just
like r322666 which introduced this bug, this is a direct commit to
stable/10.

Approved by: re (kib)

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

6 years agoUpdate stable/10 to BETA3 in preparation for 10.4-BETA3 builds.
marius [Fri, 1 Sep 2017 00:16:03 +0000 (00:16 +0000)]
Update stable/10 to BETA3 in preparation for 10.4-BETA3 builds.

Approved by: re (implicit)

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

6 years agoMFC: r308643, r312427, r312641, r322986
marius [Thu, 31 Aug 2017 23:59:46 +0000 (23:59 +0000)]
MFC: r308643, r312427, r312641, r322986

- Update WOL support for newer em(4) devices. [1]
- Add support for Kaby Lake generation i219 (4) and i219 (5) devices.
- Enable WOL features also for the igb(4) class of devices. [1]
- Don't set any WOL enabling hardware bits if WOL isn't requested
  according to the enabled interface capability bits.

PR: 208343 [1]
Submitted by: Kaho Tashikazu <kaho@elam.kais.kyoto-u.ac.jp> [1]
Approved by: re (kib)

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

6 years agoMFC r322852
davidcs [Thu, 31 Aug 2017 21:56:17 +0000 (21:56 +0000)]
MFC r322852
Fix qlnx_tso_check() so that every window of
(ETH_TX_LSO_WINDOW_BDS_NUM - nbds_in_hdr) has atleast
ETH_TX_LSO_WINDOW_MIN_LEN bytes

Approved by:re(marius)

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

6 years agoMFC r322628: Fix BSD label partition end sector calculation.
oleg [Thu, 31 Aug 2017 13:32:01 +0000 (13:32 +0000)]
MFC r322628: Fix BSD label partition end sector calculation.

Approved by: re (marius)
Differential Revision: https://reviews.freebsd.org/D12066

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

6 years agoMFC r321806:
cy [Thu, 31 Aug 2017 00:56:10 +0000 (00:56 +0000)]
MFC r321806:

Remove redundant include directories which expand to a noop,
"-I/lib/krb5 -I -I".

Reviewed by:    ngie@, markm@
Approved by: re@ (marius@)
Differential Revision:  D11769

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

6 years agoMFC 322771
davidcs [Mon, 28 Aug 2017 19:17:28 +0000 (19:17 +0000)]
MFC 322771

Upgrade FW to 5.4.66
sysctls to display stats, stats polled every 2 seconds
Modify QLA_LOCK()/QLA_UNLOCK() to not sleep after acquiring mtx_lock
Add support to turn OFF/ON error recovery following heartbeat failure for
debug purposes.
Set default max values to 32 Tx/Rx/SDS rings

Approved by: re(gjb)

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

6 years agoUpdate stable/10 to BETA2 in preparation for 10.4-BETA2 builds.
marius [Fri, 25 Aug 2017 00:11:29 +0000 (00:11 +0000)]
Update stable/10 to BETA2 in preparation for 10.4-BETA2 builds.

Approved by: re (implicit)

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

6 years agoMFC r322408
davidcs [Thu, 24 Aug 2017 22:33:42 +0000 (22:33 +0000)]
MFC r322408
Performance enhancements to reduce CPU utililization for large number of
TCP connections (order of tens of thousands), with predominantly Transmits.

Submitted by: Vaishali.Kulkarni@cavium.com
Approved by: re(marius)

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

6 years agoNote change brought on by 322860 MFC.
mckusick [Thu, 24 Aug 2017 21:49:44 +0000 (21:49 +0000)]
Note change brought on by 322860 MFC.

Discussed with: kib, imp
Differential Revision: https://reviews.freebsd.org/D11589
Approved by: re (kib)

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

6 years agoMFC of 276737, 322200, 322201, 322271, and 322297
mckusick [Thu, 24 Aug 2017 21:44:23 +0000 (21:44 +0000)]
MFC of 276737, 322200, 322201, 322271, and 322297

276737: Remove old ioctl use and support
322200: Remove (broken) search for alternate superblocks
322201: Show differences when alternate superblock fails to match
322271: Cleanup for 322200.
322297: Restore fsck_ffs ability to find alternate superblocks

Discussed with: kib, imp
Differential Revision: https://reviews.freebsd.org/D11589
Approved by: re (kib)

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

6 years agoMFC: r322726
marius [Thu, 24 Aug 2017 20:52:28 +0000 (20:52 +0000)]
MFC: r322726

Bring back the much more readable unified format for differences in
/etc/{group,master.passwd}. This was originally turned on for all of
/etc/{aliases,group,master.passwd} in r55196, but then backed out
only for the latter two in r56697, as the adaption of the sed(1)ing
done in r56308 was incorrect. This left us with inconsistent diff(1)
formats in the daily output of periodic(8) ever since, despite in
r56697 having been promised to be revisited. So properly adapt the
password hash filtering to the unified format and turn the later on
again for /etc/{group,master.passwd}, too.

Approved by: re (kib)

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

6 years agoMFC r322331
davidcs [Thu, 24 Aug 2017 18:01:17 +0000 (18:01 +0000)]
MFC r322331
  Provide compile option to choose receive processing in either Ithread or
  Taskqueue Thread.

Approved by: re(marius)

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

6 years agoMFC r278479,278494,278525,278545,278592,279237,280410:
will [Thu, 24 Aug 2017 17:25:16 +0000 (17:25 +0000)]
MFC r278479,278494,278525,278545,278592,279237,280410:

This change merges devctl notification for userland coredumps.

r278479 (rpaulo):

  Notify devd(8) when a process crashed.

  This change implements a notification (via devctl) to userland when
  the kernel produces coredumps after a process has crashed.
  devd can then run a specific command to produce a human readable crash
  report.  The command is most usually a helper that runs gdb/lldb
  commands on the file/coredump pair.  It's possible to use this
  functionality for implementing automatic generation of crash reports.

  devd(8) will be notified of the full path of the binary that crashed and
  the full path of the coredump file.

r278494 (rpaulo):

  Sanitise the coredump file names sent to devd.

  While there, add a sysctl to turn this feature off as requested by kib@.

r278525 (rpaulo):

  Remove a printf and an strlen() from the coredump code.

r278545 (rpaulo):

  Restore the data array in coredump(), but use a different style to
  calculate the length.

r278592 (rpaulo):

  Remove check against NULL after M_WAITOK.

r279237 (kib):

  Keep a reference on the coredump vnode for vn_fullpath() call.  Do it
  by moving vn_close() after the point where notification is sent.

r280410 (rpaulo):

  Disable coredump_devctl because it could lead to leaking paths to jails.

Approved by: re

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

6 years agoMFC r322770, r322796:
gjb [Thu, 24 Aug 2017 13:39:24 +0000 (13:39 +0000)]
MFC r322770, r322796:

 r322770:
  Apply changes from bin/chmod/tests/chmod_test.sh, adding
  atf_expect_fail() before chflags(8) is invoked if the filesystem
  is ZFS, which does not support UF_IMMUTABLE.

 r322796:
  Revert part of r322770 in usr.sbin/chown/tests/chown_test.sh,
  which incorrectly adds atf_expect_fail() where there is no
  failure case.

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

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

6 years agoMFC r322544:
gjb [Wed, 23 Aug 2017 17:47:57 +0000 (17:47 +0000)]
MFC r322544:
 Always expand the full path to the configuration file specified
 with the '-c' flag.  This fixes an issue where the configuration
 file would not properly be located intermittently.

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

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

6 years agoMFC of 269692, 322179, 322463, and 322464:
mckusick [Tue, 22 Aug 2017 15:26:47 +0000 (15:26 +0000)]
MFC of 269692, 322179, 322463, and 322464:

269692: cswitch is unsigned, so don't compare it < 0
322179: Correct ordering of bio's in gjournal queue
322463: Eliminate a variable that is set-only in g_journal.c
322464: Correct check for reads in gjournal

Submitted by: Dr. Andreas Longwitz <longwitz@incore.de>
Discussed with: kib
Approved by: re (marius)

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

6 years agoMFC r322410:
ken [Tue, 22 Aug 2017 14:40:56 +0000 (14:40 +0000)]
MFC r322410:
  ------------------------------------------------------------------------
  r322410 | ken | 2017-08-11 12:43:52 -0600 (Fri, 11 Aug 2017) | 16 lines

  Add historical notes on QIC tape drives and fix a couple of issues in mt(1).

   o Density code 0x5 is also known as QIC-11, and should have a footnote
     reference.
   o Add notes on QIC tape drives from the bug report.  These may help anyone
     trying to use a QIC drive.
   o Take out a "more more" instance found by igor.
   o Bump the man page date.

  The PR is 14 years old, so it's past time to retire it.

  PR: doc/53596
  Submitted by: tedm@toybox.placo.com
  Reviewed by: bcr
  Sponsored by: Spectra Logic

  ------------------------------------------------------------------------

Approved by: re (gjb)

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

6 years agoMFC r321949, r321950, r322101:
gjb [Mon, 21 Aug 2017 17:20:31 +0000 (17:20 +0000)]
MFC r321949, r321950, r322101:

 r321949 (ngie):
  Add expected failures for ZFS

  - :f_flag fails on ZFS because UF_IMMUTABLE isn't supported.
  - :v_flag fails on ZFS because the mode for foo is [always] updated
    unnecessarily.

  get_filesystem(..) (supporting function that was added to the test
  script) is based on equivalent logic in
  usr.bin/extattr/tests/extattr_test.sh .

 r321950 (ngie):
  Always use first parameter passed to get_filesystem(..) instead of
  discarding it and using `.` instead.

 r322101 (ngie):
  Don't check result of chflags in f_flag_cleanup()

  This will prevent false positives from occurring if the test is run
  on ZFS since ZFS doesn't support fflags throbbing like UFS.

PR: 221188, 221189
Approved by: re (marius)
Sponsored by: The FreeBSD Foundation

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

6 years agoMFC r322667,r322706:
kib [Mon, 21 Aug 2017 15:44:57 +0000 (15:44 +0000)]
MFC r322667,r322706:
Improve i386 #UD low-level kdtrace hook.

Approved by: re (marius)

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

6 years agoMFC r284152:
ae [Mon, 21 Aug 2017 10:07:12 +0000 (10:07 +0000)]
MFC r284152:
  Add makefile to build geom_map kld. Document some GEOM_* options
  in NOTES and geom(4).

PR: 197766
Approved by: re (kib)

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

6 years agoMFC 322299,322483,322485-322487
sephe [Mon, 21 Aug 2017 05:25:30 +0000 (05:25 +0000)]
MFC 322299,322483,322485-322487

322299
    hyperv/hn: Implement transparent mode network VF.

    How network VF works with hn(4) on Hyper-V in transparent mode:

    - Each network VF has a cooresponding hn(4).
    - The network VF and the it's cooresponding hn(4) have the same hardware
      address.
    - Once the network VF is attached, the cooresponding hn(4) waits several
      seconds to make sure that the network VF attach routing completes, then:
      o  Set the intersection of the network VF's if_capabilities and the
         cooresponding hn(4)'s if_capabilities to the cooresponding hn(4)'s
         if_capabilities.  And adjust the cooresponding hn(4) if_capable and
         if_hwassist accordingly. (*)
      o  Make sure that the cooresponding hn(4)'s TSO parameters meet the
         constraints posed by both the network VF and the cooresponding hn(4).
         (*)
      o  The network VF's if_input is overridden.  The overriding if_input
         changes the input packet's rcvif to the cooreponding hn(4).  The
         network layers are tricked into thinking that all packets are
         neceived by the cooresponding hn(4).
      o  If the cooresponding hn(4) was brought up, bring up the network VF.
         The transmission dispatched to the cooresponding hn(4) are
         redispatched to the network VF.
      o  Bringing down the cooresponding hn(4) also brings down the network
         VF.
      o  All IOCTLs issued to the cooresponding hn(4) are pass-through'ed to
         the network VF; the cooresponding hn(4) changes its internal state
         if necessary.
      o  The media status of the cooresponding hn(4) solely relies on the
         network VF.
      o  If there are multicast filters on the cooresponding hn(4), allmulti
         will be enabled on the network VF. (**)
    - Once the network VF is detached.  Undo all damages did to the
      cooresponding hn(4) in the above item.

    NOTE:
    No operation should be issued directly to the network VF, if the
    network VF transparent mode is enabled.  The network VF transparent mode
    can be enabled by setting tunable hw.hn.vf_transparent to 1.  The network
    VF transparent mode is _not_ enabled by default, as of this commit.

    The benefit of the network VF transparent mode is that the network VF
    attachment and detachment are transparent to all network layers; e.g. live
    migration detaches and reattaches the network VF.

    The major drawbacks of the network VF transparent mode:
    - The netmap(4) support is lost, even if the VF supports it.
    - ALTQ does not work, since if_start method cannot be properly supported.

    (*)
    These decisions were made so that things will not be messed up too much
    during the transition period.

    (**)
    This does _not_ need to go through the fancy multicast filter management
    stuffs like what vlan(4) has, at least currently:
    - As of this write, multicast does not work in Azure.
    - As of this write, multicast packets go through the cooresponding hn(4).

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

322483
    hyperv/hn: Update VF's ibytes properly under transparent VF mode.

    While, I'm here add comment about why updating VF's imcast stat is
    not necessary.

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

322485
    hyperv/hn: Fix/enhance receiving path when VF is activated.

    - Update hn(4)'s stats properly for non-transparent mode VF.
    - Allow BPF tapping to hn(4) for non-transparent mode VF.
    - Don't setup mbuf hash, if 'options RSS' is set.
      In Azure, when VF is activated, TCP SYN and SYN|ACK go through hn(4)
      while the rest of segments and ACKs belonging to the same TCP 4-tuple
      go through the VF.  So don't setup mbuf hash, if a VF is activated
      and 'options RSS' is not enabled.  hn(4) and the VF may use neither
      the same RSS hash key nor the same RSS hash function, so the hash
      value for packets belonging to the same flow could be different!
    - Disable LRO.
      hn(4) will only receive broadcast packets, multicast packets, TCP
      SYN and SYN|ACK (in Azure), LRO is useless for these packet types.
      For non-transparent, we definitely _cannot_ enable LRO at all, since
      the LRO flush will use hn(4) as the receiving interface; i.e.
      hn_ifp->if_input(hn_ifp, m).

    While I'm here, remove unapplied comment and minor style change.

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

322486
    hyperv/hn: Minor cleanup

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

322487
    hyperv/hn: Re-set datapath after synthetic parts reattached.

    Do this even for non-transparent mode VF. Better safe than sorry.

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

Approved by: re (delphij)

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

6 years agoSwitch the pkg(8) configuration for the default installation and the
marius [Sun, 20 Aug 2017 21:21:46 +0000 (21:21 +0000)]
Switch the pkg(8) configuration for the default installation and the
dvd1.iso to use the quarterly set, i. e. 2017Q3, during the 10.4-BETA
phase.

Approved by: re (implicit)

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

6 years agoMFC r322527:
delphij [Sun, 20 Aug 2017 19:21:06 +0000 (19:21 +0000)]
MFC r322527:

Plug memory leak in arge_encap().

Reported by: Ilja Van Sprundel <ivansprundel ioactive.com>
Submitted by: Domagoj Stolfa <domagoj.stolfa gmail.com>
Reviewed by: adrian
Approved by: re (kib)

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

6 years agoMFC: r266470, r273546, r276017, r277932, r279153, r279778, r279780, r278797,
marius [Sun, 20 Aug 2017 16:52:27 +0000 (16:52 +0000)]
MFC: r266470, r273546, r276017, r277932, r279153, r279778, r279780, r278797,
     r278861, r280283, r280284, r280294, r280452, r280558, r280571, r281863,
     r282049, r282357, r282440, r282441, r282358, r282359, r283550, r283918,
     r290171, r290667, r290381, r290533, r290666, r292483, r295659, r297545,
     r298305, r298383, r298428, r306489, r306557, r307067, r307068, r307087,
     r307088, r307089, r307091, r307092, r307093, r307098, r307115, r307154,
     r307240, r307241, r315967, r316476

Unbreak BCM2835/RPI-B support by bringing it in line with stable/11 and
head:

- Optimise reading of pending interrupt registers.

- Fix a bug where some DTS layouts could cause the premature ending of the
  search (i.e. without returning any result) and you would end up with a
  random MAC address.

- Reduce the diff between head and arm_intrng with the bcm2835 interrupt
  controller.

- Allow the retrieving of the reserved pins state.

- Add support to the bcm2835 mailbox driver to work before interrupts are
  enabled. This will be needed to enable the power on devices early on in the
  boot process.

- Add support for enabling the USB on the Raspberry Pi boards when it hasn't
  been done by U-Boot. This allows the USB to work when we load the kernel
  directly.

- Call config_intrhook_disestablish on failure of the bcm2835 fb and fbd intr
  hooks. With this we can get through the boot even if these functions fail.

- Add the structures needed to get/set the power state. These can be used
  when, for example, we boot without U-Boot and wish to enable USB, or to
  suspend an unneeded device.

- Add a mask to match only the relative base address of BSC controllers.

- Move the code to set the device power to the bcm2835 mailbox driver so it
  can be reused by other drivers.

- Add the SOC_BCM2835 and SOC_BCM2836 options for the arm kernel and add the
  former to std.bcm2835.

- Add a helper function to read clock frequencies from videocore and use this
  to get the default frequency of the sdhci device.

- Add partial support for the Raspberry Pi 2.

- Remove a debug #error from the bcm2835 sdhci driver.

- Fetch the SDHCI frequency from videocore (our prefered source) and only if
  it fails, fetch the clock-frequency from DTB. If both methods fail, use the
  hardcoded default.

- Pass the supplied buffer length instead of a fixed size.

- Add the routines to query and setup the framebuffer state using the
  BCM2835_MBOX_CHAN_PROP channel.  The old channel (BCM2835_MBOX_CHAN_FB)
  seems deprecated on recent firmware versions and is causing a freeze on
  RPi 2.

- Fix DMA on RPi 2. BCM2836 has a different base address for peripherals.

- Enable DMA for sdhci on RPi 2 (BCM2836).

- Add a missing wakeup when releasing ownership of the SPI hardware.

- Fix framebuffer compatibility with new RPi firmware.

- Refactor bcm2835_cpufreq to use bcm2835_mbox_property API.

- Fix the sc(4) framebuffer driver on RPi 2.

- Fix the vt(4) framebuffer driver on RPi 2.

- Remove unused mutex and softc variables.

- Refactor mailbox property API to make it usable for /dev/vcio driver.

- Replace semaphore-base locking with sleep/wait synchronization.

- Fix infinite loop if response from VideoCore never received.

- Set have_message in interrupt to handle "response before READ" case.

- Serialize access to property channel when using bcm2835_mbox_property.

- Force framebuffer virtual viewport to be the same as physical.

- Use proper type of tag in bcm2835_mbox_fb_init.

- bcm2835_cpufreq: Only attach driver if we correcly match on the machine
  compatible string.

- Add dev.fb.X.resync sysctl to resync ARM framebuffer with VideoCore.

- Do not use DMA channels used by GPU.

- Define local-intc for BCM2836 platform (RPI2) and make BCM2835 intc
  a child of it.

- Fix build for Pi kernels with syscons enabled.

- Use VM_MEMATTR_WRITE_COMBINING memattr for mmap(2) on framebuffer.

- Make intc driver compatible with upstream DTS.

- Make Rapsberry Pi watchdog driver compatible with upstream DTS.

- Make sure intc is attached before interrupt consumers.

- Make framebuffer driver compatible with upstream DT.

- Add one more heuristic to determine MAC address of the SMSC device.

- Add compatibility strings from upstream DT.

- Fix spelling mistake, BCM2835_PASWORD -> BCM2835_PASSWORD.

Approved by: re (kib)

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

6 years agoCreate hard links to the installed dtb files for the BEAGLEBONE [1]
gjb [Fri, 18 Aug 2017 16:43:59 +0000 (16:43 +0000)]
Create hard links to the installed dtb files for the BEAGLEBONE [1]
and WANDBOARD [2] images to fix a boot issue.

This is a direct commit to stable/10, as the change is not needed
for head and stable/11.

Approved by: re (marius)
Help from: manu [1], ian [2]
Tested by: gjb [1], ian [2]
Sponsored by: The FreeBSD Foundation

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

6 years agoMFC r321502, r321714, r321733, r321737, r321799, r322364:
ken [Fri, 18 Aug 2017 15:38:08 +0000 (15:38 +0000)]
MFC r321502, r321714, r321733, r321737, r321799, r322364:

  ------------------------------------------------------------------------
  r321502 | scottl | 2017-07-25 19:48:13 -0600 (Tue, 25 Jul 2017) | 2 lines

  Quiet a message that sounds far more dire than it really is.

  ------------------------------------------------------------------------
  r321714 | scottl | 2017-07-30 00:53:58 -0600 (Sun, 30 Jul 2017) | 13 lines

      Split the interrupt setup code into two parts: allocation and configuration.
      Do the allocation before requesting the IOCFacts message.  This triggers
      the LSI firmware to recognize the multiqueue should be enabled if available.
      Multiqueue isn't used by the driver yet, but this also fixes a problem with
      the cached IOCFacts not matching latter checks, leading to potential problems
      with error recovery.

      As a side-effect, fetch the driver tunables as early as possible.

  Reviewed by: slm
  Obtained from: Netflix
  Differential Revision: D9243

  ------------------------------------------------------------------------
  r321733 | scottl | 2017-07-30 16:34:24 -0600 (Sun, 30 Jul 2017) | 5 lines

  Change from using underbar function names to normal function names for
  the informational print functions.  Collapse the debug API a bit to be
  more generic and not require as much code duplication.  While here, fix
  a bug in MPS that was already fixed in MPR.

  ------------------------------------------------------------------------
  r321737 | scottl | 2017-07-30 18:05:49 -0600 (Sun, 30 Jul 2017) | 3 lines

      Don't re-parse PCI IDs in order to set card-specific flags, use
      the flags field in the PCIID table.

  ------------------------------------------------------------------------
  r321799 | scottl | 2017-07-31 10:55:56 -0600 (Mon, 31 Jul 2017) | 4 lines

  Fix a logic bug in the split PCI interrupt code that slipped through

  Reported by: Harry Schmalzbauer

  ------------------------------------------------------------------------
  r322364 | ken | 2017-08-10 08:59:17 -0600 (Thu, 10 Aug 2017) | 39 lines

  Changes to make mps(4) and mpr(4) handle reinit with reallocation.

  When the mps(4) and mpr(4) drivers need to reinitialize the
  firmware, they sometimes need to reallocate all of the memory
  allocated by the driver.  The reallocation happens whenever the IOC
  Facts change.  That should only happen after a firmware upgrade.

  If the reinitialization happens as a result of a timed out command
  sent to the card, the command that timed out and triggered the
  reinit may have been freed if iocfacts_allocate() reallocated all
  memory.  If the caller attempts to access the command after that,
  the kernel will panic because the caller will be dereferencing
  freed memory.

  The solution is to set a flag in the softc when we reallocate,
  and avoid dereferencing the command strucure if we've reallocated.

  The changes are largely the same in both drivers, since mpr(4) is a
  derivative of mps(4).

   o In iocfacts_allocate(), if the IOC Facts have changed and we
     need to reallocate, set the REALLOCATED flag in the softc.

   o Change wait_command() to take a struct mps_command ** instead of
     a struct mps_command *.  This allows us to NULL out the caller's
     command pointer if we have to reinit the controller and the data
     structures get reallocated.  (The REALLOCATED flag will be set
     in the softc if that has happened.)

   o In every place that calls wait_command(), make sure we handle
     the case where the command is NULL after the call.

   o The mpr(4) driver has mpr_request_polled() which can also
     reinitialize the card.  Also check for reallocation there.

  Reviewed by: scottl, slm
  Sponsored by: Spectra Logic

  ------------------------------------------------------------------------

Approved by: re (marius)

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

6 years agoMFC r322550:
kib [Fri, 18 Aug 2017 11:22:49 +0000 (11:22 +0000)]
MFC r322550:
Typo, the '-6' option selects inet6.

Approved by: re (delphij)

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

6 years agoUpdate stable/10 to BETA1 in preparation for 10.4-BETA1 builds.
marius [Fri, 18 Aug 2017 00:11:02 +0000 (00:11 +0000)]
Update stable/10 to BETA1 in preparation for 10.4-BETA1 builds.

Approved by: re (implicit)

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

6 years agoMFC r322493:
kib [Thu, 17 Aug 2017 11:36:39 +0000 (11:36 +0000)]
MFC r322493:
Remove confusion in the line explaining syntax of the msr read.
Specify words order in the display.

Approved by: re (marius)

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

6 years agoCorrect compile error triggered in nanobsd i386 by 322513 (MFC of 322178)
mckusick [Wed, 16 Aug 2017 05:51:05 +0000 (05:51 +0000)]
Correct compile error triggered in nanobsd i386 by 322513 (MFC of 322178)

Reported by: Li-Wen Hsu
Fix by: kib
Approved by: re (delphij)

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

6 years agoMFC r322256:
kib [Tue, 15 Aug 2017 14:21:44 +0000 (14:21 +0000)]
MFC r322256:
Fix logic error in the the assert, causing the condition to be always true.

PR: 217741
Approved by: re (gjb)

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

6 years agoDocument r322244, pci_vendors version 2017.07.27.
gjb [Tue, 15 Aug 2017 14:02:57 +0000 (14:02 +0000)]
Document r322244, pci_vendors version 2017.07.27.

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

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

6 years agoMFC r322250:
hselasky [Tue, 15 Aug 2017 13:37:04 +0000 (13:37 +0000)]
MFC r322250:
Count drop events due to lack of PCI bandwidth as queue drops and not as
input errors in the mlx5en(4) driver. This improves the sysadmin view of
physical port errors.

Approved by: re (kib)
Submitted by: gallatin@
Sponsored by: Mellanox Technologies

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

6 years agoMFC r322251:
hselasky [Tue, 15 Aug 2017 12:54:19 +0000 (12:54 +0000)]
MFC r322251:
Make sure the received IP header gets 32-bit aligned for short packets
in the mlx5en(4) driver.

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

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

6 years agoMFC r322113:
cy [Tue, 15 Aug 2017 12:26:43 +0000 (12:26 +0000)]
MFC r322113:

Remove dead target introduced in r178828.

Approved by: re (marius)

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

6 years agoMFC r322248:
hselasky [Tue, 15 Aug 2017 09:21:46 +0000 (09:21 +0000)]
MFC r322248:
Fix for mlx4en(4) to properly call m_defrag().

The m_defrag() function can only defrag mbuf chains which have a valid
mbuf packet header. In r291699 when the mlx4en(4) driver was converted
into using BUSDMA(9), the call to m_defrag() was moved after the part
of the transmit routine which strips the header from the mbuf chain.
This effectivly disabled the mbuf defrag mechanism and such packets
simply got dropped.

This patch removes the stripping of mbufs from a chain and loads all
mbufs using busdma. If busdma finds there are no segments, unload
the DMA map and free the mbuf right away, because that means all
data in the mbuf has been inlined in the TX ring. Else proceed
as usual.

Add a per-ring rounter for the number of defrag attempts and
make sure the oversized_packets counter gets zeroed while at it.

The counters are per-ring to avoid excessive cache misses in the
TX path.

Approved by: re (kib)
Submitted by: mjoras@
Differential Revision: https://reviews.freebsd.org/D11683
Sponsored by: Mellanox Technologies

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

6 years agoMFC: r322323
jkim [Mon, 14 Aug 2017 23:46:10 +0000 (23:46 +0000)]
MFC: r322323

Split identify_cpu() into two functions for amd64 as we do for i386.  This
fixes a regression introduced in r322205.

Approved by: re (marius)

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

6 years agoMFC of 322178:
mckusick [Mon, 14 Aug 2017 19:12:51 +0000 (19:12 +0000)]
MFC of 322178:

Bug 198500 reports bad sysctl values for gjournal cache limit.

PR: 198500
Submitted by: Dr. Andreas Longwitz <longwitz@incore.de>
Reported by: Eugene Grosbein
Discussed with: kib
Approved by: re (marius)

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

6 years agoMFC r322306:
hselasky [Mon, 14 Aug 2017 13:42:36 +0000 (13:42 +0000)]
MFC r322306:
Print maximum MTU when trying to set invalid MTU in the mlx4en(4) driver.
Useful for debugging.

Approved by: re (marius, gjb)
Submitted by: Sepherosa Ziehau <sephe@dragonflybsd.org>
Sponsored by: Mellanox Technologies

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

6 years agoMFC r322304:
hselasky [Mon, 14 Aug 2017 13:28:40 +0000 (13:28 +0000)]
MFC r322304:
Add support for RX and TX statistics when the mlx4en(4) PCI device
is in VF or SRIOV mode typically in a virtual machine environment.

Approved by: re (kib)
Submitted by: Sepherosa Ziehau <sephe@dragonflybsd.org>
Sponsored by: Mellanox Technologies

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

6 years agoMFC r314878:
hselasky [Mon, 14 Aug 2017 12:59:14 +0000 (12:59 +0000)]
MFC r314878:
Add support for constant pointer constructs to READ_ONCE() in the
LinuxKPI. When the type of the argument is constant the temporary
variable cannot be assigned after the barrier. Instead assign the
temporary variable by initialization.

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

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

6 years agoMFC r322124:
avos [Sun, 13 Aug 2017 17:30:03 +0000 (17:30 +0000)]
MFC r322124:
rfcomm_pppd.8: fix a typo (SPD -> SDP).

Approved by: re (marius)

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

6 years agoMFC r317244:
tuexen [Sun, 13 Aug 2017 07:40:05 +0000 (07:40 +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.

Approved by: re (kib)

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

6 years agoMFC r322059:
kib [Fri, 11 Aug 2017 11:38:04 +0000 (11:38 +0000)]
MFC r322059:
Fix off by one in calculation of the number of buckets for the pc
addresses.

Approved by: re (marius)

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

6 years agoMFC: r322209
marius [Fri, 11 Aug 2017 00:41:43 +0000 (00:41 +0000)]
MFC: r322209

- If available, use TRIM instead of ERASE for implementing BIO_DELETE.
  This also involves adding a quirk table as TRIM is broken for some
  Kingston eMMC devices, though. Compared to ERASE (declared "legacy"
  in the eMMC specification v5.1), TRIM has the advantage of operating
  on write sectors rather than on erase sectors, which typically are
  of a much larger size. Thus, employing TRIM, we don't need to fiddle
  with coalescing BIO_DELETE requests that are also of (write) sector
  units into erase sectors, which might not even add up in all cases.
- For some SanDisk iNAND devices, the CMD38 argument, e. g. ERASE,
  TRIM etc., has to be specified via EXT_CSD[113], which now is also
  handled via a quirk.
- My initial understanding was that for eMMC partitions, the granularity
  should be used as erase sector size, e. g. 128 KB for boot partitions.
  However, rereading the relevant parts of the eMMC specification v5.1,
  this isn't actually correct. So drop the code which used partition
  granularities for delmaxsize and stripesize. For the most part, this
  change is a NOP, though, because a) for ERASE, mmcsd_delete() used
  the erase sector size unconditionally for all partitions anyway and
  b) g_disk_limit() doesn't actually take the stripesize into account.
- Take some more advantage of mmcsd_errmsg() in mmcsd(4) for making
  error codes human readable.

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

6 years agoMFC: r322097, r322203
marius [Thu, 10 Aug 2017 21:39:22 +0000 (21:39 +0000)]
MFC: r322097, r322203

- Since r301131 (MFCed to stable/10 in r321895), /etc/localtime is also
  installed when selecting UTC in interactive configurations. Thus, the
  code added in r220172 which treats a NULL zone file name as UTC and
  removes /etc/localtime in that case can go again.
- Consistently refer to "could not delete" (as chosen by the oldest such
  code in here) when unlink(2) fails instead of a to mixture of "delete"
  and "unlink" in error messages.

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

6 years agoMFC r320991, r322016:
ken [Thu, 10 Aug 2017 15:34:50 +0000 (15:34 +0000)]
MFC r320991, r322016:

  ------------------------------------------------------------------------
  r320991 | ken | 2017-07-14 10:45:46 -0600 (Fri, 14 Jul 2017) | 17 lines

  Add IBM TS1155 density codes to libmt and the mt(1) man page.

  These are taken directly from the density report from a TS1155
  tape drive.  (Using mt getdensity)

  lib/libmt/mtlib.c:
   Add 3592B5 encrypted/unencrypted density codes, and bpmm/bpi
   values.  The bpmm/bpi values are the same as TS1150, but
   there are 50% more tracks.

  usr.bin/mt/mt.1:
   Add 3592B5 encrypted/unencrypted density codes, bpmm/bpi
   values and number of tracks.  Bump the man page date.

  Sponsored by: Spectra Logic

  ------------------------------------------------------------------------
  r322016 | ken | 2017-08-03 09:04:54 -0600 (Thu, 03 Aug 2017) | 6 lines

  Oracle T10000 tape drives use PRML encoding.

  Source:   Oracle T10000 SCSI reference guide.
  Sponsored by: Spectra Logic

  ------------------------------------------------------------------------

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

6 years agoApply upstream fix:
delphij [Thu, 10 Aug 2017 06:36:37 +0000 (06:36 +0000)]
Apply upstream fix:

Skip passwords longer than 1k in length so clients can't
easily DoS sshd by sending very long passwords, causing it to spend CPU
hashing them. feedback djm@, ok markus@.

Brought to our attention by tomas.kuthan at oracle.com, shilei-c at
360.cn and coredump at autistici.org

Security: CVE-2016-6515
Security: FreeBSD-SA-17:06.openssh

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

6 years agoMFC r317208:
tuexen [Wed, 9 Aug 2017 13:26:12 +0000 (13:26 +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

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

6 years agoRevise entry for r320646, rwho/rwhod/ruptime are not part of rcmds.
gjb [Wed, 9 Aug 2017 12:45:49 +0000 (12:45 +0000)]
Revise entry for r320646, rwho/rwhod/ruptime are not part of rcmds.
Fix line wrapping.

Sponsored by: The FreeBSD Foundation

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

6 years agoDocument r321964, bmake 20170720.
gjb [Wed, 9 Aug 2017 12:45:48 +0000 (12:45 +0000)]
Document r321964, bmake 20170720.

Sponsored by: The FreeBSD Foundation

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

6 years agoMFC r321919:
kib [Wed, 9 Aug 2017 09:16:16 +0000 (09:16 +0000)]
MFC r321919:
Do not call trapsignal() after handling usermode fault or interrupt,
when a signal is not intended to be sent.

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

6 years agoMFC r321812:
bapt [Tue, 8 Aug 2017 11:25:09 +0000 (11:25 +0000)]
MFC r321812:

Update pci_vendors to 2017.07.27

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

6 years agoMFC 321858: Add alternate Turkish keyboard layout F, submitted by Ufur Guler.
se [Tue, 8 Aug 2017 10:45:22 +0000 (10:45 +0000)]
MFC 321858: Add alternate Turkish keyboard layout F, submitted by Ufur Guler.
MFC 321859: While here, adjust a few file and path names in comments.

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

6 years agoMFC: r322076
jkim [Mon, 7 Aug 2017 22:30:18 +0000 (22:30 +0000)]
MFC: r322076

Detect hypervisor early so that we set lower hz on it.
> Description of fields to fill in above:                     76 columns --|
> PR:                       If and which Problem Report is related.
> Submitted by:             If someone else sent in the change.
> Reported by:              If someone else reported the issue.
> Reviewed by:              If someone else reviewed your modification.
> Approved by:              If you needed approval for this commit.
> Obtained from:            If the change is from a third party.
> MFC after:                N [day[s]|week[s]|month[s]].  Request a reminder email.
> MFH:                      Ports tree branch name.  Request approval for merge.
> Relnotes:                 Set to 'yes' for mention in release notes.
> Security:                 Vulnerability reference (one per line) or description.
> Sponsored by:             If the change was sponsored by an organization.
> Differential Revision:    https://reviews.freebsd.org/D### (*full* phabric URL needed).
> Empty fields above will be automatically removed.

_M   .
M    sys/amd64/amd64/machdep.c
M    sys/amd64/include/md_var.h
M    sys/i386/i386/machdep.c
M    sys/i386/include/md_var.h
M    sys/x86/x86/identcpu.c

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

6 years agoRemove r321216 entry, part of which was reverted.
gjb [Mon, 7 Aug 2017 19:45:33 +0000 (19:45 +0000)]
Remove r321216 entry, part of which was reverted.

Sponsored by: The FreeBSD Foundation

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

6 years agoDocument r321067, arcmsr(4) driver version 1.40.00.00.
gjb [Mon, 7 Aug 2017 19:45:32 +0000 (19:45 +0000)]
Document r321067, arcmsr(4) driver version 1.40.00.00.

Sponsored by: The FreeBSD Foundation

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

6 years agoDocument r320824, gdb(1)/kgdb(1) deprecation.
gjb [Mon, 7 Aug 2017 19:45:31 +0000 (19:45 +0000)]
Document r320824, gdb(1)/kgdb(1) deprecation.

Sponsored by: The FreeBSD Foundation

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

6 years agoDocument r320646, rcmds deprecation.
gjb [Mon, 7 Aug 2017 19:45:30 +0000 (19:45 +0000)]
Document r320646, rcmds deprecation.

Sponsored by: The FreeBSD Foundation

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

6 years agoDocument r321024, kern.features.linux{,64} addition.
gjb [Mon, 7 Aug 2017 19:45:29 +0000 (19:45 +0000)]
Document r321024, kern.features.linux{,64} addition.

Sponsored by: The FreeBSD Foundation

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

6 years agoDocument r321031, NFS 'pNFS commit' support.
gjb [Mon, 7 Aug 2017 19:45:29 +0000 (19:45 +0000)]
Document r321031, NFS 'pNFS commit' support.

Sponsored by: The FreeBSD Foundation

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

6 years agoDocument r321198, vt(4) maximum framebuffer increase.
gjb [Mon, 7 Aug 2017 19:45:28 +0000 (19:45 +0000)]
Document r321198, vt(4) maximum framebuffer increase.

Sponsored by: The FreeBSD Foundation

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

6 years agoDocument r321202, default EFI partition size increase.
gjb [Mon, 7 Aug 2017 19:45:27 +0000 (19:45 +0000)]
Document r321202, default EFI partition size increase.

Sponsored by: The FreeBSD Foundation

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

6 years agoDocument r321216, savecore(8) unit change.
gjb [Mon, 7 Aug 2017 19:45:26 +0000 (19:45 +0000)]
Document r321216, savecore(8) unit change.

Sponsored by: The FreeBSD Foundation

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

6 years agoMove the r321263 entry to 'userland-programs' for consistency.
gjb [Mon, 7 Aug 2017 19:45:25 +0000 (19:45 +0000)]
Move the r321263 entry to 'userland-programs' for consistency.

Sponsored by: The FreeBSD Foundation

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

6 years agoDocument r321234, syslogd(8) 'syslogd.d' directories.
gjb [Mon, 7 Aug 2017 19:45:24 +0000 (19:45 +0000)]
Document r321234, syslogd(8) 'syslogd.d' directories.

Sponsored by: The FreeBSD Foundation

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

6 years agoDocument r321242, cron(8) 'cron.d' directories.
gjb [Mon, 7 Aug 2017 19:45:24 +0000 (19:45 +0000)]
Document r321242, cron(8) 'cron.d' directories.

Sponsored by: The FreeBSD Foundation

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

6 years agoDocument r321263, newsyslog(8) RFC5424 logging format.
gjb [Mon, 7 Aug 2017 19:45:23 +0000 (19:45 +0000)]
Document r321263, newsyslog(8) RFC5424 logging format.

Sponsored by: The FreeBSD Foundation

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

6 years agoDocument r321304, libarchive 3.3.2.
gjb [Mon, 7 Aug 2017 19:45:13 +0000 (19:45 +0000)]
Document r321304, libarchive 3.3.2.

Sponsored by: The FreeBSD Foundation

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

6 years agoMFC r321782:
hselasky [Mon, 7 Aug 2017 13:25:57 +0000 (13:25 +0000)]
MFC r321782:
Remove some dead statistics related code and a structure field from the
mlx4en driver which is used by its Linux counterpart, but not under
FreeBSD.

Sponsored by: Mellanox Technologies

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

6 years agoMFC r321772:
hselasky [Mon, 7 Aug 2017 13:16:38 +0000 (13:16 +0000)]
MFC r321772:
Fix broken usage of the mlx4_read_clock() function:
 - return value has too small width
 - cycle_t is unsigned and cannot be less than zero

Sponsored by: Mellanox Technologies

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

6 years agoMFC r321780:
hselasky [Mon, 7 Aug 2017 13:06:03 +0000 (13:06 +0000)]
MFC r321780:
Make sure on-stack buffer is properly aligned.

Sponsored by: Mellanox Technologies

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

6 years agoMFC r321986:
hselasky [Mon, 7 Aug 2017 12:58:31 +0000 (12:58 +0000)]
MFC r321986:
Change reject message type when destroying cm_id in ibore.

This patch fixes an interopability issue between FreeBSD and non-FreeBSD
systems when the connection establishment is aborted. Refer to the
initial commit in Linux, drivers/infiniband/core/cm.c,
for a more detailed description.

Obtained from: Linux
Sponsored by: Mellanox Technologies

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

6 years agoMFC r321985:
hselasky [Mon, 7 Aug 2017 12:53:10 +0000 (12:53 +0000)]
MFC r321985:
Ticks are 32-bit in FreeBSD.

Sponsored by: Mellanox Technologies

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

6 years agoMFC r312882, r321983 and r321984:
hselasky [Mon, 7 Aug 2017 12:49:30 +0000 (12:49 +0000)]
MFC r312882, r321983 and r321984:
Use the busdma API to allocate all DMA-able memory.

The MLX5 driver has four different types of DMA allocations which are
now allocated using busdma:

1) The 4K firmware DMA-able blocks. One busdma object per 4K allocation.
2) Data for firmware commands use the 4K firmware blocks split into four 1K blocks.
3) The 4K firmware blocks are also used for doorbell pages.
4) The RQ-, SQ- and CQ- DMA rings. One busdma object per allocation.

After this patch the mlx5en driver can be used with DMAR enabled in
the FreeBSD kernel.

Sponsored by: Mellanox Technologies

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

6 years agoMFC r312881:
hselasky [Mon, 7 Aug 2017 12:45:26 +0000 (12:45 +0000)]
MFC r312881:
Add support for device surprise removal and other PCI errors.

- When device disappears from PCI indicate error device state and:
  1) Trigger command completion for all pending commands
  2) Prevent new commands from executing and return:
     - success for modify and remove/cleanup commands
     - failure for create/query commands
  3) When reclaiming pages for a device in error state don't ask FW to
     return all given pages, just release the allocated memory

Sponsored by: Mellanox Technologies

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

6 years agoMFC r312879:
hselasky [Mon, 7 Aug 2017 12:42:28 +0000 (12:42 +0000)]
MFC r312879:
Rename struct fw_page into struct mlx5_fw_page as a preparation step
for adding busdma support.

Sponsored by: Mellanox Technologies

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

6 years agoMFC r312880:
hselasky [Mon, 7 Aug 2017 12:38:04 +0000 (12:38 +0000)]
MFC r312880:
Wait for all VFs pages to be reclaimed before closing EQ pages.

Sponsored by: Mellanox Technologies

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

6 years agoMFC r312875:
hselasky [Mon, 7 Aug 2017 12:34:34 +0000 (12:34 +0000)]
MFC r312875:
Make fw_pages statistics counter 64-bit to avoid overflow.

Sponsored by: Mellanox Technologies

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

6 years agoMFC r312877 and r312878:
hselasky [Mon, 7 Aug 2017 12:29:41 +0000 (12:29 +0000)]
MFC r312877 and r312878:
Minor code refactor as a preparation step for suprise removal of CX-4
PCI device(s), changes:
- alloc_entry() now clears bit for page slot entry aswell
- update of cmd->ent_arr[] is now under cmd->alloc_lock
- complete command if alloc_entry() fails

Sponsored by: Mellanox Technologies

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

6 years agoMFC r321794: Improve FHA locality control for NFS read/write requests.
mav [Mon, 7 Aug 2017 07:40:00 +0000 (07:40 +0000)]
MFC r321794: Improve FHA locality control for NFS read/write requests.

This change adds two new tunables, allowing to control serialization for
read and write NFS requests separately.  It does not change the default
behavior since there are too many factors to consider, but gives additional
space for further experiments and tuning.

The main motivation for this change is very low write speed in case of ZFS
with sync=always or when NFS clients requests sychronous operation, when
every separate request has to be written/flushed to ZIL, and requests are
processed one at a time.  Setting vfs.nfsd.fha.write=0 in that case allows
to increase ZIL throughput by several times by coalescing writes and cache
flushes.  There is a worry that doing it may increase data fragmentation
on disks, but I suppose it should not happen for pool with SLOG.

Sponsored by: iXsystems, Inc.

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

6 years agoMFC 321965
sephe [Mon, 7 Aug 2017 02:33:22 +0000 (02:33 +0000)]
MFC 321965
    hyperv/kvp: Use proper size macro for adapter id.

    Submitted by:   Christopher Ertl <Christopher.Ertl microsoft com>
    Sponsored by:   Microsoft

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