]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
5 years agoMFC r345806:
dim [Fri, 5 Apr 2019 16:09:23 +0000 (16:09 +0000)]
MFC r345806:

Pull in r357362 from upstream clang trunk (by David Chisnall):

  [objc-gnustep] Use .init_array not .ctors when requested.

  This doesn't make a difference most of the time but FreeBSD/ARM
  doesn't run anything in the .ctors array.

This should help with updating the libobjc2 port for armv7.

Requested by: theraven
Upstream PR: https://github.com/gnustep/libobjc2/issues/83

5 years agoMFC r345633:
hselasky [Fri, 5 Apr 2019 11:39:21 +0000 (11:39 +0000)]
MFC r345633:
Add new USB PCI ID.

Submitted by: Dmitry Luhtionov <dmitryluhtionov@gmail.com>
Sponsored by: Mellanox Technologies

5 years agoMFC r345499:
hselasky [Fri, 5 Apr 2019 11:34:13 +0000 (11:34 +0000)]
MFC r345499:
Change all kernel C-type macros into static inline functions.

The current kernel C-type macros might obscurely hide the fact that
the input argument might be used multiple times.

This breaks code like:
isalpha(*ptr++)

Use static inline functions instead of macros to fix this.

Reviewed by: kib @
Differential Revision: https://reviews.freebsd.org/D19694
Sponsored by: Mellanox Technologies

5 years agoMFC r345109:
hselasky [Fri, 5 Apr 2019 11:32:57 +0000 (11:32 +0000)]
MFC r345109:
Implement sg_virt() function in the LinuxKPI.

Submitted by: Johannes Lundberg <johalun0@gmail.com>
Sponsored by: Limelight Networks
Sponsored by: Mellanox Technologies

5 years agoMFC r345108:
hselasky [Fri, 5 Apr 2019 11:31:52 +0000 (11:31 +0000)]
MFC r345108:
Define SG_CHAIN and SG_END in the LinuxKPI.

Submitted by: Johannes Lundberg <johalun0@gmail.com>
Sponsored by: Limelight Networks
Sponsored by: Mellanox Technologies

5 years agoMFC r345107:
hselasky [Fri, 5 Apr 2019 11:30:27 +0000 (11:30 +0000)]
MFC r345107:
Implement pr_info_ratelimited() function macro in the LinuxKPI.

Submitted by: Johannes Lundberg <johalun0@gmail.com>
Sponsored by: Limelight Networks
Sponsored by: Mellanox Technologies

5 years agoMFC r345106:
hselasky [Fri, 5 Apr 2019 11:29:05 +0000 (11:29 +0000)]
MFC r345106:
Define some RCU debug macros in the LinuxKPI.

Submitted by: Johannes Lundberg <johalun0@gmail.com>
Sponsored by: Limelight Networks
Sponsored by: Mellanox Technologies

5 years agoMFC r345105:
hselasky [Fri, 5 Apr 2019 11:27:35 +0000 (11:27 +0000)]
MFC r345105:
Honor SYSCTL function return values when creating sysfs nodes in the LinuxKPI.
Return proper error code upon failure.

Submitted by: Johannes Lundberg <johalun0@gmail.com>
Sponsored by: Limelight Networks
Sponsored by: Mellanox Technologies

5 years agoMFC r345104:
hselasky [Fri, 5 Apr 2019 11:26:33 +0000 (11:26 +0000)]
MFC r345104:
Implement more malloc function macros in the LinuxKPI.
Fix arguments for currently unused kvmalloc().

Submitted by: Johannes Lundberg <johalun0@gmail.com>
Sponsored by: Limelight Networks
Sponsored by: Mellanox Technologies

5 years agoMFC r345101:
hselasky [Fri, 5 Apr 2019 11:24:05 +0000 (11:24 +0000)]
MFC r345101:
Implement si_meminfo() in the LinuxKPI.

Submitted by: Johannes Lundberg <johalun0@gmail.com>
Sponsored by: Limelight Networks
Sponsored by: Mellanox Technologies

5 years agoMFC r345099:
hselasky [Fri, 5 Apr 2019 11:21:00 +0000 (11:21 +0000)]
MFC r345099:
Implement get_task_comm() in the LinuxKPI.

Submitted by: Johannes Lundberg <johalun0@gmail.com>
Sponsored by: Limelight Networks
Sponsored by: Mellanox Technologies

5 years agoMFC r345098:
hselasky [Fri, 5 Apr 2019 11:19:23 +0000 (11:19 +0000)]
MFC r345098:
Implement current_exiting() in the LinuxKPI.

Submitted by: Johannes Lundberg <johalun0@gmail.com>
Sponsored by: Limelight Networks
Sponsored by: Mellanox Technologies

5 years agoMFC r345097:
hselasky [Fri, 5 Apr 2019 11:17:27 +0000 (11:17 +0000)]
MFC r345097:
Implement list_for_each_entry_from_reverse() and
list_bulk_move_tail() in the LinuxKPI.

Submitted by: Johannes Lundberg <johalun0@gmail.com>
Sponsored by: Limelight Networks
Sponsored by: Mellanox Technologies

5 years agoMFC r345096:
hselasky [Fri, 5 Apr 2019 11:16:06 +0000 (11:16 +0000)]
MFC r345096:
Implement dma_map_page_attrs() in the LinuxKPI.

Submitted by: Johannes Lundberg <johalun0@gmail.com>
Sponsored by: Limelight Networks
Sponsored by: Mellanox Technologies

5 years agoMFC r345095 and r345110:
hselasky [Fri, 5 Apr 2019 11:14:01 +0000 (11:14 +0000)]
MFC r345095 and r345110:
Implement ida_free() and ida_alloc_max() in the LinuxKPI.

Submitted by: Johannes Lundberg <johalun0@gmail.com>
Sponsored by: Limelight Networks
Sponsored by: Mellanox Technologies

5 years agoMFC r345094:
hselasky [Fri, 5 Apr 2019 11:11:35 +0000 (11:11 +0000)]
MFC r345094:
Implement DEFINE_STATIC_SRCU() function macro in the LinuxKPI.

Submitted by: Johannes Lundberg <johalun0@gmail.com>
Sponsored by: Limelight Networks
Sponsored by: Mellanox Technologies

5 years agoMFC r345093:
hselasky [Fri, 5 Apr 2019 11:10:27 +0000 (11:10 +0000)]
MFC r345093:
Implement BITS_PER_TYPE() function macro in the LinuxKPI.
Fix some style while at it.

Submitted by: Johannes Lundberg <johalun0@gmail.com>
Sponsored by: Limelight Networks
Sponsored by: Mellanox Technologies

5 years agoMFC r345092:
hselasky [Fri, 5 Apr 2019 11:08:35 +0000 (11:08 +0000)]
MFC r345092:
Properly define the DMA attribute values in the LinuxKPI.

Submitted by: Johannes Lundberg <johalun0@gmail.com>
Sponsored by: Limelight Networks
Sponsored by: Mellanox Technologies

5 years agoMFC r345091:
hselasky [Fri, 5 Apr 2019 11:07:29 +0000 (11:07 +0000)]
MFC r345091:
Implement dev_err_once() function macro in the LinuxKPI.

Submitted by: Johannes Lundberg <johalun0@gmail.com>
Sponsored by: Limelight Networks
Sponsored by: Mellanox Technologies

5 years agoMFC r345090:
hselasky [Fri, 5 Apr 2019 11:05:55 +0000 (11:05 +0000)]
MFC r345090:
Implement dma_set_mask_and_coherent() in the LinuxKPI.

Submitted by: Johannes Lundberg <johalun0@gmail.com>
Sponsored by: Limelight Networks
Sponsored by: Mellanox Technologies

5 years agoMFC r336832:
hselasky [Fri, 5 Apr 2019 10:00:40 +0000 (10:00 +0000)]
MFC r336832:
Implement atomic_swap_{32,64,int,long,ptr}(9).

5 years agoMFC r344243, r345517-r345518: lualoader: More intelligent screen clearing
kevans [Thu, 4 Apr 2019 17:29:43 +0000 (17:29 +0000)]
MFC r344243, r345517-r345518: lualoader: More intelligent screen clearing

r344243:
lualoader: only clear the screen before first password prompt

This was previously an unconditional screen clear, regardless of whether or
not we would be prompting for any passwords. This is pointless, given that
the screen clear is only there to put our screen into a consistent state
before we draw the prompts and do cursor manipulation.

This is also the only screen clear besides that to draw the menu.  One can
now see early pre-loader and loader output with the menu disabled, which may
be useful for diagnostics.

r345517:
lualoader: Clear the screen before prompting for password

Assuming that the autoboot sequence was interrupted, we've done enough
cursor manipulation that the prompt for the password will be sufficiently
obscured a couple of lines up. Clear the screen and reset the cursor
position here, too.

r345518:
lualoader: Fix up some luacheck concerns

- Garbage collect an unused (removed because it was useless) constant
- Don't bother with vararg notation if args will not be used

5 years agoMFC r345628: dtc(1): Update to 1a79f5f26631
kevans [Thu, 4 Apr 2019 17:27:01 +0000 (17:27 +0000)]
MFC r345628: dtc(1): Update to 1a79f5f26631

Highlights:
- Bugfix for order in which /delete-node/ and /delete-property/ are
  processed [0]
- /omit-if-no-ref/ support has been added (used only by U-Boot at this
  point, in theory)
- GPL dtc compat version bumped to 1.4.7
- Various small fixes and compatibility improvements

5 years agoMFC r344677: patch(1): Exit successfully if we're fed a 0-length patch
kevans [Thu, 4 Apr 2019 17:21:30 +0000 (17:21 +0000)]
MFC r344677: patch(1): Exit successfully if we're fed a 0-length patch

This change is made in the name of GNU patch compatibility. If GNU patch is
fed a zero-length patch, it will exit successfully with no output. This is
used in at least one port to date (comms/wsjtx), and we break on this usage.

It seems unlikely that anyone relies on patch(1) calling their completely
empty patch garbage and failing, and GNU compatibility is a plus if it helps
with porting, so make the switch.

5 years agoMFC r345373: Add bus_release_resource() method to nexus on arm64
mw [Thu, 4 Apr 2019 12:02:41 +0000 (12:02 +0000)]
MFC r345373: Add bus_release_resource() method to nexus on arm64

Submitted by: Michal Krawczyk <mk@semihalf.com>
Obtained from: Semihalf
Sponsored by: Amazon, Inc.

5 years agoMFC r345371: Prevent double activation of admin interrupt in ENA
mw [Thu, 4 Apr 2019 09:06:56 +0000 (09:06 +0000)]
MFC r345371: Prevent double activation of admin interrupt in ENA

Submitted by: Michal Krawczyk <mk@semihalf.com>
Obtained from: Semihalf
Sponsored by: Amazon, Inc.

5 years agoMFC r345359, r345384:
markj [Thu, 4 Apr 2019 02:07:24 +0000 (02:07 +0000)]
MFC r345359, r345384:
Don't attempt to measure TSC skew when running as a VM guest.

PR: 218452

5 years agoMFC r345611:
rpokala [Wed, 3 Apr 2019 06:37:03 +0000 (06:37 +0000)]
MFC r345611:

Teach jedec_dimm(4) to be more forgiving of non-fatal errors.

It looks like some DIMMs claim to have a TSOD, but actually don't. Some
claim they weren't able to change the SPD page, but they did. Neither of
those should be fatal errors.

5 years agoMFC r345457:
rpokala [Wed, 3 Apr 2019 03:30:57 +0000 (03:30 +0000)]
MFC r345457:

Add descriptions for sysctls in kern_mib.c and sysctl.3 which lack them.

r343532 noted the difference between "hw.realmem" and "hw.physmem", which I
was previously unaware of. I discovered that neither sysctl had a
description visible via `sysctl -d', so I found where they were defined and
added suitable descriptions. While in the file, I went ahead and added
descriptions for all the others which lacked them. I also updated sysctl.3
accordingly.

5 years agoMFC r345332: Tune chipset naming.
mav [Wed, 3 Apr 2019 01:30:59 +0000 (01:30 +0000)]
MFC r345332: Tune chipset naming.

5 years agoMFC r345333: Add some Cannon Lake chipset IDs.
mav [Wed, 3 Apr 2019 01:29:54 +0000 (01:29 +0000)]
MFC r345333: Add some Cannon Lake chipset IDs.

5 years agoMFC r344280: freebsd-update: Clarify help text
emaste [Tue, 2 Apr 2019 13:58:31 +0000 (13:58 +0000)]
MFC r344280: freebsd-update: Clarify help text

Improve help text to include example release numbers for reference
and clarify the -F option.

PR: 231185, 214619
Submitted by: Gerald Aryeetey <aryeeteygerald_rogers.com>
Reviewed by: delphij, rgrimes
Sponsored by: The FreeBSD Foundation

5 years agoMFC r345292:
ae [Tue, 2 Apr 2019 09:33:30 +0000 (09:33 +0000)]
MFC r345292:
  Convert allocation of bpf_if in bpfattach2 from M_NOWAIT to M_WAITOK
  and remove possible panic condition.

  It is already allowed to sleep in bpfattach[2], since BPF_LOCK was
  converted to SX lock in r332388. Also move KASSERT() to the top of
  function and make full initialization before bpf_if will be linked
  to BPF's list of interfaces.

5 years agoMFC r344676: Prevent detaching driver if the attach is not finished
mw [Tue, 2 Apr 2019 08:43:19 +0000 (08:43 +0000)]
MFC r344676: Prevent detaching driver if the attach is not finished

Submitted by: Rafal Kozik <rk@semihalf.com>
Obtained from: Semihalf
Sponsored by: Amazon, Inc.

5 years agoMFC r345252:
avos [Mon, 1 Apr 2019 07:54:27 +0000 (07:54 +0000)]
MFC r345252:
net80211: correct check for SMPS node flags updates

Update node flags when driver supports SMPS, not when it is disabled or
in dynamic mode ((iv_htcaps & HTCAP_SMPS) != 0).

Was checked with RTL8188EE (1T1R), STA mode - 'smps' word should disappear
from 'ifconfig wlan0' output.

5 years agoMFC r345493:
avos [Sun, 31 Mar 2019 11:31:01 +0000 (11:31 +0000)]
MFC r345493:
run(4): merge some common TSF-related code into run_disable_tsf()

No functional change intended.

5 years agoMFC r345620:
kib [Sat, 30 Mar 2019 10:12:00 +0000 (10:12 +0000)]
MFC r345620:
rtld: disable relro enforcement for irelative relocation processing.

5 years agoMFC r345177:
kp [Fri, 29 Mar 2019 14:34:50 +0000 (14:34 +0000)]
MFC r345177:

pf :Use counter(9) in pf tables.

The counters of pf tables are updated outside the rule lock. That means state
updates might overwrite each other. Furthermore allocation and
freeing of counters happens outside the lock as well.

Use counter(9) for the counters, and always allocate the counter table
element, so that the race condition cannot happen any more.

PR: 230619
Submitted by: Kajetan Staszkiewicz <vegeta@tuxpowered.net>

5 years agoMFC r345560:
markj [Fri, 29 Mar 2019 13:38:47 +0000 (13:38 +0000)]
MFC r345560:
Add CTLFLAG_VNET to the net.inet.icmp.tstamprepl definition.

5 years agoMFC r345178:
kp [Fri, 29 Mar 2019 11:59:54 +0000 (11:59 +0000)]
MFC r345178:

bridge: Fix panic if the STP root is removed

If the spanning tree root interface is removed from the bridge we panic
on the next 'ifconfig'.
While the STP code is notified whenever a bridge member interface is
removed from the bridge it does not clear the bs_root_port. This means
bs_root_port can still point at an bridge_iflist which has been free()d.
The next access to it will panic.

Explicitly check if the interface we're removing in bstp_destroy() is
the root, and if so re-assign the roles, which clears bs_root_port.

Reviewed by: philip

5 years agoMFC r345526:
philip [Fri, 29 Mar 2019 01:51:41 +0000 (01:51 +0000)]
MFC r345526:

SZ has been known as Eswatini since April 2018 (formerly Swaziland).

5 years agoMFC r345524: Import tzdata 2019a
philip [Fri, 29 Mar 2019 01:40:44 +0000 (01:40 +0000)]
MFC r345524: Import tzdata 2019a

5 years agoMFC r339683:
rpokala [Fri, 29 Mar 2019 01:32:24 +0000 (01:32 +0000)]
MFC r339683:
Remove redundant redeclaration of netmap_vp_reg().
This should unbreak sparc64 and powerpc LINT builds.

-- While this does fix that error, powerpc.LINT, powerpc.LINT64, and
-- sparc64.LINT are broken in stable/11 for other reasons. --rpokala

Sponsored by: Panasas

5 years agoMFC of 343536, 345077, and 345352
mckusick [Fri, 29 Mar 2019 01:16:38 +0000 (01:16 +0000)]
MFC of 343536, 345077, and 345352

Collectively fixing ffs_truncate3 and dangling dependencies panics
when using ACLs.

Sponsored by: Netflix

5 years agoMFC 318562: Exclude ccr(4) from arm LINT since it excludes cxgbe(4).
jhb [Fri, 29 Mar 2019 00:04:50 +0000 (00:04 +0000)]
MFC 318562: Exclude ccr(4) from arm LINT since it excludes cxgbe(4).

5 years agoMFC 330040,330041,330079,330884,330946,330947,331649,333068,333810,337722,
jhb [Thu, 28 Mar 2019 23:43:38 +0000 (23:43 +0000)]
MFC 330040,330041,330079,330884,330946,330947,331649,333068,333810,337722,
340466,340468,340469,340473: Add TOE-based TLS offload.

Note that this requires a modified OpenSSL library.

330040:
Fetch TLS key parameters from the firmware.

The parameters describe how much of the adapter's memory is reserved for
storing TLS keys.  The 'meminfo' sysctl now lists this region of adapter
memory as 'TLS keys' if present.

330041:
Move ccr_aes_getdeckey() from ccr(4) to the cxgbe(4) driver.

This routine will also be used by the TOE module to manage TLS keys.

330079:
Move #include for rijndael.h out of x86-specific region.

The #include was added inside of the conditional by accident and the lack
of it broke non-x86 builds.

330884:
Support for TLS offload of TOE connections on T6 adapters.

The TOE engine in Chelsio T6 adapters supports offloading of TLS
encryption and TCP segmentation for offloaded connections.  Sockets
using TLS are required to use a set of custom socket options to upload
RX and TX keys to the NIC and to enable RX processing.  Currently
these socket options are implemented as TCP options in the vendor
specific range.  A patched OpenSSL library will be made available in a
port / package for use with the TLS TOE support.

TOE sockets can either offload both transmit and reception of TLS
records or just transmit.  TLS offload (both RX and TX) is enabled by
setting the dev.t6nex.<x>.tls sysctl to 1 and requires TOE to be
enabled on the relevant interface.  Transmit offload can be used on
any "normal" or TLS TOE socket by using the custom socket option to
program a transmit key.  This permits most TOE sockets to
transparently offload TLS when applications use a patched SSL library
(e.g. using LD_LIBRARY_PATH to request use of a patched OpenSSL
library).  Receive offload can only be used with TOE sockets using the
TLS mode.  The dev.t6nex.0.toe.tls_rx_ports sysctl can be set to a
list of TCP port numbers.  Any connection with either a local or
remote port number in that list will be created as a TLS socket rather
than a plain TOE socket.  Note that although this sysctl accepts an
arbitrary list of port numbers, the sysctl(8) tool is only able to set
sysctl nodes to a single value.  A TLS socket will hang without
receiving data if used by an application that is not using a patched
SSL library.  Thus, the tls_rx_ports node should be used with care.
For a server mostly concerned with offloading TLS transmit, this node
is not needed as plain TOE sockets will fall back to software crypto
when using an unpatched SSL library.

New per-interface statistics nodes are added giving counts of TLS
packets and payload bytes (payload bytes do not include TLS headers or
authentication tags/MACs) offloaded via the TOE engine, e.g.:

dev.cc.0.stats.rx_tls_octets: 149
dev.cc.0.stats.rx_tls_records: 13
dev.cc.0.stats.tx_tls_octets: 26501823
dev.cc.0.stats.tx_tls_records: 1620

TLS transmit work requests are constructed by a new variant of
t4_push_frames() called t4_push_tls_records() in tom/t4_tls.c.

TLS transmit work requests require a buffer containing IVs.  If the
IVs are too large to fit into the work request, a separate buffer is
allocated when constructing a work request.  This buffer is associated
with the transmit descriptor and freed when the descriptor is ACKed by
the adapter.

Received TLS frames use two new CPL messages.  The first message is a
CPL_TLS_DATA containing the decryped payload of a single TLS record.
The handler places the mbuf containing the received payload on an
mbufq in the TOE pcb.  The second message is a CPL_RX_TLS_CMP message
which includes a copy of the TLS header and indicates if there were
any errors.  The handler for this message places the TLS header into
the socket buffer followed by the saved mbuf with the payload data.
Both of these handlers are contained in tom/t4_tls.c.

A few routines were exposed from t4_cpl_io.c for use by t4_tls.c
including send_rx_credits(), a new send_rx_modulate(), and
t4_close_conn().

TLS keys for both transmit and receive are stored in onboard memory
in the NIC in the "TLS keys" memory region.

In some cases a TLS socket can hang with pending data available in the
NIC that is not delivered to the host.  As a workaround, TLS sockets
are more aggressive about sending CPL_RX_DATA_ACK messages anytime that
any data is read from a TLS socket.  In addition, a fallback timer will
periodically send CPL_RX_DATA_ACK messages to the NIC for connections
that are still in the handshake phase.  Once the connection has
finished the handshake and programmed RX keys via the socket option,
the timer is stopped.

A new function select_ulp_mode() is used to determine what sub-mode a
given TOE socket should use (plain TOE, DDP, or TLS).  The existing
set_tcpddp_ulp_mode() function has been renamed to set_ulp_mode() and
handles initialization of TLS-specific state when necessary in
addition to DDP-specific state.

Since TLS sockets do not receive individual TCP segments but always
receive full TLS records, they can receive more data than is available
in the current window (e.g. if a 16k TLS record is received but the
socket buffer is itself 16k).  To cope with this, just drop the window
to 0 when this happens, but track the overage and "eat" the overage as
it is read from the socket buffer not opening the window (or adding
rx_credits) for the overage bytes.

330946:
Remove TLS-related inlines from t4_tom.h to fix iw_cxgbe(4) build.

- Remove the one use of is_tls_offload() and the function.  AIO special
  handling only needs to be disabled when a TOE socket is actively doing
  TLS offload on transmit.  The TOE socket's mode (which affects receive
  operation) doesn't matter, so remove the check for the socket's mode and
  only check if a TOE socket has TLS transmit keys configured to determine
  if an AIO write request should fall back to the normal socket handling
  instead of the TOE fast path.
- Move can_tls_offload() into t4_tls.c.  It is not used in critical paths,
  so inlining isn't that important.  Change return type to bool while here.

330947:
Fix the check for an empty send socket buffer on a TOE TLS socket.

Compare sbavail() with the cached sb_off of already-sent data instead of
always comparing with zero.  This will correctly close the connection and
send the FIN if the socket buffer contains some previously-sent data but
no unsent data.

331649:
Use the offload transmit queue to set flags on TLS connections.

Requests to modify the state of TLS connections need to be sent on the
same queue as TLS record transmit requests to ensure ordering.

However, in order to use the offload transmit queue in t4_set_tcb_field(),
the function needs to be updated to do proper flow control / credit
management when queueing a request to an offload queue.  This required
passing a pointer to the toepcb itself to this function, so while here
remove the 'tid' and 'iqid' parameters and obtain those values from the
toepcb in t4_set_tcb_field() itself.

333068:
Use the correct key address when renegotiating the transmit key.

Previously, get_keyid() was returning the address of the receive key
instead of the transmit key when renegotiating the transmit key.  This
could either hang the card (if a connection was only offloading TLS TX
and thus had a receive key address of -1) or cause the connection to
fail by overwriting the wrong key (if both RX and TX TLS were
offloaded).

333810:
Be more robust against garbage input on a TOE TLS TX socket.

If a socket is closed or shutdown and a partial record (or what
appears to be a partial record) is waiting in the socket buffer,
discard the partial record and close the connection rather than
waiting forever for the rest of the record.

337722:
Whitespace nit in t4_tom.h

340466:
Move the TLS key map into the adapter softc so non-TOE code can use it.

340468:
Change the quantum for TLS key addresses to 32 bytes.

The addresses passed when reading and writing keys are always shifted
right by 5 as the memory locations are addressed in 32-byte chunks, so
the quantum needs to be 32, not 8.

340469:
Remove bogus roundup2() of the key programming work request header.

The key context is always placed immediately after the work request
header.  The total work request length has to be rounded up by 16
however.

340473:
Restore the <sys/vmem.h> header to fix build of cxgbe(4) TOM.

vmem's are not just used for TLS memory in TOM and the #include actually
predates the TLS code so should not have been removed when the TLS vmem
moved in r340466.

Sponsored by: Chelsio Communications

5 years agoMFC r345376:
kib [Thu, 28 Mar 2019 13:44:18 +0000 (13:44 +0000)]
MFC r345376:
nullfs: fix unmounts when filesystem is active.

5 years agoMFC r344990:
avos [Thu, 28 Mar 2019 09:50:25 +0000 (09:50 +0000)]
MFC r344990:
Fix ieee80211_radiotap(9) usage in wireless drivers:

- Alignment issues:
 * Add missing __packed attributes + padding across all drivers; in
most places there was an assumption that padding will be always
minimally suitable; in few places - e.g., in urtw(4) / rtwn(4) -
padding was just missing.
 * Add __aligned(8) attribute for all Rx radiotap headers since they can
contain 64-bit TSF timestamp; it cannot appear in Tx radiotap headers, so
just drop the attribute here. Refresh ieee80211_radiotap(9) man page
accordingly.

- Since net80211 automatically updates channel frequency / flags in
ieee80211_radiotap_chan_change() drop duplicate setup for these fields
in drivers.

5 years agoMFC r306049:
avos [Thu, 28 Mar 2019 09:18:22 +0000 (09:18 +0000)]
MFC r306049:
net80211: remove IEEE80211_RADIOTAP_TSFT field from transmit definitions.

This field may be used for received frames only.

5 years agoMFC r329788 (by jhb@):
np [Thu, 28 Mar 2019 06:10:41 +0000 (06:10 +0000)]
MFC r329788 (by jhb@):

Bring in additional constants and message fields for TLS-related messages.

Sponsored by: Chelsio Communications

5 years agoMFC r344306: sh: Send normal output from bind builtin to stdout
jilles [Wed, 27 Mar 2019 22:09:35 +0000 (22:09 +0000)]
MFC r344306: sh: Send normal output from bind builtin to stdout

PR: 233343

5 years agoMFC r344066:
ngie [Wed, 27 Mar 2019 19:59:36 +0000 (19:59 +0000)]
MFC r344066:

Add rc.resume(8) alias for rc(8) to fix the manpage cross references

This issue was noticed when running `make manlint` as part of MFCing r342597 to
^/stable/11:
```
$ make -C share/man/man8 rc.8lint
mandoc -Tascii -Tlint rc.8
mandoc: rc.8:548:6: STYLE: referenced manual not found: Xr rc.resume 8
$
```

This is a followup commit to r339818.

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

5 years agoMFC: r344982, r345022
wulf [Wed, 27 Mar 2019 19:17:42 +0000 (19:17 +0000)]
MFC: r344982, r345022

atrtc(4): install ACPI RTC/CMOS operation region handler

FreeBSD base system does not provide an ACPI handler for the PC/AT RTC/CMOS
device with PnP ID PNP0B00; on some HP laptops, the absence of this handler
causes suspend/resume and poweroff(8) to hang or fail [1], [2]. On these
laptops EC _REG method queries the RTC date/time registers via ACPI
before suspending/powering off. The handler should be registered before
acpi_ec driver is loaded.

This change adds handler to access CMOS RTC operation region described in
section 9.15 of ACPI-6.2 specification [3]. It is installed only for ACPI
version of atrtc(4) so it should not affect old ACPI-less i386 systems.

It is possible to disable the handler with loader tunable:
debug.acpi.disabled=atrtc

Informational debugging printf can be enabled by setting hw.acpi.verbose=1
in loader.conf

[1] https://wiki.freebsd.org/Laptops/HP_Envy_6Z-1100
[2] https://wiki.freebsd.org/Laptops/HP_Notebook_15-af104ur
[3] https://uefi.org/sites/default/files/resources/ACPI_6_2.pdf

PR: 207419, 213039
Submitted by: Anthony Jenkins <Scoobi_doo@yahoo.com>
Reviewed by: ian
Discussed on: acpi@, 2013-2015, several threads
Differential Revision: https://reviews.freebsd.org/D19314

5 years agoMFC r345324:
kib [Wed, 27 Mar 2019 11:03:07 +0000 (11:03 +0000)]
MFC r345324:
vm_fault_copy_entry: accept invalid source pages.

5 years agoMFC r344994:
avos [Wed, 27 Mar 2019 09:18:34 +0000 (09:18 +0000)]
MFC r344994:
urtw(4): add promiscuous mode callback

Also, pass control frames to the host while in MONITOR mode and / or
when promiscuous mode is enabled.

Was tested with Netgear WG111 v3 (RTL8187B), STA / MONITOR modes.

5 years agoMFC r345318:
avos [Wed, 27 Mar 2019 08:55:59 +0000 (08:55 +0000)]
MFC r345318:
lockf(1): return EX_UNAVAILABLE if -n is used and the lock file does not
exist

Apply EX_UNAVAILABLE patch part from PR 170775 to match the documentation.

Was checked with a command from PR 210770:
lockf -n /tmp/doesnotexist echo; echo $?

PR: 210770

5 years agoMFC r344502: sh: Add set -o pipefail
jilles [Tue, 26 Mar 2019 22:34:07 +0000 (22:34 +0000)]
MFC r344502: sh: Add set -o pipefail

The pipefail option allows checking the exit status of all commands in a
pipeline more easily, at a limited cost of complexity in sh itself. It works
similarly to the option in bash, ksh93 and mksh.

Like ksh93 and unlike bash and mksh, the state of the option is saved when a
pipeline is started. Therefore, even in the case of commands like
  A | B &
a later change of the option does not change the exit status, the same way
  (A | B) &
works.

Since SIGPIPE is not handled specially, more work in the script is required
for a proper exit status for pipelines containing commands such as head that
may terminate successfully without reading all input. This can be something
like

(
cmd1
r=$?
if [ "$r" -gt 128 ] && [ "$(kill -l "$r")" = PIPE ]; then
exit 0
else
exit "$r"
fi
) | head

PR: 224270
Relnotes: yes

5 years agoMFC r328818: sh: Refactor job status printing, preparing for -o pipefail and
jilles [Tue, 26 Mar 2019 21:30:26 +0000 (21:30 +0000)]
MFC r328818: sh: Refactor job status printing, preparing for -o pipefail and
similar

No functional change is intended.

PR: 224270

5 years agoMFC r327475: sh: Move various structs from jobs.h to jobs.c
jilles [Tue, 26 Mar 2019 20:47:30 +0000 (20:47 +0000)]
MFC r327475: sh: Move various structs from jobs.h to jobs.c

These implementation details of jobs.c need not be exposed.

PR: 224270

5 years agoMFC r342961:
hselasky [Tue, 26 Mar 2019 13:52:46 +0000 (13:52 +0000)]
MFC r342961:
snd_uaudio: Add quirks for Edirol UA-25EX in advanced driver mode.

Extend the vendor class USB audio quirk to cover devices without
the USB audio control descriptor.

PR: 234794
Sponsored by: Mellanox Technologies

5 years agoMFC r343352:
hselasky [Tue, 26 Mar 2019 13:49:44 +0000 (13:49 +0000)]
MFC r343352:
Add USB quirk.

Submitted by: Gary Jennejohn <gljennjohn@gmail.com>
Sponsored by: Mellanox Technologies

5 years agoMFC r344795:
hselasky [Tue, 26 Mar 2019 13:46:00 +0000 (13:46 +0000)]
MFC r344795:
Fix typos in libusb.

Found by: Denis Ahrens <denis@h3q.com>
Sponsored by: Mellanox Technologies

5 years agoMFC r345011:
hselasky [Tue, 26 Mar 2019 13:43:32 +0000 (13:43 +0000)]
MFC r345011:
Eliminate useless warning message when reading sysctl node in mlx4core.

Sponsored by: Mellanox Technologies

5 years agoMFC r345010:
hselasky [Tue, 26 Mar 2019 13:41:27 +0000 (13:41 +0000)]
MFC r345010:
Improve support for switching to and from command polling mode in mlx4core.

Make sure the enter and leave polling routines can be called multiple times
with same setting. Ignore setting polling or event mode twice. This fixes a
deadlock during shutdown if polling mode was already selected.

Sponsored by: Mellanox Technologies

5 years agoMFC r344920:
hselasky [Tue, 26 Mar 2019 13:38:49 +0000 (13:38 +0000)]
MFC r344920:
Teardown ifnet after stopping port in the mlx4en(4) driver.

mlx4_en_stop_port() calls mlx4_en_put_qp() which can refer the link level
address of the network interface, which in turn will be freed by the
network interface detach function. Make sure the port is stopped
before detaching the network interface.

Sponsored by: Mellanox Technologies

5 years agoMFC r344919:
hselasky [Tue, 26 Mar 2019 13:35:23 +0000 (13:35 +0000)]
MFC r344919:
Don't hold state lock while detaching network device instance in mlx4en(4).

It can happen during shutdown that the lock will recurse when the mlx4en(4)
instance is part of a lagg interface. Call ether_ifdetach() unlocked.

Backtrace:
panic(): _sx_xlock_hard: recursed on non-recursive sx &mdev->state_lock
_sx_xlock_hard()
_sx_xlock()
mlx4_en_ioctl()
if_setlladdr()
lagg_port_destroy()
lagg_port_ifdetach()
if_detach()
mlx4_en_destroy_netdev()
mlx4_en_remove()
mlx4_remove_device()
mlx4_unregister_device()
mlx4_unload_one()
mlx4_shutdown()
linux_pci_shutdown()
bus_generic_shutdown()

Sponsored by: Mellanox Technologies

5 years agoMFC r345442:
kib [Tue, 26 Mar 2019 11:01:29 +0000 (11:01 +0000)]
MFC r345442:
Add UPDATING note for geom_uzip(4)/xz, and bump geom_uzip(4) man page date.

5 years agoMFC: r345387
jkim [Mon, 25 Mar 2019 17:45:47 +0000 (17:45 +0000)]
MFC: r345387

Catch up with Clang 7.0.

5 years agoMFC r345009:
dab [Mon, 25 Mar 2019 17:04:14 +0000 (17:04 +0000)]
MFC r345009:

Fix a scribbler in the PMS driver.

The ESGL bit was left uninitialized when executing the REPORT LUNS
ioctl. This could allow a zeroed data buffer to be treated as a
scatter/gather list. The firmware would eventually walk past the end
of the data buffer, potentially find what looked like a valid
address/length pair, and write the result to semi-random memory.

Obtained from:  Dell EMC Isilon
Sponsored by:   Dell EMC Isilon

5 years agoMFC r345223:
kp [Sat, 23 Mar 2019 07:07:41 +0000 (07:07 +0000)]
MFC r345223:

pf: Rename pfsync bucket lock

Previously the main pfsync lock and the bucket locks shared the same name.
This lead to spurious warnings from WITNESS like this:

    acquiring duplicate lock of same type: "pfsync"
     1st pfsync @ /usr/src/sys/netpfil/pf/if_pfsync.c:1402
     2nd pfsync @ /usr/src/sys/netpfil/pf/if_pfsync.c:1429

It's perfectly okay to grab both the main pfsync lock and a bucket lock at the
same time.

We don't need different names for each bucket lock, because we should always
only acquire a single one of those at a time.

5 years agoMFC 344826:
marcel [Sat, 23 Mar 2019 03:37:08 +0000 (03:37 +0000)]
MFC 344826:

Round # partitions up to fill the last GPT table sector

Set the number of partitions entries in the GPT header to a
multiple of the number of entries that fit in a sector.

PR: 236238
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D19465

5 years agoMFC 344790:
marcel [Sat, 23 Mar 2019 03:10:23 +0000 (03:10 +0000)]
MFC 344790:

Revert revision 254095

In revision 254095, gpt_entries is not set to match the on-disk
hdr_entries, but rather is computed based on available space.
There are 2 problems with this:

1.  The GPT backend respects hdr_entries and only reads and writes
    that number of partition entries.  On top of that, CRC32 is
    computed over the table that has hdr_entries elements.  When
    the common code works on what is possibly a larger number, the
    behaviour becomes inconsistent and problematic.  In particular,
    it would be possible to add a new partition that on a reboot
    isn't there anymore.
2.  The calculation of gpt_entries is based on flawed assumptions.
    The GPT specification does not dictate that sectors are layed
    out in a particular way that the available space can be
    determined by looking at LBAs.  In practice, implementations
    do the same thing, because there's no reason to do it any
    other way.  Still, GPT allows certain freedoms that can be
    exploited in some form or shape if the need arises.

PR: 229977
Differential Revision: https://reviews.freebsd.org/D19438

5 years agoMFC r345190:
kib [Fri, 22 Mar 2019 14:49:22 +0000 (14:49 +0000)]
MFC r345190:
Provide deterministic (and somewhat useful) value for RDPID result,
and for %ecx after RDTSCP.

5 years agoMFC r343530, r344559
asomers [Thu, 21 Mar 2019 22:40:05 +0000 (22:40 +0000)]
MFC r343530, r344559

r343530:
ifconfig: fix endianness bug displaying pfsync interfaces

Reviewed by: kp
Differential Revision: https://reviews.freebsd.org/D19005

r344559:
ifconfig: eliminate trailing whitespace

Eliminate trailing whitespace on inet, inet6, and groups lines. I think the
"list txpower" command will still show some, but I'm not able to test that.

PR: 153731
Reported-by: Nikolay Denev <ndenev@gmail.com>
Differential Revision: https://reviews.freebsd.org/D19004

5 years agoMFC r300938, r342154
asomers [Thu, 21 Mar 2019 22:25:36 +0000 (22:25 +0000)]
MFC r300938, r342154

r300938:
Remove the sa(8) tests if MK_ACCT == no when "make delete-old" is run

sa(8) is conditionally installed based on MK_ACCT != no today

Sponsored by: EMC / Isilon Storage Division

r342154:
OptionalObsoleteFiles: Fix deleting usr/tests/usr.sbin/sa

It's a directory, not a file.

Reported by: ngie
X-MFC-With: 300938

5 years agoMFC r341390, r341392, r341667
asomers [Thu, 21 Mar 2019 22:23:52 +0000 (22:23 +0000)]
MFC r341390, r341392, r341667

r341390:
Remove some dead code from the geli tests

This is detritus in the Makefile, leftover from 327662.

r341392:
Unbreak geli/gmirror testcases if their geom classes cannot be loaded

The problem with the logic prior to this commit was twofold:

1. The wrong set of idioms (TAP-compatible) were being applied to the ATF
   testcases when run, resulting in confusing ATF failure results on setup.
2. The cleanup subroutines were broken when the geom classes could not be
   loaded as they exited with 0 unexpectedly.

This commit changes the test code to source the class-specific configuration
(conf.sh) once globally, instead of sourcing it per testcase and per cleanup
subroutine, and to call the ATF-specific setup subroutine(s) inline in
the testcases.

The refactoring done is effectively a no-op for the TAP testcases, modulo
any refactoring done to create common code between the ATF and TAP
testcases.

This unbreaks the geli testcases converted to ATF in r327662 and r327683,
and the gmirror testcases added in r327780, respectively, when the geom
class could not be loaded.

tests/sys/geom/class/mirror/...
    While here, ignore errors when turning debug failpoint sysctl off, which
    could occur if the gmirror class was not loaded.

Submitted by: ngie
Pull Request: https://github.com/freebsd/freebsd/pull/241

r341667:
geom tests: Fix cleanup of ATF tests since r341392

r341392 changed common test cleanup routines in a way that allowed them to
be used by TAP tests as well as ATF tests.  However, a late change made
during code review resulted in cleanup being broken for ATF tests, which
source geom_subr.sh separately during the body and cleanup phases of the
test.  The result was that md(4) devices wouldn't get cleaned up.

X-MFC-With: 341392

5 years agoMFC r340988:
asomers [Thu, 21 Mar 2019 22:18:22 +0000 (22:18 +0000)]
MFC r340988:

vfs_aio.c: rename "physio" symbols to "bio".

aio has two paths: an asynchronous "physio" path and a synchronous path.
Confusingly, physio(9) isn't actually used by the "physio" path, and never
has been.  In fact, it may even be called by the synchronous path!  Rename
the "physio" path to the "bio" path to reflect what it actually does:
directly compose BIOs and send them to character devices.

5 years agoMFC r340455, r340525, r341598
asomers [Thu, 21 Mar 2019 21:56:03 +0000 (21:56 +0000)]
MFC r340455, r340525, r341598

r340455:
fcntl.2: document an additional error condition

r340525:
mount_fusefs.8: expand HISTORY section

Note that fuse was available from ports long before joining the base system.
Also, update the upstream URL.

r341598:
stat(2): clarify which syscalls modify file timestamps

The list of syscalls that modify st_atim, st_mtim, and st_ctim was quite out
of date and probably not accurate to begin with.  Update it, and make it
clear that the list is open-ended.

Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D18410

5 years agoMFC r336609:
asomers [Thu, 21 Mar 2019 21:45:18 +0000 (21:45 +0000)]
MFC r336609:

Fix several Coverity warnings in tftp

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

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

Reported by: Coverity
CID: 100679310067941006796100674110093141018035
CID: 1018036

5 years agoMFC r345366:
kp [Thu, 21 Mar 2019 14:17:12 +0000 (14:17 +0000)]
MFC r345366:

pf: Ensure that IP addresses match in ICMP error packets

States in pf(4) let ICMP and ICMP6 packets pass if they have a
packet in their payload that matches an exiting connection.  It was
not checked whether the outer ICMP packet has the same destination
IP as the source IP of the inner protocol packet.  Enforce that
these addresses match, to prevent ICMP packets that do not make
sense.

Reported by: Nicolas Collignon, Corentin Bayet, Eloi Vanderbeken, Luca Moro at Synacktiv
Obtained from: OpenBSD
Security: CVE-2019-5598

5 years agoMFC r345130,r345184: trim(8): add another safety net and more user-friendly
eugen [Thu, 21 Mar 2019 11:32:52 +0000 (11:32 +0000)]
MFC r345130,r345184: trim(8): add another safety net and more user-friendly
error message in verbose mode.

5 years agoMFC r344479 (by sobomax), r344605:
kib [Wed, 20 Mar 2019 18:49:45 +0000 (18:49 +0000)]
MFC r344479 (by sobomax), r344605:
Modularize xz.

5 years agoMFC r345078:
kib [Wed, 20 Mar 2019 13:13:50 +0000 (13:13 +0000)]
MFC r345078:
hwpmc/core: Adopt to upcoming Skylake TSX errata.

5 years agoMFC r34505: freebsd-update: restore old exit code when no updates are available
gahr [Wed, 20 Mar 2019 10:20:48 +0000 (10:20 +0000)]
MFC r34505: freebsd-update: restore old exit code when no updates are available
locally

This unbreaks ezjail and iocell, which get into an endless loop trying to
figure out how many times "freebsd-update install" needs to be called.

PR: 229346
Submitted by: Mike Cole <mcole36 at gmail.com>
Approved by: bapt

5 years agoMFC r345087: Use consistent struct stat arg name in stat man page
emaste [Wed, 20 Mar 2019 03:50:45 +0000 (03:50 +0000)]
MFC r345087: Use consistent struct stat arg name in stat man page

stat, lstat, and fstat use `*sb` as the stat struct pointer arg name,
while fstatat previously used `*buf`.

5 years agoif_tun: Fix MFC r344794:
kp [Wed, 20 Mar 2019 01:55:24 +0000 (01:55 +0000)]
if_tun: Fix MFC r344794:

VNET_DEFINE_STATIC does not exist on stable/11, so we should use 'static
VNET_DEFINE' instead.

5 years agoPartially MFC r345079 + direct commit to stable/11.
cy [Tue, 19 Mar 2019 19:57:37 +0000 (19:57 +0000)]
Partially MFC r345079 + direct commit to stable/11.

The MFC updates tools/build/mk/OptionalObsoleteFiles.inc.

The direct commit updates etc/rc.d/Makefile becasue this file was moved
in HEAD to libexec/rc/rc.d/Makefile, making svn merge impossible.

The original log message follows:

Fix still installing ipfilter rc.d files even when WITHOUT_IPFILTER
is specified.

When WITHOUT_IPFILTER is specified, delete-old-files fails to delete
the optional rc.d files from above. Fix this.

WITHOUT_IPFILTER fails to delete the ipfilter.5 optional file during
delete-old-files. Fix this.

Reported by: Dmitry Luhtionov <dmitryluhtionov@gmail.com>

5 years agoMFC r344794:
kp [Tue, 19 Mar 2019 00:27:48 +0000 (00:27 +0000)]
MFC r344794:

tun: VIMAGE fix for if_tun cloner

The if_tun cloner is not virtualised, but if_clone_attach() does use a
virtualised list of cloners.
The result is that we can't find the if_tun cloner when we try to remove
a renamed tun interface. Virtualise the cloner, and move the final
cleanup into a sysuninit so that we're sure this happens after all of
the vnet_sysuninits

Note that we need unit numbers to be system-unique (rather than unique
per vnet, as is done by if_clone_simple()). The unit number is used to
create the corresponding /dev/tunX device node, and this node must match
with the interface.
Switch to if_clone_advanced() so that we have control over the unit
numbers.

Reproduction scenario:
jail -c -n foo persist vnet
jexec test ifconfig tun create
jexec test ifconfig tun0 name wg0
jexec test ifconfig wg0 destroy

PR: 235704
Reviewed by: bz, hrs, hselasky
Differential Revision: https://reviews.freebsd.org/D19248

5 years agoMFC r345189:
kib [Mon, 18 Mar 2019 10:28:40 +0000 (10:28 +0000)]
MFC r345189:
Add symbolic name for TSC_AUX MSR address.

5 years agoMFC r345004 (with modification):
ae [Mon, 18 Mar 2019 09:31:23 +0000 (09:31 +0000)]
MFC r345004 (with modification):
  Add IP_FW_NAT64 to codes that ipfw_chk() can return.

  It will be used by upcoming NAT64 changes. We use separate code
  to avoid propogating EACCES error code to user level applications
  when NAT64 consumes a packet.

  Obtained from: Yandex LLC
  Sponsored by: Yandex LLC

5 years agoMFC r345003:
ae [Mon, 18 Mar 2019 09:23:15 +0000 (09:23 +0000)]
MFC r345003:
  Add NULL pointer check to nat64_output().

  It is possible that a processed packet was originated by local host,
  in this case m->m_pkthdr.rcvif is NULL. Check and set it to V_loif to
  avoid NULL pointer dereference in IP input code, since it is expected
  that packet has valid receiving interface when netisr processes it.

  Obtained from:        Yandex LLC
  Sponsored by: Yandex LLC

5 years agoMFC r344745:
avos [Mon, 18 Mar 2019 02:58:34 +0000 (02:58 +0000)]
MFC r344745:
urtwn(4): fix Tx instability with RTL8192CU chipsets

PR: 233949

5 years agoMFC r345075:
kib [Fri, 15 Mar 2019 18:53:36 +0000 (18:53 +0000)]
MFC r345075:
Add register number, CPUID bits, and print identification for TSX
force abort errata.

5 years agoMFC r345074:
kib [Fri, 15 Mar 2019 18:50:00 +0000 (18:50 +0000)]
MFC r345074:
Remove useless version check.

5 years agoMFC r342214:
markj [Fri, 15 Mar 2019 15:16:31 +0000 (15:16 +0000)]
MFC r342214:
Remove a use of a negative array index from fxp(4).

5 years agoMFC r344921:
kp [Fri, 15 Mar 2019 11:01:52 +0000 (11:01 +0000)]
MFC r344921:

pf: Fix DIOCGETSRCNODES

r343295 broke DIOCGETSRCNODES by failing to reset 'nr' after counting the
number of source tracking nodes.
This meant that we never copied the information to userspace, leading to '? ->
?' output from pfctl.

PR: 236368

5 years agoMFC r344748:
avos [Fri, 15 Mar 2019 08:18:02 +0000 (08:18 +0000)]
MFC r344748:
Allow to build ifconfig(8) without wireless support

The change removes SIOC[GS]IEEE80211 handling from ifconfig(8)
if WITHOUT_WIRELESS_SUPPORT=yes is set in src.conf(5).

Reviewed by: bz
Differential Revision: https://reviews.freebsd.org/D19289

5 years agoMFC r344873:
ae [Thu, 14 Mar 2019 08:27:01 +0000 (08:27 +0000)]
MFC r344873:
  Fix typo.

5 years agoMFC r344903: Improve entropy for ZFS taskqueue selection.
mav [Thu, 14 Mar 2019 00:58:57 +0000 (00:58 +0000)]
MFC r344903: Improve entropy for ZFS taskqueue selection.

I just found that at least on Skylake CPUs cpu_ticks() never returns odd
values, only even, and possibly has even bigger step (176/2?), that makes
its lower bits very bad entropy source, leaving half of taskqueues unused.
Switch to sbinuptime(), closer to upstreams, mitigates the problem by the
rate conversion working as kind of hash function.  In case that is somehow
not enough (timer rate is too low or too divisible) mix in curcpu.

5 years agoMFC r344866: Add respective tunables to few ZFS sysctls.
mav [Thu, 14 Mar 2019 00:57:54 +0000 (00:57 +0000)]
MFC r344866: Add respective tunables to few ZFS sysctls.