]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
6 years agoMFC 321762
sephe [Mon, 7 Aug 2017 02:49:26 +0000 (02:49 +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

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

6 years agoMFC: r321589
marius [Sun, 6 Aug 2017 16:12:46 +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]

6 years agoMFC: r319350, r321385, r321490, r321588, r321948
marius [Sun, 6 Aug 2017 16:07:25 +0000 (16:07 +0000)]
MFC: r319350, 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 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-r318494 in stable/11).

  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]

6 years agoMFC r321730:
kib [Sun, 6 Aug 2017 10:07:25 +0000 (10:07 +0000)]
MFC r321730:
Remove unused symbols.

6 years agoMFC r321720, r321856: Attach ichwd(4) only to ISA bus of the LPC bridge.
mav [Sun, 6 Aug 2017 08:14:46 +0000 (08:14 +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.

6 years agoMFC r321845:
ngie [Sat, 5 Aug 2017 17:11:40 +0000 (17:11 +0000)]
MFC r321845:

Standardize on SRCTOP instead of .CURDIR-relative paths

6 years agoMFC r321915:
ngie [Sat, 5 Aug 2017 17:02:57 +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.

6 years agoMFC r321951:
ngie [Sat, 5 Aug 2017 17:01:58 +0000 (17:01 +0000)]
MFC r321951:

Some minor doc fixups

- Tweak a sentence by placing the modifier before an adjective to make it flow
  better.
- Fix a typo.

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

6 years agoMFC r320702,r320703:
ngie [Sat, 5 Aug 2017 16:44:31 +0000 (16:44 +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

6 years agoMFC r321368:
trasz [Sat, 5 Aug 2017 09:48:58 +0000 (09:48 +0000)]
MFC r321368:

Use the "tree" word in ps(1) -d option description, to make it easier
to find.

6 years agoMFC r321329:
trasz [Sat, 5 Aug 2017 09:45:48 +0000 (09:45 +0000)]
MFC r321329:

Make truss(1) cross-reference dtrace(1) and bump .Dd.

6 years agoMFC r321328:
trasz [Sat, 5 Aug 2017 09:45:08 +0000 (09:45 +0000)]
MFC r321328:

Use more usual formatting for the EXAMPLES section of truss(1).

6 years agoMFC r321327:
trasz [Sat, 5 Aug 2017 09:44:21 +0000 (09:44 +0000)]
MFC r321327:

Use more usual formatting for the EXAMPLES section of ktrace(1).

6 years agoMFC r320671:
trasz [Sat, 5 Aug 2017 09:42:44 +0000 (09:42 +0000)]
MFC r320671:

Use more canonical .Dt for vt(4).

6 years agoMFC r319798:
trasz [Sat, 5 Aug 2017 09:40:56 +0000 (09:40 +0000)]
MFC r319798:

Switch the example name for variables controlling loading memory images
in /boot/defaults/loader.conf to something that's actually commonly used,
"mdroot".  It's arbitrary, but it's easier to find this way.

6 years agoMFC r319774:
trasz [Sat, 5 Aug 2017 09:40:04 +0000 (09:40 +0000)]
MFC r319774:

Improve formatting by removing yet another case of '-width ".Pa'.

6 years agoMFC r319775:
trasz [Sat, 5 Aug 2017 09:39:15 +0000 (09:39 +0000)]
MFC r319775:

/usr/share/doc/bind is gone since 20040925.

6 years agoMFC r319499:
trasz [Sat, 5 Aug 2017 09:38:15 +0000 (09:38 +0000)]
MFC r319499:

Consistently use lowercase hex numbers in ascii(7).

6 years agoMFC r318444:
trasz [Sat, 5 Aug 2017 09:34:09 +0000 (09:34 +0000)]
MFC r318444:

Fix typo.

6 years agoMFC r318182:
trasz [Sat, 5 Aug 2017 09:32:03 +0000 (09:32 +0000)]
MFC r318182:

Improve build(7): add missing "buildkernel" and "installkernel"
to the example, change the architectures to something more common,
and improve description of defaults for TARGET.

6 years agoMFC r321685: Fix IORDY bits definition.
mav [Sat, 5 Aug 2017 08:37:08 +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

6 years agoMFC r321921: Add compat shim part missed at r305197.
mav [Sat, 5 Aug 2017 08:35:13 +0000 (08:35 +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

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

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

PR: 220462

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

Also fix some indentation.

Obtained from: DragonFlyBSD (git c69e37d6)

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

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

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

6 years agoMFC r321652:
kib [Fri, 4 Aug 2017 08:12:19 +0000 (08:12 +0000)]
MFC r321652:
Simplify flow control.

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

6 years agoMFC r312983:
hselasky [Thu, 3 Aug 2017 14:19:26 +0000 (14:19 +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

6 years agoMFC r312876:
hselasky [Thu, 3 Aug 2017 14:16:31 +0000 (14:16 +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

6 years agoMFC r312872:
hselasky [Thu, 3 Aug 2017 14:12:23 +0000 (14:12 +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

6 years agoMFC r312865:
hselasky [Thu, 3 Aug 2017 14:08:37 +0000 (14:08 +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

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

Sponsored by: Mellanox Technologies

6 years agoMFC r312536:
hselasky [Thu, 3 Aug 2017 14:03:48 +0000 (14:03 +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 @

6 years agoMFC r312528:
hselasky [Thu, 3 Aug 2017 14:00:26 +0000 (14:00 +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

6 years agoMFC r312527:
hselasky [Thu, 3 Aug 2017 13:55:39 +0000 (13:55 +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

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

Sponsored by: Mellanox Technologies

6 years agoMFC r320773:
hselasky [Thu, 3 Aug 2017 13:45:26 +0000 (13:45 +0000)]
MFC r320773:
Implement fix for BULK IN-token retry mechanism. When the hardware is
programmed for infinite IN token retry after NAK, the SAF1761
hardware, however, does not retry the IN-token. This problem is
described in the SAF1761 errata, section 18.1.1.

While at it:
- Add some minor chip specific initialization for RTEMS.
- Add debug print for status registers in the interrupt filter.

Submitted by: Christian Mauderer <christian.mauderer@embedded-brains.de>

6 years agoMFC r321722:
hselasky [Thu, 3 Aug 2017 07:50:46 +0000 (07:50 +0000)]
MFC r321722:
Properly range check length of parsed information elements in RSU driver.

Found by: Ilja van Sprundel <ivansprundel@ioactive.com>
Sponsored by: Mellanox Technologies

6 years agoMFC r321627:
kib [Thu, 3 Aug 2017 07:30:35 +0000 (07:30 +0000)]
MFC r321627:
Make it possible to request nosys logging to console.

6 years agoMFC r321625:
kib [Thu, 3 Aug 2017 07:28:54 +0000 (07:28 +0000)]
MFC r321625:
Make the number of children for pctrie node available outside subr_pctrie.c.

6 years agoMFC r321606: adaasync(): Set ADA_STATE_WCACHE based on ADA_FLAG_CAN_WCACHE
mav [Thu, 3 Aug 2017 07:20:19 +0000 (07:20 +0000)]
MFC r321606: adaasync(): Set ADA_STATE_WCACHE based on ADA_FLAG_CAN_WCACHE

The attached patch lets adaasync() set ADA_STATE_WCACHE based on
ADA_FLAG_CAN_WCACHE instead of ADA_FLAG_CAN_RAHEAD.

This fixes a regression introduced in r300207 which changed
the flag names.

PR: 220948
Submitted by: Fabian Keil <fk@fabiankeil.de>
Obtained from: ElectroBSD

6 years agoMFC r321620: Fix singular/plural "users" output.
mav [Thu, 3 Aug 2017 07:17:41 +0000 (07:17 +0000)]
MFC r321620: Fix singular/plural "users" output.

It was broken during libxo'fication.

PR: 221039
Submitted by: timur@

6 years agoMFC r321622, r321623:
ken [Wed, 2 Aug 2017 20:24:26 +0000 (20:24 +0000)]
MFC r321622, r321623:

  ------------------------------------------------------------------------
  r321622 | ken | 2017-07-27 09:33:57 -0600 (Thu, 27 Jul 2017) | 44 lines

  Fix probing FC targets with hard addressing turned on.

  This largely reverts FreeBSD SVN change 289937 from October 25th, 2015.

  The intent of that change was to keep loop IDs persistent across
  chip reinits.

  The problem is that the change turned on the PREVLOOP /
  PREV_ADDRESS bit (bit 7 in Firmware Options 2), which tells the
  Qlogic chip to not participate in the loop if it can't get the
  requested loop address.  It also turned off soft addressing on 2400
  (4Gb) and newer controllers.

  The isp(4) driver defaults to loop address 0, and the tape drives
  I have tested default to loop address 0 if hard addressing is turned
  on.  So when hard loop addressing is turned on on the drive, the isp(4)
  driver just refuses to participate in the loop.

  The solution is to largely revert that change.  I left some elements
  in place that are related to virtual ports, since they were new.

  This does work with IBM tape drives with hard and soft addressing
  turned on.  I have tested it with 4Gb, 8Gb, and 16Gb controllers.

  sys/dev/isp.c:
   Largely revert FreeBSD SVN change 289937.  I left the
   ispmbox.h changes in place.

   Don't use the PREV_ADDRESS bit on initialization.  It tells
   the chip to not participate if it can't get the requested
   loop ID.

   Do use soft addressing on 2400 and newer chips.

   Use hard addressing when the user has requested a specific
   initiator ID.  (hint.isp.X.iid=N in /boot/loader.conf)

   Leave some of the virtual port options from that change in
   place, but don't turn on the PREV_ADDRESS bit.

  Reviewed by: mav
  Sponsored by: Spectra Logic

  ------------------------------------------------------------------------
  r321623 | ken | 2017-07-27 09:51:56 -0600 (Thu, 27 Jul 2017) | 6 lines

  Remove duplicate assignments from r321622.

  Submitted by: mav
  Sponsored by: Spectra Logic

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

6 years agoMerge r316113,316184,316413 from head:
gavin [Wed, 2 Aug 2017 15:11:06 +0000 (15:11 +0000)]
Merge r316113,316184,316413 from head:
 - Remove #define PCIS_SERIALBUS_SMBUS_PROGIF, unused since r200091
 - Switch device_probe() from large case statement to a lookup table
 - Add several missing SMBus controllers

6 years agoMFC r320730: Report device descr in addition to ident.
mav [Wed, 2 Aug 2017 14:45:58 +0000 (14:45 +0000)]
MFC r320730: Report device descr in addition to ident.

Serial number without device model is somewhat less useful.

6 years agoMFC r320683: Add naive benchmark for SSDs in ZFS SLOG role.
mav [Wed, 2 Aug 2017 14:45:22 +0000 (14:45 +0000)]
MFC r320683: Add naive benchmark for SSDs in ZFS SLOG role.

ZFS SLOGs have very specific access pattern with many cache flushes,
which none of benchmarks I know can simulate.  Since SSD vendors rarely
specify cache flush time, this measurement can be useful to explain why
some ZFS pools are slower then expected.  This test writes data chunks
of different size followed by cache flush, alike to what ZFS SLOG does,
and measures average time.

To illustrate, here is result for 6 years old SATA Intel 710 Series SSD:

Synchronous random writes:
         0.5 kbytes:    138.3 usec/IO =      3.5 Mbytes/s
           1 kbytes:    137.7 usec/IO =      7.1 Mbytes/s
           2 kbytes:    151.1 usec/IO =     12.9 Mbytes/s
           4 kbytes:    158.2 usec/IO =     24.7 Mbytes/s
           8 kbytes:    175.6 usec/IO =     44.5 Mbytes/s
          16 kbytes:    210.1 usec/IO =     74.4 Mbytes/s
          32 kbytes:    274.2 usec/IO =    114.0 Mbytes/s
          64 kbytes:    416.5 usec/IO =    150.1 Mbytes/s
         128 kbytes:    776.6 usec/IO =    161.0 Mbytes/s
         256 kbytes:   1503.1 usec/IO =    166.3 Mbytes/s
         512 kbytes:   2968.7 usec/IO =    168.4 Mbytes/s
        1024 kbytes:   5866.8 usec/IO =    170.5 Mbytes/s
        2048 kbytes:  11696.6 usec/IO =    171.0 Mbytes/s
        4096 kbytes:  23329.6 usec/IO =    171.5 Mbytes/s
        8192 kbytes:  46779.5 usec/IO =    171.0 Mbytes/s

, and much newer and supposedly much faster NVMe Samsung 950 PRO SSD:

Synchronous random writes:
         0.5 kbytes:   2092.9 usec/IO =      0.2 Mbytes/s
           1 kbytes:   2013.1 usec/IO =      0.5 Mbytes/s
           2 kbytes:   2014.8 usec/IO =      1.0 Mbytes/s
           4 kbytes:   2090.7 usec/IO =      1.9 Mbytes/s
           8 kbytes:   2044.5 usec/IO =      3.8 Mbytes/s
          16 kbytes:   2084.8 usec/IO =      7.5 Mbytes/s
          32 kbytes:   2137.1 usec/IO =     14.6 Mbytes/s
          64 kbytes:   2173.4 usec/IO =     28.8 Mbytes/s
         128 kbytes:   2923.9 usec/IO =     42.8 Mbytes/s
         256 kbytes:   3085.3 usec/IO =     81.0 Mbytes/s
         512 kbytes:   3112.2 usec/IO =    160.7 Mbytes/s
        1024 kbytes:   2430.6 usec/IO =    411.4 Mbytes/s
        2048 kbytes:   3788.9 usec/IO =    527.9 Mbytes/s
        4096 kbytes:   6198.0 usec/IO =    645.4 Mbytes/s
        8192 kbytes:  10764.9 usec/IO =    743.2 Mbytes/s

While the first one obviously has maximal throughput limitations, the
second one has so high cache flush latency (about 2 millisecond), that
it makes one almost useless in SLOG role, despite of its good throughput
numbers.  Power loss protection is out of scope of this test, but I
suspect it can be related.

6 years agoMFC r320555, r320576 (by allanjude):
mav [Wed, 2 Aug 2017 14:43:12 +0000 (14:43 +0000)]
MFC r320555, r320576 (by allanjude):
Add -s (serial) and -p (physpath) to diskinfo

Return the bare requested information, intended for scripting.

The serial number of a SAS/SCSI device can be returned with
'camcontrol inquiry disk -S', but there is no similar switch for SATA.

This provides a way to get this information from both SAS and SATA disks

the -s and -p flags are mutually exclusive, and cannot be used with any
other flags.

6 years agoMFC r321581:
kib [Wed, 2 Aug 2017 08:07:13 +0000 (08:07 +0000)]
MFC r321581:
Mark pages after EOF as clean after pageout.

6 years agoMFC r321580:
kib [Wed, 2 Aug 2017 08:03:40 +0000 (08:03 +0000)]
MFC r321580:
Move rtvals initialization out of the region protected by NFS node lock.

6 years agoMFC r321512:
kib [Wed, 2 Aug 2017 07:58:36 +0000 (07:58 +0000)]
MFC r321512:
Mark name_PCTRIE_LOOKUP_LE() generated function unused.

6 years agoMFC r320761:
delphij [Wed, 2 Aug 2017 05:30:41 +0000 (05:30 +0000)]
MFC r320761:

 - Use strlcat() instead of strncat().
 - Use asprintf() and handle allocation errors.

6 years agoMFC r321713:
delphij [Wed, 2 Aug 2017 05:17:01 +0000 (05:17 +0000)]
MFC r321713:

Bump copyright year.

6 years agoMFC r320359:
trasz [Tue, 1 Aug 2017 14:25:27 +0000 (14:25 +0000)]
MFC r320359:

Add vfs.nfsd.nfsd_enable_uidtostring, which works just like
vfs.nfsd.nfsd_enable_stringtouid, but in reverse - when set to 1,
it forces the NFSv4 server to return numeric UIDs and GIDs instead
of "user@domain" strings. This helps with clients that can't
translate returned identifiers, eg when rerooting.

The same can be achieved by just never running nfsuserd(8),
but the sysctl is useful to toggle the behaviour back and forth
without rebooting.

MFC r320409:

Revert part of r320359, as suggested by rmacklem@.  That case is only used
for nfsuserd -manage-gids and shouldn't depend on sysctl.

MFC r321196:

Rename vfs.nfsd.enable_uidtostring to vfs.nfs.enable_uidtostring.
It applies to both NFS client and NFS server, and is useful for both.
This is different from vfs.nfsd.enable_stringtouid, which is specific
to server side.

Sponsored by: DARPA, AFRL

6 years agoMFC r320495: Allow status aggregation for ramdisk reads.
mav [Tue, 1 Aug 2017 13:07:54 +0000 (13:07 +0000)]
MFC r320495: Allow status aggregation for ramdisk reads.

6 years agoMFC r320493: Unify INOT/ATIO setup.
mav [Tue, 1 Aug 2017 13:07:05 +0000 (13:07 +0000)]
MFC r320493: Unify INOT/ATIO setup.

6 years agoMFC r320604, r320865:
mav [Tue, 1 Aug 2017 13:03:06 +0000 (13:03 +0000)]
MFC r320604, r320865:
Switch fabric scans from GID_FT to GID_PT+GFF_ID/GFT_ID.

Instead of using GID_FT SNS request to get list of registered FCP ports,
use GID_PT to get list of all Nx_Ports, and then use GFF_ID and/or GFT_ID
requests to find whether they are FCP and target capable.

The problem with old approach is that GID_FT does not report ports without
FC-4 type registered.  In particular it was impossible to boot OS from
FreeBSD FC target using QLogic FC BIOS, since one does not register FC-4
type even on new cards and so ignored by old code as incompatible.

As a side bonus this allows initiator to skip pointless logins to other
initiators by fetching that information from SNS instead.

In case some switches do not implement GFF_ID/GFT_ID correctly, add sysctls
to disable that functionality.  I handled broken GFF_ID of my Brocade 200E,
but there may be other switches with different bugs.

Linux also uses GID_PT, but GFF_ID is disabled by default there, and GFT_ID
is not supported.

Sponsored by: iXsystems, Inc.

6 years agoMFC r320575: Move comment respecting previous commit.
mav [Tue, 1 Aug 2017 13:00:13 +0000 (13:00 +0000)]
MFC r320575: Move comment respecting previous commit.

6 years agoMFC r320574: Slightly unify SNS requests for post- and pre-24xx.
mav [Tue, 1 Aug 2017 12:59:37 +0000 (12:59 +0000)]
MFC r320574: Slightly unify SNS requests for post- and pre-24xx.

6 years agoMFC r320492: Polish target_id/target_lun setting for ATIOs/INOTs.
mav [Tue, 1 Aug 2017 12:58:48 +0000 (12:58 +0000)]
MFC r320492: Polish target_id/target_lun setting for ATIOs/INOTs.

For ATIOs it is pointless to report isp_loopid to CAM, since in other
places it operates with port database record IDs, not with loop IDs.

For INOTs target_id/target_lun seems were never set, so wildcard INOTs
probably were not working correctly when LUN IDs were important.

6 years agoMFC r320990, r321011:
pfg [Tue, 1 Aug 2017 01:23:55 +0000 (01:23 +0000)]
MFC r320990, r321011:

libthr: Avoid checking for negative values in usigned count.

Check for overflow instead.

6 years agoMFC r320941: Fix GRE over IPv6 tunnels with IPFW
philip [Mon, 31 Jul 2017 19:48:29 +0000 (19:48 +0000)]
MFC r320941: Fix GRE over IPv6 tunnels with IPFW

Previously, GRE packets in IPv6 tunnels would be dropped by IPFW (unless
net.inet6.ip6.fw.deny_unknown_exthdrs was unset).

PR: 220640
Submitted by: Kun Xie <kxie@xiplink.com>

6 years agoMFC r321436: ar: handle partial writes from archive_write_data
emaste [Mon, 31 Jul 2017 08:19:44 +0000 (08:19 +0000)]
MFC r321436: ar: handle partial writes from archive_write_data

libarchive may limit a single archive_write_data call to handling
0x7fffffff bytes. Add a loop to handle partial writes.

Sponsored by: The FreeBSD Foundation

6 years agoMFC r320491:
ngie [Mon, 31 Jul 2017 03:58:58 +0000 (03:58 +0000)]
MFC r320491:

atf-sh(3): document atf_init_test_cases(3) fully

The function was missing from the NAME/SYNOPSIS sections. Add a manpage link
to complete the documentation reference.

6 years agoMFC 321409
sephe [Mon, 31 Jul 2017 03:04:39 +0000 (03:04 +0000)]
MFC 321409

    hyperv/hn: Ignore LINK_SPEED_CHANGE status.

    This status will be reported if the backend NIC is wireless; it's not
    useful.  Due to the high frequency of the reporting, this could be
    pretty annoying; ignore it.

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

6 years agoMFC 321408
sephe [Mon, 31 Jul 2017 02:57:39 +0000 (02:57 +0000)]
MFC 321408

    rndis: Add LINK_SPEED_CHANGE status

    Reviewed by:    hselasky
    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D11650

6 years agoMFC 321407
sephe [Mon, 31 Jul 2017 02:48:18 +0000 (02:48 +0000)]
MFC 321407

    hyperv/hn: Export VF list and VF-HN mapping

    The VF-HN map will be used later on to implement "transparent VF".

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

6 years agoMFC 321406
sephe [Mon, 31 Jul 2017 02:33:49 +0000 (02:33 +0000)]
MFC 321406

    ethernet: Add ethernet interface attached event and devctl notification.

    ifnet_arrival_event may not be adequate under certain situation; e.g.
    when the LLADDR is needed.  So the ethernet ifattach event is announced
    after all necessary bits are setup.

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

6 years agoMFC r321640:
markj [Mon, 31 Jul 2017 00:40:14 +0000 (00:40 +0000)]
MFC r321640:
Fix style bugs in ksyms.c.

6 years agoMFC r321639:
markj [Mon, 31 Jul 2017 00:35:21 +0000 (00:35 +0000)]
MFC r321639:
Restrict permissions on /dev/ksyms to 0400.

6 years agoMFC r321437:
markj [Mon, 31 Jul 2017 00:34:36 +0000 (00:34 +0000)]
MFC r321437:
Fix style and wrap lines to 80 columns in savecore.c.

6 years agoMFC r321401:
avos [Sun, 30 Jul 2017 18:29:28 +0000 (18:29 +0000)]
MFC r321401:
net80211: do not allow to unload rate control module if it is still in use.

Keep 'nrefs' counter up-to-date, so 'kldunload wlan_amrr' with 1+ active
wlan(4) interface will not lead to kernel panic.

6 years agoMFC r320837:
dchagin [Sun, 30 Jul 2017 08:02:06 +0000 (08:02 +0000)]
MFC r320837:

Style(9). Whitespace.

6 years agoMFC r320836:
dchagin [Sun, 30 Jul 2017 08:00:54 +0000 (08:00 +0000)]
MFC r320836:

Eliminate bogus casts.

6 years agoMFC r321370
kp [Sat, 29 Jul 2017 17:30:25 +0000 (17:30 +0000)]
MFC r321370

Handle WITH/WITHOUT_PF in libsysdecode

Only filter out the PF ioctls if we're building without pf support.
Until now those were always filtered out, so truss did not show symbolic
names for pf ioctls.

Differential Revision: https://reviews.freebsd.org/D11629

6 years agoMFC r314504 (by tsoome):
mav [Sat, 29 Jul 2017 11:27:54 +0000 (11:27 +0000)]
MFC r314504 (by tsoome):
loader: r314112 did introduce dereference freed pointer entry

CID: 1371675
Reported by:    Coverity
Differential Revision:  https://reviews.freebsd.org/D9846

6 years agoMFC r321366:
dchagin [Sat, 29 Jul 2017 10:31:57 +0000 (10:31 +0000)]
MFC r321366:

Style(9) whitespace fix.

6 years agoMFC r320814:
dchagin [Sat, 29 Jul 2017 10:30:13 +0000 (10:30 +0000)]
MFC r320814:

Style(9). Add blank line aftr {.

MFC r320815:

Remove init from declaration.

MFC r320816:

Remove init from declaration, collapse two int vars declarations into single.

MFC r320817:

Don't take a lock around atomic operation.

MFC r320818:

Eliminate the bogus cast.

MFC r320819:

Eliminate the bogus cast.

MFC r320820:

Don't initialize error in declaration.

6 years agoMFC r307865 (by tsoome): loader should boot pre-feature flags pools.
mav [Sat, 29 Jul 2017 09:56:07 +0000 (09:56 +0000)]
MFC r307865 (by tsoome): loader should boot pre-feature flags pools.

The feature flags chek is missing the corner case where we have valid pool
version, but feature flags are not enabled - as for example plain v28 pool.

This update does fix the boot support for such pools.

Differential Revision:  https://reviews.freebsd.org/D8331

PR: 221084

6 years agoMFC r321371:
kib [Sat, 29 Jul 2017 07:59:28 +0000 (07:59 +0000)]
MFC r321371:
Do not allocate struct kinfo_vmobject on stack.

6 years agoMFC r321342:
dim [Fri, 28 Jul 2017 19:10:34 +0000 (19:10 +0000)]
MFC r321342:

Pull in r295886 from upstream clang trunk (by Richard Smith):

  PR32034: Evaluate _Atomic(T) in-place when T is a class or array type.

  This is necessary in order for the evaluation of an _Atomic
  initializer for those types to have an associated object, which an
  initializer for class or array type needs.

This fixes an assertion when building recent versions of LinuxCNC.

Reported by: trasz
PR: 220883

6 years agoMFC r321306:
dim [Fri, 28 Jul 2017 18:47:04 +0000 (18:47 +0000)]
MFC r321306:

Fix printf format warning in iflib.c

Clang 5.0.0 got better warnings about printf format strings using %zd,
and this leads to the following -Werror warning on e.g. arm:

    sys/net/iflib.c:1517:8: error: format specifies type 'ssize_t' (aka 'int') but the argument has type 'bus_size_t' (aka 'unsigned long') [-Werror,-Wformat]
                                              sctx->isc_tx_maxsize, nsegments, sctx->isc_tx_maxsegsize);
                                              ^~~~~~~~~~~~~~~~~~~~
    sys/net/iflib.c:1517:41: error: format specifies type 'ssize_t' (aka 'int') but the argument has type 'bus_size_t' (aka 'unsigned long') [-Werror,-Wformat]
                                              sctx->isc_tx_maxsize, nsegments, sctx->isc_tx_maxsegsize);
                                                                               ^~~~~~~~~~~~~~~~~~~~~~~

Fix this by casting bus_size_t arguments to uintmax_t, and using %ju
instead.

Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D11679

6 years agoMFC r321305:
dim [Fri, 28 Jul 2017 18:35:29 +0000 (18:35 +0000)]
MFC r321305:

Fix printf format warning in zfs_module.c

Clang 5.0.0 got better warnings about print format strings using %zd,
and this leads to the following -Werror warning on e.g. arm:

    sys/boot/efi/boot1/zfs_module.c:186:18: error: format specifies type 'ssize_t' (aka 'int') but the argument has type 'off_t' (aka 'long long') [-Werror,-Wformat]
                        "(%lu)\n", st.st_size, spa->spa_name, filepath, EFI_ERROR_CODE(status));
                                   ^~~~~~~~~~

Fix this by casting off_t arguments to intmax_t, and using %jd instead.

Reviewed by: tsoome
Differential Revision: https://reviews.freebsd.org/D11678

6 years agoMFC 321075: Set the current vnet pointer in the socket buffer AIO handler.
jhb [Fri, 28 Jul 2017 18:09:41 +0000 (18:09 +0000)]
MFC 321075: Set the current vnet pointer in the socket buffer AIO handler.

This fixes panics when using AIO under VIMAGE.

Sponsored by: Chelsio Communications

6 years agoMFC bmake-20170720
sjg [Fri, 28 Jul 2017 15:43:36 +0000 (15:43 +0000)]
MFC bmake-20170720

PR: 221023

6 years agoMFC r314319 (by oshogbo):
kib [Fri, 28 Jul 2017 10:30:59 +0000 (10:30 +0000)]
MFC r314319 (by oshogbo):
Don't try to open devices in the gettc() function  which will always
fail in the Capability mode. Instead silently fallback to the syscall
method, which is done for example in the gettimeofday(2) function.

MFC r314320 (by oshogbo):
Remove unneeded variable initialization from r314319.

MFC r321461:
Fix indent.

6 years agoMFC r320441,r320442:
ngie [Fri, 28 Jul 2017 03:32:36 +0000 (03:32 +0000)]
MFC r320441,r320442:

r320441:

share/examples/tests/Makefile: clean up example snippets/documentation

- TESTSDIR doesn't need to be specified after r289158.
- Including bsd.own.mk isn't required since no MK_<foo> knobs are being
  manipulated.
- TESTS_SUBDIRS should be written out in an append format, one entry
  per line, to provide a better, more conflict resistant example.

r320442:

share/examples/tests/{atf,plain}/Makefile: tweak example Makefile snippets

- Including bsd.own.mk isn't required since no MK_<foo> knobs are being
  manipulated.
- Update documentation to note that ${FILES} is installed via bsd.progs.mk,
  not bsd.prog.mk.

6 years agoMFC r320443,r320444:
ngie [Fri, 28 Jul 2017 03:27:41 +0000 (03:27 +0000)]
MFC r320443,r320444:

r320443:

Add kyua TAP test integration examples

The examples are patterned loosely after the ATF examples, similar
to the plain test examples.

r320444:

Commit the corresponding mtree file change for the TAP test examples

MFC with: r320443

6 years agoMFC r320446:
ngie [Fri, 28 Jul 2017 03:25:58 +0000 (03:25 +0000)]
MFC r320446:

trailing_slash is a TAP-compliant testcase; mark it as such, instead
of calling is a plain testcase.

6 years agoMFC r320445:
ngie [Fri, 28 Jul 2017 03:25:01 +0000 (03:25 +0000)]
MFC r320445:

Don't hardcode path to file in /tmp; this violates the kyua sandbox

6 years agoMFC: r321314
rmacklem [Thu, 27 Jul 2017 23:09:12 +0000 (23:09 +0000)]
MFC: r321314
r320062 introduced a bug when doing NFSv4.1 mounts against some non-FreeBSD servers.

r320062 used nm_rsize, nm_wsize to set the maximum request/response sizes for
the NFSv4.1 session. If rsize,wsize are not specified as options, the
value of nm_rsize, nm_wsize is 0 at session creation, resulting in
values for request/response that are too small.
This patch fixes the problem. A workaround is to specify rsize=N,wsize=N
mount options explicitly, so they are set before session creation.
This bug only affects NFSv4.1 mounts against some non-FreeBSD servers.

6 years agoAdd an errata entry to reflect an incorrect attribution for r315330.
gjb [Thu, 27 Jul 2017 15:59:36 +0000 (15:59 +0000)]
Add an errata entry to reflect an incorrect attribution for r315330.

Reported by: Jim Thompson
Sponsored by: The FreeBSD Foundation

6 years agorevert r321601, it depends on an ACPICA update not yet merged
emaste [Thu, 27 Jul 2017 12:37:18 +0000 (12:37 +0000)]
revert r321601, it depends on an ACPICA update not yet merged

6 years agoMFC r320152 (by avg): fstyp: move sys/ include path after zfs include paths
mav [Thu, 27 Jul 2017 10:52:36 +0000 (10:52 +0000)]
MFC r320152 (by avg): fstyp: move sys/ include path after zfs include paths

The reason is that FreeBSD refcount.h shadows ZFS refcount.h and that
will lead to a build error after a planned import of the ARC buf data
scatter-ization.
It's possible that some day we will have an opposite problem where
a ZFS header would shadow an essential FreeBSD header.
So, we need to think about a better long term solution.

6 years agoMFC r320352: zfs: port vdev_file part of illumos change 3306
mav [Thu, 27 Jul 2017 10:30:55 +0000 (10:30 +0000)]
MFC r320352: zfs: port vdev_file part of illumos change 3306

3306 zdb should be able to issue reads in parallel
illumos/illumos-gate/31d7e8fa33fae995f558673adb22641b5aa8b6e1
https://www.illumos.org/issues/3306

The upstream change was made before we started to import upstream commits
individually.  It was imported into the illumos vendor area as r242733.
That commit was MFV-ed in r260138, but as the commit message says
vdev_file.c was left intact.

This commit actually implements the parallel I/O for vdev_file using a
taskqueue with multiple thread.  This implementation does not depend on
the illumos or FreeBSD bio interface at all, but uses zio_t to pass
around all the relevent data.  So, the code looks a bit different from
the upstream.

This commit also incorporates ZoL commit
zfsonlinux/zfs/bc25c9325b0e5ced897b9820dad239539d561ec9 that fixed
https://github.com/zfsonlinux/zfs/issues/2270
We need to use a dedicated taskqueue for exactly the same reason as ZoL
as we do not implement TASKQ_DYNAMIC.

Obtained from:  illumos, ZFS on Linux

6 years agoMFC r320239: MFV r319950:
mav [Thu, 27 Jul 2017 10:29:29 +0000 (10:29 +0000)]
MFC r320239: MFV r319950:
5220 L2ARC does not support devices that do not provide 512B access

FreeBSD note: the actual change has been in FreeBSD since r297848.  This
commit accounts for integration of that change with subsequent changes,
especially r320156 (MFV of r318946) and r314274.

illumos/illumos-gate@403a8da73c64ff9dfb6230ba045c765a242213fb
https://github.com/illumos/illumos-gate/commit/403a8da73c64ff9dfb6230ba045c765a242213fb

https://www.illumos.org/issues/5220
  There are disk devices that have logical sector size larger than 512B, for
  example 4KB. That is, their physical sector size is larger than 512B and they
  do not provide emulation for 512B sector sizes. For such devices both a data
  offset and a data size must be properly aligned. L2ARC should arrange that
  because it uses physical I/O.
  zio_vdev_io_start() performs a necessary transformation if io_size is not
  aligned to vdev_ashift, but that is done only for logical I/O. Something
  similar should be done in L2ARC code.
      * a temporary write buffer should be allocated if the original buffer is
        not going to be compressed and its size is not aligned
      * size of a temporary compression buffer should be ashift aligned
      * for the reads, if a size of a target buffer is not sufficiently large and
        it is not aligned then a temporary read buffer should be allocated

Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Dan Kimmel <dan.kimmel@delphix.com>
Reviewed by: Saso Kiselkov <saso.kiselkov@nexenta.com>
Approved by: Dan McDonald <danmcd@joyent.com>
Author: Andriy Gapon <avg@FreeBSD.org>

6 years agoMFC r320238: MFV r319742: 8056 zfs send size estimate is inaccurate for some zvols
mav [Thu, 27 Jul 2017 10:28:07 +0000 (10:28 +0000)]
MFC r320238: MFV r319742: 8056 zfs send size estimate is inaccurate for some zvols

illumos/illumos-gate@0255edcc85fc0cd1dda0e49bcd52eb66c06a1b16
https://github.com/illumos/illumos-gate/commit/0255edcc85fc0cd1dda0e49bcd52eb66c06a1b16

https://www.illumos.org/issues/8056
  The send size estimate for a zvol can be too low, if the size of the record
  headers (dmu_replay_record_t's) is a significant portion of the size.
  This is typically the case when the data is highly compressible, especially
  with embedded blocks.
  The problem is that dmu_adjust_send_estimate_for_indirects() assumes that
  blocks are the size of the "recordsize" property (128KB).
  However, for zvols, the blocks are the size of the "volblocksize" property
  (8KB). Therefore, we estimate that there will be 16x less record headers than
  there really will be.

Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Pavel Zakharov <pavel.zakharov@delphix.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Paul Dagnelie <pcd@delphix.com>