FreeBSD/src a108ee9sys/dev/igc igc_regs.h igc_mac.c

igc: Correct hardware error statistics

Track RERC separately instead of adding receive errors to the collision
count, and read the previously omitted RXERRC register.  Include RFC in
input errors because CRCERRS does not count bad-CRC runts, implementing
the I225 length-error accounting workaround alongside RUC and ROC.

Stop treating host transmit MAC discards as receive errors.  Expose both
RERC and HTDPMC as dedicated MAC statistics so their overlapping counts
remain available without corrupting aggregate interface counters.

MFC after:      2 weeks
DeltaFile
+14-3sys/dev/igc/if_igc.c
+1-0sys/dev/igc/igc_regs.h
+1-0sys/dev/igc/igc_mac.c
+1-0sys/dev/igc/igc_hw.h
+17-34 files

FreeBSD/src 7094265sys/dev/igc igc_defines.h if_igc.c

igc: Work around I225 v1 minimum IPG erratum

I225 v1 cannot receive the minimum inter-packet gap required at
2.5 Gb/s.  For affected back-to-back links, Intel recommends using a
15-byte transmit IPG instead of 12 bytes.

Program TIPG.IPGT to 0xb for pre-v2 I225 devices at 2.5 Gb/s and
restore the default at lower speeds.  Avoid penalizing fixed I225 and
I226 parts.

MFC after:      2 weeks
DeltaFile
+29-0sys/dev/igc/if_igc.c
+1-0sys/dev/igc/igc_defines.h
+30-02 files

FreeBSD/src 1c91c3asys/dev/e1000 if_igb_iov.c

igb: recover retained i350 admin interrupts

I350 can retain EICR.OTHER with MDDET and LVMMC asserted while the
admin vector and legacy cause remain enabled. The anti-spoof filter
continues dropping packets, but no MSI-X is delivered and the spoof
diagnostic is lost.

Preserve the one-shot setup drain across iflib reset preparation,
clear ICR before LVMMC during i350 setup, and kick the enabled admin
vector from each admin pass. The synthetic no-cause interrupt stays
in the filter and also releases a retained MDDET cause.

Keep 82576 drain ordering and stop-time cleanup unchanged.
DeltaFile
+31-3sys/dev/e1000/if_igb_iov.c
+31-31 files

FreeBSD/src 176259esys/dev/e1000 if_em.h if_em.c

igb: drain stale MDD state before interrupt arm

IOV policy setup can leave MDDET and its read-clear diagnostic
registers populated while the admin vector is masked. Carrying that
state across the unmask can suppress the next spoof-event edge.

Mark initialization for a one-shot drain and consume LVMMC, WVBR when
applicable, and ICR immediately before EIMS/IMS arms the vector.
Preserve the synthetic link-status cause across the arm-time ICR read,
and clear the one-shot latch at reset preparation.
DeltaFile
+50-0sys/dev/e1000/if_igb_iov.c
+2-0sys/dev/e1000/if_igb_iov.h
+1-0sys/dev/e1000/if_em.h
+1-0sys/dev/e1000/if_em.c
+54-04 files

FreeBSD/src ac2be06sys/dev/e1000 if_em.h if_em.c

igb: preserve coalesced 82576 MDD events

WVBR is read-clear, so reading it from the deferred admin pass loses
earlier queue bits when multiple VF malicious-driver events arrive
before that pass.

Snapshot WVBR in the interrupt filter, translate its staggered queue
bitmap to pool bits, and OR observations into software latches for
deferred notification and recovery.

Retain the one-queue VMDq policy used for mixed-driver safety (the
vswitch cannot handle a 2Q guest loopback to a 1Q guest per errata).
DeltaFile
+65-20sys/dev/e1000/if_igb_iov.c
+1-0sys/dev/e1000/if_em.h
+1-0sys/dev/e1000/if_em.c
+67-203 files

FreeBSD/src 4a28d39sys/dev/igc igc_base.h igc_base.c

igc: Disable PCIe L1.2 on I225

I225 devices can incorrectly enter L1 substates while CLKREQ# is
asserted, both while idle and in D3.  Disable ASPM and PCI-PM L1.2 on
I225 to prevent the resulting packet loss.

Keep the I226 workaround ASPM-only because it addresses a separate
traffic exit latency observation.

PR:             265714
MFC after:      4 days
DeltaFile
+22-20sys/dev/igc/if_igc.c
+29-0sys/dev/igc/igc_base.c
+1-0sys/dev/igc/igc_base.h
+52-203 files

FreeBSD/src a9305a6sys/dev/e1000 if_em.c

e1000: clear VFTA when last VLAN is removed

The conventional VLAN filter update skipped zero shadow words. Removing
the final VLAN represented by a VFTA word therefore left the hardware
bit programmed even though the software shadow was clear.

Pass the changed word to em_if_vlan_filter_write() and write it even
when its new value is zero. Retained nonzero words continue to be
replayed as before.
DeltaFile
+10-5sys/dev/e1000/if_em.c
+10-51 files

FreeBSD/src 3393002sys/fs/nfs nfs_commonkrpc.c

nfs_commonkrpc.c: Handle NFSERR_DELAY for Sequence correctly

Unlike RFC5661 (the original NFSv4.1 RFC), RFC8881 specifies
that a NFS4ERR_DELAY reply to the SEQUENCE operation requires
a reply using the same slot/sequence#.

This patch fixes handling of this case, so it conforms to
RFC8881.

(cherry picked from commit 6901cbbd5a2c00d378a7f87426b36d6ee6ce0aa2)
DeltaFile
+14-1sys/fs/nfs/nfs_commonkrpc.c
+14-11 files

FreeBSD/src 25d1f68sys/fs/nfs nfs_commonkrpc.c

nfs_commonkrpc.c: Handle NFSERR_DELAY for Sequence correctly

Unlike RFC5661 (the original NFSv4.1 RFC), RFC8881 specifies
that a NFS4ERR_DELAY reply to the SEQUENCE operation requires
a reply using the same slot/sequence#.

This patch fixes handling of this case, so it conforms to
RFC8881.

(cherry picked from commit 6901cbbd5a2c00d378a7f87426b36d6ee6ce0aa2)
DeltaFile
+14-1sys/fs/nfs/nfs_commonkrpc.c
+14-11 files

FreeBSD/src 7d24381contrib/netbsd-tests/lib/libpthread t_condwait.c

tests/libpthread: add pthread_cond_clockwait(3) tests

(cherry picked from commit 10ea2300bf29cdcaf12182e8b722f6becb0da1fb)
DeltaFile
+92-18contrib/netbsd-tests/lib/libpthread/t_condwait.c
+92-181 files

FreeBSD/src d62a413share/man/man3 Makefile pthread_cond_timedwait.3

pthread_cond_timedwait.3: document pthread_cond_clockwait(3)

(cherry picked from commit e7015a3834abe0956e9a8ec6ec4b8e75ea7d71ab)
DeltaFile
+30-2share/man/man3/pthread_cond_timedwait.3
+1-0share/man/man3/Makefile
+31-22 files

FreeBSD/src 0aa7237sys/geom/zero g_zero.c

geom_zero(4): reset the uio vector on each uiomove()

PR:     297062

(cherry picked from commit 34ca5a9e7362b0c820fe339daa2b8d06c58b6fea)
DeltaFile
+6-5sys/geom/zero/g_zero.c
+6-51 files

FreeBSD/src ff36771share/man/man3 pthread_cond_timedwait.3

pthread_cond_timedwait.3: use .Fo/.Fc for long arguments list

(cherry picked from commit 6d3db07a2e2f4288b7e54af8e8371f9a022e751f)
DeltaFile
+5-1share/man/man3/pthread_cond_timedwait.3
+5-11 files

FreeBSD/src 4dcfa6dinclude pthread.h, lib/libthr pthread.map

libthr: implement pthread_cond_clockwait(3)

(cherry picked from commit e1136fbcab184b8fb87456ca0d115d502bab6643)
DeltaFile
+48-16lib/libthr/thread/thr_cond.c
+22-6lib/libthr/thread/thr_umtx.c
+4-2lib/libthr/thread/thr_barrier.c
+5-0include/pthread.h
+2-1lib/libthr/thread/thr_umtx.h
+1-0lib/libthr/pthread.map
+82-256 files

FreeBSD/src d32bf06lib/libthr/thread thr_cond.c

libthr/thread/thr_cond.c: some style

(cherry picked from commit 149d3e5fcb76bff86d4343b7378258e9a6d3e25b)
DeltaFile
+11-15lib/libthr/thread/thr_cond.c
+11-151 files

FreeBSD/src 671e2cblib/libsys _umtx_op.2

_umtx_op.2: document the CVWAIT_UMTX_TIME flag for the UMTX_OP_CV_WAIT_UC request

(cherry picked from commit f4a05f37936e422b1e8f4f127253562d3f58f50c)
DeltaFile
+21-2lib/libsys/_umtx_op.2
+21-21 files

FreeBSD/src 0737ff2lib/libthr/thread thr_umtx.c

libthr/thread/thr_umtx.c: style _thr_ucond_wait()

(cherry picked from commit 196cc005b197ab8bf5044c3fc457697986a14b39)
DeltaFile
+3-3lib/libthr/thread/thr_umtx.c
+3-31 files

FreeBSD/src 16015bfsys/kern kern_umtx.c, sys/sys umtx.h

umtx_op(2): add the CVWAIT_UMTX_TIME flag for the UMTX_OP_CV_WAIT_UC request

(cherry picked from commit d738f66fab9208ee3bccea5fed293d8ce3ee5ca3)
DeltaFile
+55-35sys/kern/kern_umtx.c
+1-0sys/sys/umtx.h
+56-352 files

FreeBSD/src c956cc0sys/dev/aq aq_device.h aq_main.c

aq(4): interface lifecycle and link-state fixes

aq_if_init() programmed the address captured at attach, so an address set
with "ifconfig ether" or by lagg(4) enslavement was never written to
unicast filter slot 0: the interface transmitted with the new address but
the MAC still filtered on the old one, so it received nothing.  Copy the
current if_getlladdr() the way the other iflib drivers do.

The link state could latch UP forever.  aq_if_stop() cleared linkup
before calling aq_if_update_admin_status(), which suppressed the
LINK_STATE_DOWN transition the "link was UP" branch would have made.
Announce the down transition directly from aq_if_stop() instead, and do
not poll the admin status there at all: the MAC has just been reset, so a
stale link reading would re-announce the link as up.

The admin task itself had to stop reporting a link on a stopped
interface.  iflib runs it while either IFF_DRV_RUNNING or IFF_DRV_OACTIVE
is set, and iflib_stop() sets OACTIVE, so the task kept polling after the
stop and re-announced LINK_STATE_UP behind the driver's back.  Treat a

    [22 lines not shown]
DeltaFile
+23-6sys/dev/aq/aq_irq.c
+10-2sys/dev/aq/aq_main.c
+1-0sys/dev/aq/aq_device.h
+34-83 files

FreeBSD/src b445000sys/dev/aq aq_device.h aq_fw1x.c

aq(4): mailbox, flow-control and firmware error-handling fixes

Fold the whole-driver-review correctness and hardening fixes for the
firmware and hardware layers.

Advance the firmware-mailbox address per word in aq_hw_fw_downld_dwords():
on B1 silicon each loop iteration waits for the mailbox address register
to differ from the expected address, but it was set once and never moved,
so after the first word every wait returned immediately and read stale
data.  Advance it four bytes per word.  B0 is unaffected (it polls the
busy bit).  The same function also left err set to ETIMEDOUT after
successfully force-recovering the RAM CPU semaphore; the transfer loop is
guarded by "--cnt && !err", so it ran zero iterations and returned a
timeout with an untouched buffer, making the recovery path dead code.

aq_hw_get_mac_permanent() ignored the get_mac_addr() error and then
examined a buffer the firmware op never wrote on failure.  A fresh softc
is zero, so the "invalid address" test fired, a random locally
administered MAC was substituted, and err was overwritten with 0 -- a

    [46 lines not shown]
DeltaFile
+58-27sys/dev/aq/aq_fw2x.c
+26-1sys/dev/aq/aq_irq.c
+15-4sys/dev/aq/aq_main.c
+12-1sys/dev/aq/aq_hw.c
+7-1sys/dev/aq/aq_fw1x.c
+3-0sys/dev/aq/aq_device.h
+121-346 files

FreeBSD/src ae7e2c9sys/dev/aq aq_dbg.c aq_irq.c

aq(4): clean up diagnostics and remove dead code

Non-functional cleanup, no change in behavior.

device_printf() already prefixes each line with the device name, so the
inline "atlantic:" token in the status and error messages produced a
doubled prefix and diverged from the trace macros; remove it so all
output carries one uniform "aqN:" prefix.  Compile the RX/TX descriptor
tracers only when AQ_CFG_DEBUG_LVL > 2 and make them no-op macros
otherwise, so the default build no longer pays a cross-TU call plus
argument evaluation per descriptor.

Drop enum aq_dev_state, struct aq_rx_filters, and struct aq_vlan_tag,
which have no remaining references now that VLAN state lives in a
bitstr_t.  Replace the four identical aq_sysctl_print_{tx,rx}_{head,tail}
handlers, each carrying a dead write path on a read-only oid, with one
aq_sysctl_print_ring_ptr that selects the accessor from arg2.  Reduce the
thermal and PHY-recovery comments to single terse lines that keep the
load-bearing register numbers and the A1-vs-A2 recovery difference.

    [5 lines not shown]
DeltaFile
+42-84sys/dev/aq/aq_main.c
+0-18sys/dev/aq/aq_device.h
+6-0sys/dev/aq/aq_dbg.h
+2-2sys/dev/aq/aq_irq.c
+3-0sys/dev/aq/aq_dbg.c
+53-1045 files

FreeBSD/src b68f466sys/dev/aq aq_hw.c aq_main.c

aq(4): PHY thermal-shutdown handling and correctness fixes

Fold the thermal-protection work and the correctness fixes that landed
alongside it.

Report and auto-recover from PHY thermal shutdown.  The Atlantic PHYs can
autonomously shut down on over-temperature, latching global fault 0x8007
and dropping the link; Atlantic 2 ships this armed, Atlantic 1 disabled.
Arm it on Atlantic 1 at interface init (1E.C478.A via the MAC's MDIO
controller), and recover from a trip automatically: the admin-status poll
detects the fault, logs the shutdown limit and measured temperature, and
holds the link down until the PHY cools, then restores it -- Atlantic 1
needs a PHY reset (1E.2681.0) with the MAC firmware running plus a full
re-init, Atlantic 2 recovers on the re-init alone.  New firmware ops
get_phy_fault, phy_reset, thermal_arm, and get_thermal_limit back the
state machine in aq_if_update_admin_status().

Make that Atlantic 1 thermal MDIO path address-correct and fail-safe.
The direct-MDIO helpers hardcoded the Clause-45 port address to 0, but it

    [29 lines not shown]
DeltaFile
+166-1sys/dev/aq/aq_fw2x.c
+100-3sys/dev/aq/aq_irq.c
+50-1sys/dev/aq/aq2_fw.c
+15-0sys/dev/aq/aq_fw.h
+11-3sys/dev/aq/aq_main.c
+12-1sys/dev/aq/aq_hw.c
+354-93 files not shown
+380-99 files

FreeBSD/src 9e067f2sys/dev/aq aq_dbg.c aq_fw.c

aq(4): observability controls and sysctl/header hygiene

Fold the driver's observability and infrastructure work.

Make aq_device.h self-contained: it declares struct aq_dev in terms of
iflib, bitstring, socket, and ethernet types but included none of the
headers that define them, compiling only because every includer happened
to pull those first.  Include what it uses.  No functional change.

Make the debug controls per-instance.  The debug and debug_categories
sysctls were registered per device but pointed at file-scope globals, so
writing dev.aq.1.debug also changed dev.aq.0.debug and a card could not
be traced in isolation.  Move the level and category mask into struct
aq_dev, reach them through the aq_dev back-pointer in struct aq_hw (wired
up in attach_pre before the first firmware trace and guarded against a
NULL deref), emit through device_printf() so each line carries its unit,
and seed initial values from per-unit device hints so attach can be
traced.


    [27 lines not shown]
DeltaFile
+67-14sys/dev/aq/aq_main.c
+65-15sys/dev/aq/aq_fw2x.c
+66-6sys/dev/aq/aq2_fw.c
+42-14sys/dev/aq/aq_dbg.h
+17-17sys/dev/aq/aq_fw.c
+7-11sys/dev/aq/aq_dbg.c
+264-776 files not shown
+307-8712 files

FreeBSD/src 4c58eeflib/libsys stat.2

stat.2: enhance the description of st_blocks

Reviewed by:    emaste, mckusick
Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
Differential revision:  https://reviews.freebsd.org/D58592
DeltaFile
+11-1lib/libsys/stat.2
+11-11 files

FreeBSD/src 8a9ae26bin/cp cp.1

cp: Correct description of SIGINFO

The manual page claimed that SIGINFO caused information to be printed to
stdout, when in fact it is printed to stderr, as one would expect.  This
has been true ever since the feature was first added in 2003.

MFC after:      1 week
Fixes:          00d321a2b395 ("Add a SIGINFO handler.")
Reviewed by:    jilles
Differential Revision:  https://reviews.freebsd.org/D58392

(cherry picked from commit 5dc400ff452b0259f0c50474255ebe6e5e02edb9)
DeltaFile
+2-2bin/cp/cp.1
+2-21 files

FreeBSD/src c878cb7bin/cp cp.1

cp: Correct description of SIGINFO

The manual page claimed that SIGINFO caused information to be printed to
stdout, when in fact it is printed to stderr, as one would expect.  This
has been true ever since the feature was first added in 2003.

MFC after:      1 week
Fixes:          00d321a2b395 ("Add a SIGINFO handler.")
Reviewed by:    jilles
Differential Revision:  https://reviews.freebsd.org/D58392

(cherry picked from commit 5dc400ff452b0259f0c50474255ebe6e5e02edb9)
DeltaFile
+2-2bin/cp/cp.1
+2-21 files

FreeBSD/src 4334125contrib/kyua/cli cmd_debug.cpp, contrib/kyua/doc kyua-debug.1.in

kyua-debug: Add -P option

Add -P as shorthand for --pause-before-cleanup.

MFC after:      1 week
Reviewed by:    ngie
Differential Revision:  https://reviews.freebsd.org/D56613

(cherry picked from commit 7c51da13ae55dc98e9cc1b794e1fe6fc001d7f42)
DeltaFile
+2-2contrib/kyua/doc/kyua-debug.1.in
+1-0contrib/kyua/cli/cmd_debug.cpp
+3-22 files

FreeBSD/src b56bd4clib/libfetch common.c

libfetch: Fix handling of connection failures

After commit 848f360c8f9a, if one tries to connect to a closed port,
fetch reports "Operation now in progress", which is rather confusing.
Return a more useful error message, restoring the old behaviour.

Fixes:          848f360c8f9a ("libfetch: Apply timeout to connection attempts")
Reviewed by:    des
MFC after:      3 days
Differential Revision:  https://reviews.freebsd.org/D58481

(cherry picked from commit b02e02958dad2d5ce3675cbc18b9a94635d09e66)
DeltaFile
+4-0lib/libfetch/common.c
+4-01 files

FreeBSD/src 70fffablib/libfetch common.c

libfetch: Further improve connection polling

* Reorganize the connection loop to make it a little more readable

* Start the timeout clock earlier

* Correctly calculate the poll timeout before calling poll()

* Don't leak the socket on failure

Fixes:          848f360c8f9a ("libfetch: Apply timeout to connection attempts")
Fixes:          b02e02958dad ("libfetch: Fix handling of connection failures")
MFC after:      3 days
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D58512

(cherry picked from commit 351ed134887fe5b8da39d22fcb267c96ab009ca2)
DeltaFile
+51-36lib/libfetch/common.c
+51-361 files

FreeBSD/src 21101f5lib/libfetch common.c

libfetch: Fix handling of connection failures

After commit 848f360c8f9a, if one tries to connect to a closed port,
fetch reports "Operation now in progress", which is rather confusing.
Return a more useful error message, restoring the old behaviour.

Fixes:          848f360c8f9a ("libfetch: Apply timeout to connection attempts")
Reviewed by:    des
MFC after:      3 days
Differential Revision:  https://reviews.freebsd.org/D58481

(cherry picked from commit b02e02958dad2d5ce3675cbc18b9a94635d09e66)
DeltaFile
+4-0lib/libfetch/common.c
+4-01 files