FreeBSD/src 718519fsys/contrib/openzfs/include/sys brt_impl.h, sys/contrib/openzfs/module/os/freebsd/zfs zfs_vnops_os.c

zfs: merge openzfs/zfs at d0a91b9f8

Notable upstream pull request merges:
 #16643 -multiple Change rangelock handling in FreeBSD's zfs_getpages()
 #16697 46c4f2ce0 dsl_dataset: put IO-inducing frees on the pool deadlist
 #16740 -multiple BRT: Rework structures and locks to be per-vdev
 #16743 a60ed3822 L2ARC: Move different stats updates earlier
 #16758 8dc452d90 Fix some nits in zfs_getpages()
 #16759 534688948 Remove hash_elements_max accounting from DBUF and ARC
 #16766 9a81484e3 ZAP: Reduce leaf array and free chunks fragmentation
 #16773 457f8b76e BRT: More optimizations after per-vdev splitting
 #16782 0ca82c568 L2ARC: Stop rebuild before setting spa_final_txg
 #16785 d76d79fd2 zio: Avoid sleeping in the I/O path
 #16791 ae1d11882 BRT: Clear bv_entcount_dirty on destroy
 #16796 b3b0ce64d FreeBSD: Lock vnode in zfs_ioctl()
 #16797 d0a91b9f8 FreeBSD: Reduce copy_file_range() source lock to shared

Obtained from:  OpenZFS
OpenZFS commit: d0a91b9f88a47316158508bf304a61baa8c99c10
DeltaFile
+474-664sys/contrib/openzfs/module/zfs/brt.c
+50-58sys/contrib/openzfs/include/sys/brt_impl.h
+63-45sys/contrib/openzfs/module/zfs/zap_leaf.c
+62-19sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vnops_os.c
+58-10sys/contrib/openzfs/module/zfs/zap_micro.c
+49-17sys/contrib/openzfs/module/zfs/arc.c
+756-81331 files not shown
+958-90937 files

FreeBSD/src a46c121tests/sys/netpfil/common dummynet.sh

netpfil tests: make dummynet tests more robust

These tests try to verify that packet prioritisation works as expected. This is
inherently a statistical process, and is difficuly to measure automatically.
Run the tests more times and accept more failures.

Sponsored by:   Rubicon Communications, LLC ("Netgate")
DeltaFile
+6-6tests/sys/netpfil/common/dummynet.sh
+6-61 files

FreeBSD/src 7390dafsys/dev/e1000 em_txrx.c igb_txrx.c

e1000: Style txrx

Fix up indentation and reflow long lines.

MFC after:      3 days
Sponsored by:   BBOX.io
DeltaFile
+34-21sys/dev/e1000/em_txrx.c
+26-18sys/dev/e1000/igb_txrx.c
+2-1sys/dev/e1000/if_em.c
+62-403 files

FreeBSD/src c7fb7b5sys/dev/igc igc_txrx.c

igc: Style pass igc_txrx

Fix up indentation and reflow long lines.

MFC after:      3 days
Sponsored by:   BBOX.io
DeltaFile
+27-18sys/dev/igc/igc_txrx.c
+27-181 files

FreeBSD/src c58d34dsys/dev/ixgbe if_ix.c if_ixv.c

ixgbe: Style pass on FreeBSD part of driver

Fix up some indentation and reflow long lines

MFC after:      3 days
Sponsored by:   BBOX.io
DeltaFile
+469-345sys/dev/ixgbe/if_ix.c
+137-117sys/dev/ixgbe/if_ixv.c
+56-54sys/dev/ixgbe/if_bypass.c
+57-49sys/dev/ixgbe/ix_txrx.c
+30-29sys/dev/ixgbe/if_sriov.c
+12-12sys/dev/ixgbe/if_fdir.c
+761-6061 files not shown
+765-6107 files

FreeBSD/src 9efc732sys/dev/igc if_igc.c

igc: Reflow long lines

MFC after:      3 days
Sponsored by:   BBOX.io
DeltaFile
+98-55sys/dev/igc/if_igc.c
+98-551 files

FreeBSD/src 6f14883sys/dev/e1000 if_em.c

e1000: Style pass on if_em

Fix up some indentation and reflow long lines

MFC after:      3 days
Sponsored by:   BBOX.io
DeltaFile
+619-426sys/dev/e1000/if_em.c
+619-4261 files

FreeBSD/src 27f62dfsys/dev/igc if_igc.c igc_regs.h

igc: sysctl for TCP flag handling during TSO

Add tso_tcp_flags_mask_first_segment, tso_tcp_flags_mask_middle_segment,
and tso_tcp_flags_mask_last_segment sysctl-variables to control the
handling of TCP flags during TSO.

This allows to change the masks appropriate for classical ECN and to
configure appropriate masks for accurate ECN.

Sponsored by:   Netflix

(cherry picked from commit ab540d44ba3201ff8313b90ba0096004603b2e34)
DeltaFile
+59-0sys/dev/igc/if_igc.c
+2-0sys/dev/igc/igc_regs.h
+61-02 files

FreeBSD/src 367e42asys/dev/e1000 if_em.c

e1000: sysctl for TCP flag handling during TSO

Add tso_tcp_flags_mask_first_segment, tso_tcp_flags_mask_middle_segment,
and tso_tcp_flags_mask_last_segment sysctl-variables to control the
handling of TCP flags during TSO.

This allows to change the masks appropriate for classical ECN and to
configure appropriate masks for accurate ECN.

Reviewed by:    rrs
Sponsored by:   Netflix
Differential Revision:  https://reviews.freebsd.org/D44259

(cherry picked from commit 90853dfac851afa9e8840f5a38383256d75458b6)
DeltaFile
+56-0sys/dev/e1000/if_em.c
+56-01 files

FreeBSD/src e5149acsys/dev/ixgbe if_ix.c

ixgbe: sysctl for TCP flag handling during TSO

Add tso_tcp_flags_mask_first_segment, tso_tcp_flags_mask_middle_segment,
and tso_tcp_flags_mask_last_segment sysctl-variables to control the
handling of TCP flags during TSO.

This allows to fix the masks appropriate for classical ECN and to
configure appropriate masks for accurate ECN.

Michael notes emperically 82599 has an unexpected middle mask:
Chip  First Middle Last
82599 0xFF6 0xFF6  0xF7F

which should be fixed up to 0xF76 (RFC 3168) in a future commit.

Reviewed by:    rrs, rscheff
Sponsored by:   Netflix
Differential Revision:  https://reviews.freebsd.org/D44258

(cherry picked from commit eea2e089f8dadf850a30ed837edd7a386427a9ed)
DeltaFile
+56-0sys/dev/ixgbe/if_ix.c
+56-01 files

FreeBSD/src 6890e1esys/dev/igc if_igc.c igc_regs.h

igc: sysctl for TCP flag handling during TSO

Add tso_tcp_flags_mask_first_segment, tso_tcp_flags_mask_middle_segment,
and tso_tcp_flags_mask_last_segment sysctl-variables to control the
handling of TCP flags during TSO.

This allows to change the masks appropriate for classical ECN and to
configure appropriate masks for accurate ECN.

Sponsored by:   Netflix

(cherry picked from commit ab540d44ba3201ff8313b90ba0096004603b2e34)
DeltaFile
+59-0sys/dev/igc/if_igc.c
+2-0sys/dev/igc/igc_regs.h
+61-02 files

FreeBSD/src 9a89886sys/dev/e1000 if_em.c

e1000: sysctl for TCP flag handling during TSO

Add tso_tcp_flags_mask_first_segment, tso_tcp_flags_mask_middle_segment,
and tso_tcp_flags_mask_last_segment sysctl-variables to control the
handling of TCP flags during TSO.

This allows to change the masks appropriate for classical ECN and to
configure appropriate masks for accurate ECN.

Reviewed by:    rrs
Sponsored by:   Netflix
Differential Revision:  https://reviews.freebsd.org/D44259

(cherry picked from commit 90853dfac851afa9e8840f5a38383256d75458b6)
DeltaFile
+56-0sys/dev/e1000/if_em.c
+56-01 files

FreeBSD/src 52ff9ccsys/dev/ixgbe if_ix.c

ixgbe: sysctl for TCP flag handling during TSO

Add tso_tcp_flags_mask_first_segment, tso_tcp_flags_mask_middle_segment,
and tso_tcp_flags_mask_last_segment sysctl-variables to control the
handling of TCP flags during TSO.

This allows to fix the masks appropriate for classical ECN and to
configure appropriate masks for accurate ECN.

Michael notes emperically 82599 has an unexpected middle mask:
Chip  First Middle Last
82599 0xFF6 0xFF6  0xF7F

which should be fixed up to 0xF76 (RFC 3168) in a future commit.

Reviewed by:    rrs, rscheff
Sponsored by:   Netflix
Differential Revision:  https://reviews.freebsd.org/D44258

(cherry picked from commit eea2e089f8dadf850a30ed837edd7a386427a9ed)
DeltaFile
+56-0sys/dev/ixgbe/if_ix.c
+56-01 files

FreeBSD/src d1bb1a5sys/dev/igc if_igc.c

igc: Normalize indentation a bit

MFC after:      3 days
Sponsored by:   BBOX.io
DeltaFile
+147-147sys/dev/igc/if_igc.c
+147-1471 files

FreeBSD/src bceec3dsys/dev/e1000 if_em.c e1000_phy.c

e1000: Try auto-negotiation for fixed 100 or 10 configuration

This is a retread of https://reviews.freebsd.org/D34449 which I think
will fix the issue for the remote side not supporting autoneg.  We now
attempt an autoneg, and if that fails fall back to the current code
that forces the link speed/duplex.

The original intent of this patch is to inform the remote switch of
duplex settings when we (the client) are specifying a fixed 10 or 100
speed.  Otherwise it may get the duplex setting wrong.

The tricky case is when the remote (switch) side is fixing its
speed AND duplex while disabling autoneg and we (client) need to do
the same, which still seems to be common enough at some ISPs.

Original commit message follows:
Currently if an e1000 interface is set to a fixed media configuration,
for gigabit, it will participate in auto-negotiation as required by
IEEE 802.3-2018 Clause 37. However, if set to fixed media configuration

    [35 lines not shown]
DeltaFile
+38-6sys/dev/e1000/if_em.c
+3-2sys/dev/e1000/e1000_phy.c
+41-82 files

FreeBSD/src d0a91b9module/os/freebsd/zfs zfs_vnops_os.c

FreeBSD: Reduce copy_file_range() source lock to shared

Linux locks copy_file_range() source as shared.  FreeBSD was doing
it also, but then was changed to exclusive, partially because KPI
of that time was doing so, and partially seems out of caution.
Considering zfs_clone_range() uses range locks on both source and
destination, neither should require exclusive vnode locks. But one
step at a time, just sync it with Linux for now.

Reviewed-by: Alan Somers <asomers at gmail.com>
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by:  Alexander Motin <mav at FreeBSD.org>
Sponsored by:   iXsystems, Inc.
Closes #16789
Closes #16797
DeltaFile
+1-1module/os/freebsd/zfs/zfs_vnops_os.c
+1-11 files

FreeBSD/src b3b0ce6include/os/freebsd/spl/sys vnode.h, module/os/freebsd/zfs zfs_vnops_os.c

FreeBSD: Lock vnode in zfs_ioctl()

Previously vnode was not locked there, unlike Linux.  It required
locking it in vn_flush_cached_data(), which recursed on the lock
if called from zfs_clone_range(), having the vnode locked.

Reviewed-by: Alan Somers <asomers at gmail.com>
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Alexander Motin <mav at FreeBSD.org>
Sponsored by: iXsystems, Inc.
Closes #16789
Closes #16796 
DeltaFile
+0-4include/os/freebsd/spl/sys/vnode.h
+4-0module/os/freebsd/zfs/zfs_vnops_os.c
+4-42 files

FreeBSD/src b4ede68usr.bin/find find.1

find: Correct ls(1) equivalent command for -ls primary

After commit 3bfbb521fef5, -g stopped being a no-op.  The -g hasn't
been required for equivalent output since 4.4BSD.

PR:             282901
Fixes:          3bfbb521 ls: Improve POSIX compatibility for -g and -n.
DeltaFile
+2-2usr.bin/find/find.1
+2-21 files

FreeBSD/src b4c700fsys/kern subr_bus.c

new-bus: Fix some shortcomings in disabling devices via hints

A device can be disabled via a hint after it is probed (but before it
is attached).  The initial version of this marked the device disabled,
but left the device "alive" meaning that dev->driver and dev->desc
were untouched and still pointed into the driver that probed the
device.  If that driver lives in a kernel module that is later
unloaded, device_detach() called from devclass_delete_driver() doesn't
do anything (the device's state is DS_ALIVE).  In particular, it
doesn't call device_set_driver(dev, NULL) to disassociate the device
from the driver that is being unloaded.

There are several places where these stale pointers can be tripped
over.  After kldunload, invoking the sysctl to fetch device info can
dereference dev->desc and dev->driver causing panics.  Even without
kldunload, a system suspend request will call the device_suspend and
device_resume DEVMETHODs of the driver in question even though the
device is not attached which can cause some excitement.


    [17 lines not shown]
DeltaFile
+15-6sys/kern/subr_bus.c
+15-61 files

FreeBSD/src 9ad8116sys/kern kern_dump.c

kerneldump: fix incorrect SETSIZE to BIT_COPY_STORE_REL when livedump

Also replace malloc/free with BITSET_ALLOC/BITSET_FREE macros.

Sponsored by:   Juniper Networks, Inc.
MFC after:      1 week
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D47708
DeltaFile
+5-5sys/kern/kern_dump.c
+5-51 files

FreeBSD/src 7749de2share/man/man4 vt.4, sys/dev/vt vt_core.c

Add new kern.vt.slow_down tunable.

On a laptop with no other console devices than the screen, things
scroll of the screen faster than eye or camera can capture it.

This tunable slows the console down and makes it update synchronously,
so console output continues when timers or interrupts do not.

Differential Revision:  https://reviews.freebsd.org/D47710
DeltaFile
+11-0share/man/man4/vt.4
+9-0sys/dev/vt/vt_core.c
+20-02 files

FreeBSD/src e012d79sys/netpfil/ipfw ip_fw_table_algo.c

ipfw: fix order of memcpy arguments.

This fixes `ipfw table N lookup addr` command for MAC tables.

MFC after:      1 week
DeltaFile
+1-1sys/netpfil/ipfw/ip_fw_table_algo.c
+1-11 files

FreeBSD/src 253a1fasys/dev/mlx5 driver.h, sys/dev/mlx5/mlx5_core mlx5_eq.c

mlx5: Fix handling of port_module_event

Remove the array of port module status and instead save module status
and module number.

At boot, for each PCI function driver get event from fw about module
status. The event contains module number and module status. Driver
stores module number and module status..  When user (ifconfig) ask for
modules information, for each pci function driver first queries fw to
get module number of current pci function, then driver compares the
module number to the module number it stored before and if it matches
and module status is "plugged and enabled" then driver queries fw for
the eprom information of that module number and return it to the
caller.

In fact fw could have concluded that required module number of the
current pci function, but fw is not implemented this way. current
design of PRM/FW is that MCIA register handling is only aware of
modules, not the pci function->module connections.  FW is designed to

    [8 lines not shown]
DeltaFile
+5-5sys/dev/mlx5/mlx5_core/mlx5_eq.c
+2-1sys/dev/mlx5/driver.h
+7-62 files

FreeBSD/src 0d38b0bsys/dev/mlx5/mlx5_en mlx5_en_hw_tls.c

mlx5en: fix the sign of mlx5e_tls_st_init() error, convert from Linux to BSD

Sponsored by:   NVidia networking
MFC after:      1 week
DeltaFile
+2-2sys/dev/mlx5/mlx5_en/mlx5_en_hw_tls.c
+2-21 files

FreeBSD/src 7fbc896sys/vm vm_page.c

vm_page.c: remove transiently defined vm_page_free_toq_impl() prototype

Sponsored by:   The FreeBSD Foundation
DeltaFile
+0-1sys/vm/vm_page.c
+0-11 files

FreeBSD/src 64bf5a4sys/dev/mlx5/mlx5_en mlx5_en_hw_tls.c

mlx5_en: style function prototype

Sponsored by:   NVidia networking
MFC after:      2 weeks
DeltaFile
+1-2sys/dev/mlx5/mlx5_en/mlx5_en_hw_tls.c
+1-21 files

FreeBSD/src 81b38bcsys/dev/mlx5/mlx5_en mlx5_en_hw_tls.c en_hw_tls.h

mlx5e tls: Ensure all allocated tags have a hw context associated

Ensure all allocated tags have a hardware context associated.
The hardware context allocation is moved into the zone import
routine, as suggested by kib.  This is safe because these zone
allocations are always done in a sleepable context.

I have removed the now pointless num_resources tracking,
and added sysctls / tunables to control UMA zone limits
for these tls tags, as well as a tunable to let the
driver pre-allocate tags at boot.

MFC after:      2 weeks
DeltaFile
+94-38sys/dev/mlx5/mlx5_en/mlx5_en_hw_tls.c
+1-1sys/dev/mlx5/mlx5_en/en_hw_tls.h
+95-392 files

FreeBSD/src 33c11ceshare/man/man4 igc.4

igc.4: Remove non-existent timer tunables

These were removed in a40ecb6f7405 because they do not apply to igc
hardware which uses EITR for interval timing.

Sponsored by:   BBOX.io

(cherry picked from commit 8de007ad19dcda5bea9bac9fb2c140e4ed62ba78)
DeltaFile
+0-15share/man/man4/igc.4
+0-151 files

FreeBSD/src 974d9c5sys/dev/ixgbe ixgbe_phy.c

ixgbe: Add support for 1Gbit Active DAC links

1Gbit also emperically works on Active DACs.

Sponsored by:   BBOX.io

(cherry picked from commit e38f9257c3fac5cb5a62f62c424a976446ae1220)
DeltaFile
+2-1sys/dev/ixgbe/ixgbe_phy.c
+2-11 files

FreeBSD/src cb8d81ashare/man/man4 igc.4

igc.4: Remove non-existent timer tunables

These were removed in a40ecb6f7405 because they do not apply to igc
hardware which uses EITR for interval timing.

Sponsored by:   BBOX.io

(cherry picked from commit 8de007ad19dcda5bea9bac9fb2c140e4ed62ba78)
DeltaFile
+0-15share/man/man4/igc.4
+0-151 files