]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/log
FreeBSD/stable/10.git
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

6 years agoMFC r321816:
mckusick [Mon, 7 Aug 2017 02:29:09 +0000 (02:29 +0000)]
MFC r321816:
Avoid reading a snapshot block when it is already in the cache.

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

6 years agoMFC 321836,321837
sephe [Mon, 7 Aug 2017 02:23:34 +0000 (02:23 +0000)]
MFC 321836,321837

321836
    hyperv/hn: Renaming and minor cleanup

    This prepares for the upcoming transparent VF support.

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

321837
    hyperv/hn: Add comment about ether_ifattach event subscription.

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

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

6 years agoMFC 321762
sephe [Mon, 7 Aug 2017 02:15:13 +0000 (02:15 +0000)]
MFC 321762
    hyperv: Add VF bringup scripts and devd rules.

    How network VF works with hn(4) on Hyper-V in non-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 up, e.g. ifconfig VF up:
      o  All of the transmission should go through the network VF.
      o  Most of the reception goes through the network VF.
      o  Small amount of reception may go through the cooresponding hn(4).
         This reception will happen, even if the the cooresponding hn(4) is
         down.  The cooresponding hn(4) will change the reception interface
         to the network VF, so that network layer and application layer will
         be tricked into thinking that these packets were received by the
         network VF.
      o  The cooresponding hn(4) pretends the physical link is down.
    - Once the network VF is down or detached:
      o  All of the transmission should go through the cooresponding hn(4).
      o  All of the reception goes through the cooresponding hn(4).
      o  The cooresponding hn(4) fallbacks to the original physical link
         detection logic.

    All these features are mainly used to help live migration, during which
    the network VF will be detached, while the network communication to the
    VM must not be cut off.  In order to reach this level of live migration
    transparency, we use failover mode lagg(4) with the network VF and the
    cooresponding hn(4) attached to it.

    To ease user configuration for both network VF and non-network VF, the
    lagg(4) will be created by the following rules, and the configuration
    of the cooresponding hn(4) will be applied to the lagg(4) automatically.

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

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

6 years agoMFC: r321589
marius [Sun, 6 Aug 2017 16:12:56 +0000 (16:12 +0000)]
MFC: r321589

- Check the slot type capability, set SDHCI_SLOT_{EMBEDDED,NON_REMOVABLE}
  for embedded slots. Fail in the sdhci(4) initialization for slot type
  shared, which is completely unsupported by this driver at the moment. [1]
  For Intel eMMC controllers, taking the embedded slot type into account
  obsoltes setting SDHCI_QUIRK_ALL_SLOTS_NON_REMOVABLE so remove these quirk
  entries.
- Hide the 1.8 V VDD capability when the slot is detected as non-embedded,
  as the SDHCI specification explicitly states that 1.8 V VDD is applicable
  to embedded slots only. [2]
- Define some easy bits of the SDHCI specification v4.20. [3]
- Don't leak bus_dma(9) resources in failure paths of sdhci_init_slot().

Obtained from: DragonFlyBSD 65704a46 [1], 7ba10b88 [2], 0df14648 [3]

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

6 years agoMFC: r319350, r320620, r321385, r321490, r321588, r321948
marius [Sun, 6 Aug 2017 16:07:34 +0000 (16:07 +0000)]
MFC: r319350, r320620, r321385, r321490, r321588, r321948

o Use SDHCI_CAN_DRIVE_TYPE_{A,C,D} to check for driver type support in
  SDHCI_CAPABILITIES2 instead of SDHCI_CTRL2_DRIVER_TYPE_{A,C,D} which
  are meant for setting the driver type in SDHCI_HOST_CONTROL2.

o Correct a typo in the comment part of r320577 (MFCed to stable/10 in
  r320899).

o Add support for eMMC HS200 and HS400 bus speed modes at 200 MHz to
  sdhci(4), mmc(4) and mmcsd(4).

  On the system where the addition of DDR52 support increased the read
  throughput to ~80 MB/s (from ~45 MB/s at high speed), HS200 yields
  ~154 MB/s and HS400 ~187 MB/s, i. e. performance now has more than
  quadrupled compared to pre-r315598 (pre-r318495 in stable/10).

  However, in fact this isn't a feature-only change; there are boards
  based on Intel Bay Trail where DDR52 is problematic and the suggested
  workaround is to use HS200 mode instead. So far exact details are
  unknown, however, i. e. whether that's due to a defect in these SoCs
  or on the boards.

  Moreover, due to the above changes requiring to be aware of possible
  MMC siblings in the fast path of mmc(4), corresponding information
  now is cached in mmc_softc. As a side-effect, mmc_calculate_clock(),
  now longer will trigger a panic in low memory situations and all of
  mmc(4) operate on the same set of child devices.

o Fix a bug in the failure reporting of mmcsd_delete() that could lead
  to a panic.

o Fix 2 bugs on resume, one in mmcsd(4) that could lead to a panic and
  another one in mmc(4) that could lead to devices no longer working.

o Fix a memory leak in mmcsd_ioctl() in case copyin(9) fails. [1]

o Fix missing variable initialization in mmc_switch_status(). [2]

o Fix R1_SWITCH_ERROR detection in mmc_switch_status(). [3]

o Handle the case of device_add_child(9) failing, for example due to
  a memory shortage, gracefully in mmc(4) and sdhci(4), including not
  leaking memory for the instance variables in case of mmc(4), also
  fixing [4].

o Correctly use the size of a pointer rather than that of a pointer to
  a pointer (this bug was present in head r321385 only, i. e. not in a
  stable branch). [5]

o Handle the case of an unknown SD CSD version in mmc_decode_csd_sd()
  gracefully instead of calling panic(9).

o Again, check and handle the return values of some additional function
  calls in mmc(4) instead of assuming that everything went right or mark
  non-fatal errors by casting the return value to void.

o Correct a typo in the Linux IOCTL compatibility; it should have been
  MMC_IOC_MULTI_CMD rather than MMC_IOC_CMD_MULTI.

o Now that we are reaching ever faster speeds (more improvement in this
  regard is to be expected when adding ADMA support to sdhci(4)), apply
  a few micro-optimizations to mmc(4), mmcsd(4) and sdhci(4).

o Correct confusing and error prone mix-ups between "br" or "bridge" in
  mmc(4) and mmcsd(4) where - according to the terminology outlined in
  comments of bridge.h and mmcbr_if.m around since their addition in
  r163516 - the bus is meant and used instead.

o Remove comment lines from bridge.h incorrectly suggesting that there
  would be a MMC bridge base class driver.

o Update comments in bridge.h regarding the star topology of SD and SDIO;
  since version 3.00 of the SDHCI specification, for eSD and eSDIO bus
  topologies are actually possible in form of so called "shared buses"
  (in some subcontext later on renamed to "embedded" buses).

Reported by: Coverity
CID: 1372612 [1], 1372624 [2], 1372594 [3], 1007069 [4],
1378432 [5]

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

6 years agoMFC r321720, r321856: Attach ichwd(4) only to ISA bus of the LPC bridge.
mav [Sun, 6 Aug 2017 08:15:21 +0000 (08:15 +0000)]
MFC r321720, r321856: Attach ichwd(4) only to ISA bus of the LPC bridge.

Resource allocation for parent device does not look good by itself, but
attempt to allocate them for unrelated device just does not end up good.
On Asus X99-E WS/USB3.1 system reporting ISA bridge via both PCI and ACPI
this reported to cause kernel panic on shutdown due to messed resources:
https://bugs.freenas.org/issues/25237.

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

6 years agoMFC r321915:
ngie [Sat, 5 Aug 2017 17:02:53 +0000 (17:02 +0000)]
MFC r321915:

Remove bogus bsd.subdir.mk .include

bsd.subdir.mk is included from bsd.obj.mk, which is included via bsd.lib.mk.

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

6 years agoRegenerate src.conf(5) per r322100
ngie [Sat, 5 Aug 2017 17:01:00 +0000 (17:01 +0000)]
Regenerate src.conf(5) per r322100

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

6 years agoMFC r320702,r320703:
ngie [Sat, 5 Aug 2017 16:55:07 +0000 (16:55 +0000)]
MFC r320702,r320703:

r320702:

Formalize LEAPSECONDS and OLDTIMEZONES in share/zoneinfo/... as
`MK_ZONEINFO_LEAPSECONDS_SUPPORT == yes` and
`MK_ZONEINFO_OLD_TIMEZONES_SUPPORT == yes`.

Keep `LEAPSECONDS` and `OLDTIMEZONES` for backwards compatibility,
but print out a warning notifying users that they should use the new
variables, in an effort to migrate them to the variables. This is being
done mostly for automated build tools, etc, that might rely on these
variables being set. The variables will be removed in the future on
^/head, e.g., after ^/stable/12 is cut.

Relnotes:       yes

r320703:

Add tests to help verify Links functionality for .../contrib/tzdata/backwards

MFC with: r320702

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

6 years agoFix a stable/10-specific mismerge in r322096; the MK_NCURSESW handling
marius [Sat, 5 Aug 2017 14:49:40 +0000 (14:49 +0000)]
Fix a stable/10-specific mismerge in r322096; the MK_NCURSESW handling
should be within the MK_DIALOG block as libncurses{,w} isn't required
when building tzsetup(8) without dialog(3) support.

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

6 years agoMFC: r274394, r274399, r307802
marius [Sat, 5 Aug 2017 12:54:07 +0000 (12:54 +0000)]
MFC: r274394, r274399, r307802

- Default `bsdconfig timezone' and `tzsetup' to `-s' in a VM.
- Hide dialog specific code behind HAVE_DIALOG. It allows to build a
  stripped down version (missing the dialog UI) but perfectly function
  tzsetup when world is built WITHOUT_DIALOG.

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

6 years agoRegenerate src.conf.5 after r322094.
marius [Sat, 5 Aug 2017 12:34:31 +0000 (12:34 +0000)]
Regenerate src.conf.5 after r322094.

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

6 years agoMFC: r306375
marius [Sat, 5 Aug 2017 12:33:00 +0000 (12:33 +0000)]
MFC: r306375

Add a WITHOUT_DIALOG src.conf(5) knob.

It also turns off dependencies (bsdinstall, bsdconfig, dpv, tzsetup).

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

6 years agoMFC r321685: Fix IORDY bits definition.
mav [Sat, 5 Aug 2017 08:37:38 +0000 (08:37 +0000)]
MFC r321685: Fix IORDY bits definition.

According to the ATA specs, IORDYDIS should be bit 10, IORDY -- bit 11.

PR:             221049
Submitted by:   aaron.styx@baesystems.com

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

6 years agoMFC r321921: Add compat shim part missed at r305197.
mav [Sat, 5 Aug 2017 08:36:04 +0000 (08:36 +0000)]
MFC r321921: Add compat shim part missed at r305197.

This fixes compatibility between old kernel and new ZFS tools.
It seems to be tradition to forget it.

PR: 221112

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

6 years agoMFH r321674:
mm [Fri, 4 Aug 2017 23:34:39 +0000 (23:34 +0000)]
MFH r321674:
Sync libarchive with vendor.

Relevant vendor changes:
  PR #926: ensure ar strtab is null terminated

PR: 220462

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

6 years agoMFC: r290156, r318354
marius [Fri, 4 Aug 2017 21:38:34 +0000 (21:38 +0000)]
MFC: r290156, r318354

pmap_change_attr: Only fixup DMAP for DMAPed ranges

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

6 years agoMFC r321838:
pfg [Fri, 4 Aug 2017 20:24:23 +0000 (20:24 +0000)]
MFC r321838:
sys/net8021: Add missing braces in setcurchan().

Also fix some indentation.

Obtained from: DragonFlyBSD (git c69e37d6)

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

6 years agoMFC r321349:
kib [Fri, 4 Aug 2017 08:27:34 +0000 (08:27 +0000)]
MFC r321349:
Improve publication of the newly allocated snapdata.

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

6 years agoMFC r321348:
kib [Fri, 4 Aug 2017 08:26:19 +0000 (08:26 +0000)]
MFC r321348:
Unlock correct lock in ffs_snapblkfree().

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

6 years agoMFC r321347:
kib [Fri, 4 Aug 2017 08:25:03 +0000 (08:25 +0000)]
MFC r321347:
Account for lock recursion when transfering snaplock to the vnode lock
in ffs_snapremove().

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

6 years agoMFC r321605:
cy [Thu, 3 Aug 2017 14:22:48 +0000 (14:22 +0000)]
MFC r321605:

As in r315225, discard 3072 bytes of RC4 bytestream instead of 1024.
(This implementation of arc4rand(9) is used by the userland ipftest
utility as it approximates ipfilter kernelspace in userspace.)

PR: 217920
Submitted by: codarren@hackers.mu
Reviewed by: emaste, cem
Approved by: so (implicit, in r315225)
Differential Revision: D11747
Patterned after: r315225

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

6 years agoMFC r312983:
hselasky [Thu, 3 Aug 2017 14:20:19 +0000 (14:20 +0000)]
MFC r312983:
Make "desc" pointer non-constant inside the mlx5_core_diagnostics_entry
structure. This fixes compilation with amd64-xtoolchain-gcc.

PR: 216588
Sponsored by: Mellanox Technologies

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

6 years agoMFC r312876:
hselasky [Thu, 3 Aug 2017 14:17:25 +0000 (14:17 +0000)]
MFC r312876:
Use ffs() to scan for first bit instead of using a for() loop.
Minor code refactor while at it.

Sponsored by: Mellanox Technologies

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

6 years agoMFC r312872:
hselasky [Thu, 3 Aug 2017 14:14:13 +0000 (14:14 +0000)]
MFC r312872:
Add support for reading advanced diagnostic counters.

By default reading the diagnostic counters is disabled. The firmware
decides which counters are supported and only those supported show up
in the dev.mce.X.diagnostics sysctl tree.

To enable reading of diagnostic counters set one or more of the
following sysctls to one:

dev.mce.X.conf.diag_general_enable=1
dev.mce.X.conf.diag_pci_enable=1

Sponsored by: Mellanox Technologies

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

6 years agoMFC r312865:
hselasky [Thu, 3 Aug 2017 14:09:36 +0000 (14:09 +0000)]
MFC r312865:
Enforce reading the consumer and producer counters once to ensure
consistent return values from the mlx5e_sq_has_room_for()
function. The two counters are incremented by different threads under
different locks.

Sponsored by: Mellanox Technologies

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

6 years agoMFC r312537:
hselasky [Thu, 3 Aug 2017 14:07:14 +0000 (14:07 +0000)]
MFC r312537:
Remove superfluous return statement.

Sponsored by: Mellanox Technologies

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

6 years agoMFC r312536:
hselasky [Thu, 3 Aug 2017 14:05:03 +0000 (14:05 +0000)]
MFC r312536:
Allow transmit packet bufring in software to be disabled.

- Add new sysctl node to control the transmit packet bufring.

- Add optimised version of the transmit routine which output packets
directly to the DMA ring instead of using bufring in case the transmit
lock is congested. This can reduce the number of taskswitches which in
turn influence the overall system CPU usage, depending on the
workload.

- Add " TX" suffix to debug name for transmit mutexes to silence some
witness warnings about aquiring duplicate locks having same name.

Sponsored by: Mellanox Technologies
Suggested by: gallatin @

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

6 years agoMFC r312528:
hselasky [Thu, 3 Aug 2017 14:01:25 +0000 (14:01 +0000)]
MFC r312528:
Make draining a sendqueue more robust.

Add own state variable to track if a sendqueue is stopped or not.
This will prevent traffic from entering the sendqueue while it is
being destroyed.

Update drain function to wait for traffic to be transmitted before
returning when the link state is active.

Add extra checks in transmit path for stopped SQ's.

While at it:
- Use likely() for a mbuf pointer check.
- Remove redundant IFF_DRV_RUNNING check.

Sponsored by: Mellanox Technologies

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

6 years agoMFC r312527:
hselasky [Thu, 3 Aug 2017 13:57:17 +0000 (13:57 +0000)]
MFC r312527:
Add runtime support for modifying the SQ and RQ completion event
moderation mode. The presence of this feature is indicated through the
firmware capabilities.

Sponsored by: Mellanox Technologies

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

6 years agoMFC r312526:
hselasky [Thu, 3 Aug 2017 13:52:39 +0000 (13:52 +0000)]
MFC r312526:
Update firmware interface structures and definitions adding support
for new features and commands.

Sponsored by: Mellanox Technologies

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