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

6 years agoMFC r321839:
dchagin [Thu, 10 Aug 2017 05:38:31 +0000 (05:38 +0000)]
MFC r321839:

Implement proper Linux /dev/fd and /proc/self/fd behavior by adding
Linux specific things to the native fdescfs file system.

Unlike FreeBSD, the Linux fdescfs is a directory containing a symbolic
links to the actual files, which the process has open.
A readlink(2) call on this file returns a full path in case of regular file
or a string in a special format (type:[inode], anon_inode:<file-type>, etc..).
As well as in a FreeBSD, opening the file in the Linux fdescfs directory is
equivalent to duplicating the corresponding file descriptor.

Here we have mutually exclusive requirements:
- in case of readlink(2) call fdescfs lookup() method should return VLNK
vnode otherwise our kern_readlink() fail with EINVAL error;
- in the other calls fdescfs lookup() method should return non VLNK vnode.

For what new vnode v_flag VV_READLINK was added, which is set if fdescfs has beed
mounted with linrdlnk option an modified kern_readlinkat() to properly handle it.

For now For Linux ABI compatibility mount fdescfs volume with linrdlnk option:

  mount -t fdescfs -o linrdlnk null /compat/linux/dev/fd

Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D11452

6 years agoMFC r321460:
dchagin [Thu, 10 Aug 2017 05:35:45 +0000 (05:35 +0000)]
MFC r321460:

Replace unnecessary _KERNEL by double-include protection.

6 years agoAdd an errata entry for ruptime(1), rwho(1), and rwhod(8), not
gjb [Wed, 9 Aug 2017 12:55:58 +0000 (12:55 +0000)]
Add an errata entry for ruptime(1), rwho(1), and rwhod(8), not
included in the rcmds deprecation.

Sponsored by: The FreeBSD Foundation

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

6 years agoMFC r321847:
markj [Tue, 8 Aug 2017 19:53:06 +0000 (19:53 +0000)]
MFC r321847:
Batch updates to v_wire_count when freeing page table pages on x86.

6 years agoMFC r321843, r321843:
markj [Tue, 8 Aug 2017 19:49:35 +0000 (19:49 +0000)]
MFC r321843, r321843:
Let lockstat use ksyms(4)'s mmap interface.

6 years agoMFC r321884, r321896:
markj [Tue, 8 Aug 2017 19:47:11 +0000 (19:47 +0000)]
MFC r321884, r321896:
Fix a witness assertion that fires when a lock type's class changes.

6 years agoMFC r321734: bsdinstall: default to UEFI-only boot on arm64
emaste [Tue, 8 Aug 2017 13:44:32 +0000 (13:44 +0000)]
MFC r321734: bsdinstall: default to UEFI-only boot on arm64

Sponsored by: The FreeBSD Foundation

6 years agoMFC r313958, r319717, r321810
bapt [Tue, 8 Aug 2017 11:35:27 +0000 (11:35 +0000)]
MFC r313958, r319717, r321810

r313958:
Import mandoc 1.4.1rc2

r319717:
Import mandoc snapshot 2017-06-08

It implements missing man(7) macros used in base by kerberos/ntp and makes them
supported by mandoc.

This import should have been done before the removal of groff.

Reported by: gordon

r321810:
Update mandoc to 1.14.2

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

Update pci_vendors to 2017.07.27

6 years agoMFC 321858: Add alternate Turkish keyboard layout F, submitted by Ufur Guler.
se [Tue, 8 Aug 2017 10:45:13 +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.

6 years agoMFC r321851:
ngie [Tue, 8 Aug 2017 05:19:45 +0000 (05:19 +0000)]
MFC r321851:

Standardize paths on SRCTOP instead of .CURDIR-relative paths

6 years agoMFC r321849,r321852:
ngie [Tue, 8 Aug 2017 05:15:20 +0000 (05:15 +0000)]
MFC r321849,r321852:

r321849:

Fix the return type for pager_output(..) in bootparttest and zfsboottest

pager_output(..) has always returned int. For some reason (probably the
clang 5.0 update), this mismatch now results in an error with CC=clang.

r321852:

Fix up r321849

pager_output should return 0 if no more output needs to be paged; non-zero
otherwise.

MFC with: r321849

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

Detect hypervisor early so that we set lower hz on it.

6 years agoMFC r321803:
markj [Mon, 7 Aug 2017 17:30:22 +0000 (17:30 +0000)]
MFC r321803:
Don't trace running threads that have interrupts disabled.

6 years agoMFC r321805:
markj [Mon, 7 Aug 2017 17:29:48 +0000 (17:29 +0000)]
MFC r321805:
Batch v_wire_count decrements in vm_hold_free_pages().

6 years agoMFC r321744:
markj [Mon, 7 Aug 2017 17:28:35 +0000 (17:28 +0000)]
MFC r321744:
Correct the predicates on which lockstat:::{thread,spin}-spin fire.

6 years agoImport libxo-0.8.4 from HEAD into stable/11
phil [Mon, 7 Aug 2017 17:23:44 +0000 (17:23 +0000)]
Import libxo-0.8.4 from HEAD into stable/11

Submitted by: phil

6 years agoMFC r321782:
hselasky [Mon, 7 Aug 2017 13:24:05 +0000 (13:24 +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

6 years agoMFC r321772:
hselasky [Mon, 7 Aug 2017 13:14:10 +0000 (13:14 +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

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

Sponsored by: Mellanox Technologies

6 years agoMFC r321986:
hselasky [Mon, 7 Aug 2017 12:57:31 +0000 (12:57 +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

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

Sponsored by: Mellanox Technologies

6 years agoMFC r312882, r321983 and r321984:
hselasky [Mon, 7 Aug 2017 12:48:13 +0000 (12:48 +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

6 years agoMFC r312881:
hselasky [Mon, 7 Aug 2017 12:44:18 +0000 (12:44 +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

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

Sponsored by: Mellanox Technologies

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

Sponsored by: Mellanox Technologies

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

Sponsored by: Mellanox Technologies

6 years agoMFC r312877 and r312878:
hselasky [Mon, 7 Aug 2017 12:27:59 +0000 (12:27 +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

6 years agoMFC r321794: Improve FHA locality control for NFS read/write requests.
mav [Mon, 7 Aug 2017 07:02:51 +0000 (07:02 +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.

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

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

6 years agoMFC 321836,321837
sephe [Mon, 7 Aug 2017 03:03:40 +0000 (03:03 +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

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.