FreeBSD/src 884ee8dsys/fs/nfs nfsport.h nfs_commonkrpc.c, sys/fs/nfsclient nfsmount.h nfs_clrpcops.c

nfscl: Add some glue for client side NFS over RDMA

This patch adds assorted bits needed by the nfsclrdma.ko
module that implements client side NFS over RDMA.
With this commit, the glue required by the nfsclrdma.ko
module is complete and it should load ok.

It should not affect non-RDMA operation.

I've specified a long MFC, since the module still
requires extensive testing and, hopefully, a review.

MFC after:      3 months
DeltaFile
+119-76sys/fs/nfs/nfs_commonkrpc.c
+109-15sys/fs/nfsclient/nfs_clvfsops.c
+72-3sys/fs/nfsclient/nfs_clrpcops.c
+2-0sys/fs/nfsclient/nfsmount.h
+2-0sys/fs/nfs/nfsport.h
+304-945 files

FreeBSD/src a311bd1sys/rpc getnetconfig.c rpc.h

krpc: Add some glue for client side NFS over RDMA

This patch adds assorted bits needed by the nfsclrdma.ko
module that implements client side NFS over RDMA.

It should not affect non-RDMA operation.

Some additional glue is needed for the nfsclrdma.ko
module within the NFS code.  That will be added as
a separate commit.

I've specified a long MFC, since the module still
requires extensive testing and, hopefully, a review.

MFC after:      3 months
DeltaFile
+122-67sys/rpc/clnt_rc.c
+136-0sys/rpc/rpc_generic.c
+104-0sys/rpc/clntrdma.h
+19-1sys/rpc/krpc.h
+15-0sys/rpc/rpc.h
+14-0sys/rpc/getnetconfig.c
+410-683 files not shown
+425-709 files

FreeBSD/src 4881c7atests/sys/kern unix_stream.c

tests/sys/kern/unix_stream: fix bad assertion

kqueue returns a value != -1 on error. Test for that instead of any
non-zero value to confirm that success was achieved when calling
`kqueue`.

This issue exists with ATF 0.22+ [1].

MFC after:      2 weeks
Reported by:    clang (-Wparenthesis)

[1]: https://github.com/freebsd/atf/pull/72
DeltaFile
+2-1tests/sys/kern/unix_stream.c
+2-11 files

FreeBSD/src 4ae95fetests/sys/sys bitstring_test.c

tests/sys/sys/bitstring_test: fix build with ATF 0.22+

Do not assign `b` in the `ATF_REQUIRE` macro. Set and test `b`
separately to avoid the issue cited by clang++/g++ after
implementing the change referenced in [1].

MFC after:      2 weeks
Reported by:    clang (-Wparenthesis)
Reference:      https://github.com/freebsd/atf/pull/72
DeltaFile
+2-1tests/sys/sys/bitstring_test.c
+2-11 files

FreeBSD/src c006c8dsys/net if_bridge.c

if_bridge: Fix NULL softc dereference in bridge_input()

In bridge_input, sc is initialized to NULL and doesn't get
resolved until after the Ethernet header pullup.
So the pullup's failure path ends up dereferencing the NULL sc
when bumping up IFCOUNTER_IERRORS.

The m_freem call right under it is redundant as the failure path in
m_pullup already freed the chain.

Drop both lines, matching what we have in bridge_output.

ether_input_internal() discards frames shorter than ETHER_HDR_LEN
before the bridge hook, so it is unlikely that it will fire.
We still keep the guard as lagg(4) and ng_ether(4) may replace
the mbuf before the bridge hook.

Signed-off-by:  Aaron Espinoza <acesp25 at freebsd.org>
Reviewed by:    pouria
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2393
DeltaFile
+1-4sys/net/if_bridge.c
+1-41 files

FreeBSD/src 5076e9binclude assert.h time.h, sys/sys stdatomic.h

libc: Fix C23 version macro visibility

In headers that existed prior to C23, these should be visible only in
C23 or BSD mode.

Fixes:          0fe73dcf7c32 ("libc: Add <assert.h> C23 feature test macro")
Fixes:          1f09e354297c ("sys/limits.h: Add BOOL_MAX, BITINT_MAXWIDTH, and C23 feature test macro")
Fixes:          cd0727ec709b ("libc: Add <stdio.h> C23 feature test macro")
Fixes:          fc9d02cb29ed ("libc: Add <time.h> C23 feature test macro")
Fixes:          4aeed6e9d213 ("libc: Add <setjmp.h> C23 feature test macro")
Reviewed by:    fuz, kfv, dteske
Differential Revision:  https://reviews.freebsd.org/D59272
DeltaFile
+4-2sys/sys/stdatomic.h
+4-2include/time.h
+4-2include/stdio.h
+4-2include/setjmp.h
+4-2include/limits.h
+2-0include/assert.h
+22-106 files

FreeBSD/src b5dcd8flibexec/rc/tests Makefile svcj_test.sh

rc.subr tests: service jail behaviour of run_rc_command

Twenty cases over where each rc option and each method executes for a
jailed service, the jail's lifetime, and the svcj option handling.  Each
case drives the service inside a chroot built in its ATF work directory.

MFC after:              1 week
MFC to:                 stable/15
Assisted-by:    Claude Code (Opus 5)
DeltaFile
+1,178-0libexec/rc/tests/svcj_test.sh
+1-1libexec/rc/tests/Makefile
+1,179-12 files

FreeBSD/src be834d6share/man/man5 rc.conf.5

rc.conf.5: note that a negative nice value does not reach a service jail

Raising a process' priority is not permitted inside a jail, and nice(1)
warns and executes the command anyway, so the service comes up at its login
class priority.

Not changing the date, as a commit a moment before this, one changed it
already.

MFC after:      1 week
MFC to:         stable/15
DeltaFile
+8-0share/man/man5/rc.conf.5
+8-01 files

FreeBSD/src 9125bc0libexec/rc rc.subr, share/man/man5 rc.conf.5

rc.subr: svcj - add a setaudit option

setaudit(8) is prefixed to the command inside the jail when
${name}_audit_user is set, and needs allow.setaudit.

This is not added automatically when ${name}_audit_user is set, this
needs an administrative setting of the options on purpose.

MFC after:      1 week
MFC to:         stable/15
DeltaFile
+5-1share/man/man5/rc.conf.5
+3-0libexec/rc/rc.subr
+8-12 files

FreeBSD/src 327dae5libexec/rc rc.subr

rc.subr: svcj - run a service's own restart and status methods in its jail

A script that defines non-default restart_cmd or status_cmd should
execute them in the service jail.  Where there is no jail to enter,
restart starts the service instead of failing.

Fixes:                  2efbd480f1d3 rc: add service jails framework
MFC after:              1 week
MFC to:                 stable/15
Assisted-by:    Claude Code (Opus 5)
DeltaFile
+17-1libexec/rc/rc.subr
+17-11 files

FreeBSD/src a70ca1elibexec/rc rc.subr

rc.subr: svcj - remove the service jail when the service is not running

A service whose tracked process had died while another process of its own
kept the jail alive, therefore left svcj-${name} behind, and the next start
would fail.

Fixes:                  2efbd480f1d3 rc: add service jails framework
MFC after:              1 week
MFC to:                 stable/15
Assisted-by:    Claude Code (Opus 5)
DeltaFile
+4-0libexec/rc/rc.subr
+4-01 files

FreeBSD/src 21e53eelibexec/rc rc.conf rc.subr

rc.subr: svcj - let svcj_all_enable enable service jails

Fix the logic for svcj_all_enable.

Fixes:          2efbd480f1d3 rc: add service jails framework
MFC after:      1 week
MFC to:         stable/15
DeltaFile
+2-1libexec/rc/rc.subr
+2-0libexec/rc/rc.conf
+4-12 files

FreeBSD/src 6155e17libexec/rc rc.subr

rc.subr: svcj - send the stop signal from inside the service jail

A service running under ${name}_user was signalled from the host as that
user, which the parent of a jail may no longer do: since 8a5ceebece03 an
unprivileged process would need allow.unprivileged_parent_tampering.
Stop and reload therefore failed and left both the service and its jail
running.

MFC after:      1 week
MFC to:         stable/15
DeltaFile
+3-0libexec/rc/rc.subr
+3-01 files

FreeBSD/src 90bee82share/man/man4 igc.4, sys/dev/igc if_igc.h igc_defines.h

igc: Correct Wake-on-LAN filter programming

The attach path translated WUC.APME into a saved link-change filter,
then advertised magic-packet wake.  Suspend removed unselected magic,
unicast, and multicast bits from that saved value, commonly leaving no
hardware wake filter at all.  The destructive masking also made later
capability changes ineffective.

Advertise the I225/I226 wake filters whenever PCI power management is
available and enable magic-packet wake by default.  Build a fresh WUFC
mask for every suspend, and explicitly clear WUC, WUFC, and PCI PME when
wake is disabled.

Require the PCI power-management capability to report D3hot PME support
before advertising or arming wake.  A PM capability alone does not mean
the function can signal PME from the state used during system sleep.

Reconstruct RAR0, the multicast table, and the receive filter after the
stop-time reset so unicast and multicast wake use the current interface

    [47 lines not shown]
DeltaFile
+153-54sys/dev/igc/if_igc.c
+21-3share/man/man4/igc.4
+20-0sys/dev/igc/igc_mac.c
+3-4sys/dev/igc/igc_defines.h
+3-4sys/dev/igc/igc_base.c
+1-3sys/dev/igc/if_igc.h
+201-682 files not shown
+203-698 files

FreeBSD/src c4e24e9share/man/man9 Makefile pci.9, sys/compat/linuxkpi/common/include/linux pci.h

pci: Expose PME support by power state

The presence of the PCI power management capability does not imply that
a function can signal PME# from every power state.  Drivers which
advertise wake based only on pci_has_pm() can consequently expose wake
modes that cannot work.

Add pci_has_pme() to query the PME_Support bitmap for a specific state.
Use it to implement LinuxKPI pci_pme_capable(), removing its duplicate
PME_Support decoder.

Validated the helper against PCI PMC capability values from 82571EB,
82573L, 82579LM, I210, I225, and I226-V controllers.  The 82571 and
82573 reported PMC 0xc822, while the I226-V reported 0xc823.  In both
values, bits 15, 14, and 11 advertise PME from D3cold, D3hot, and D0;
the low-bit difference is only the PM capability version.

MFC after:      2 weeks
Sponsored by:   BBOX.io
DeltaFile
+2-18sys/compat/linuxkpi/common/include/linux/pci.h
+18-1share/man/man9/pci.9
+19-0sys/dev/pci/pci.c
+1-0sys/dev/pci/pcivar.h
+1-0share/man/man9/Makefile
+41-195 files

FreeBSD/src 9f5cfe6usr.sbin/mixer mixer.c

mixer: Improve error messages

Use better diagnostic messages when unit numbers are wrong.

Reviewed by:    arrowd@, christos@, kevans@
Approved by:    christos@
Differential Revision:  https://reviews.freebsd.org/D56845
DeltaFile
+3-1usr.sbin/mixer/mixer.c
+3-11 files

FreeBSD/src 0b3fc7fusr.bin/whereis whereis.1 whereis.c

Revert "whereis(1): Respect PORTSDIR variable"

This reverts commit edadc3f9051595a9c2e693d8ab666a50b9e7a21a.
DeltaFile
+54-66usr.bin/whereis/whereis.c
+0-4usr.bin/whereis/whereis.1
+54-702 files

FreeBSD/src 1911838sys/dev/dpaa fman_xmdio.c

dpaa/fman_xmdio: Make xmdio a "real" MDIO

Instead of forcing an `mdio` pseudo-device to hang off the xmdio, rename
xmdio to "mdio" and make it an ofw bus device, akin to the mii_fdt
driver, so that children can get the device tree goodies.
DeltaFile
+45-6sys/dev/dpaa/fman_xmdio.c
+45-61 files

FreeBSD/src 32b99a2sys/dev/dpaa fman.c

dpaa/fman: Pad the qman channel search array

The loop goes over the qman channel total (16), so if a port ID is not
found in the list it could walk off the end of the list and return
garbage.  Not a problem in practice, as only valid ports are included in
our device trees, but protect it anyway.
DeltaFile
+3-3sys/dev/dpaa/fman.c
+3-31 files

FreeBSD/src 26d5c4fsys/powerpc/pseries xics.c

powerpc64/powernv: Migrate XICS to PIC_AP_INIT

Get rid of the powernv-specific AP callback and use the new-ish
PIC_AP_INIT() PIC KPI instead.
DeltaFile
+7-10sys/powerpc/pseries/xics.c
+7-101 files

FreeBSD/src a416bbfshare/man/man4 ntb_hw_plx.4

ntb_hw_plx.4: Canonicalize

+ tag SPDX
+ canonicalize SYNOPSIS, LOADER TUNABLES, and HARDWARE
+ switch X to %d for clarity and consistency

MFC after:      3 days
DeltaFile
+25-28share/man/man4/ntb_hw_plx.4
+25-281 files

FreeBSD/src 9cdadb3share/man/man4 ntb.4

ntb.4: Canonicalize SYNOPSIS and LOADER TUNABLES

Also tag SPDX, and switch X to %d for clarity and consistency.

MFC after:      3 days
DeltaFile
+19-21share/man/man4/ntb.4
+19-211 files

FreeBSD/src 63ecc9ashare/man/man4 ntb_hw_amd.4

ntb_hw_amd.4: Canonicalize SYNOPSIS and SYSCTLs

Also tag SPDX.

MFC after:      3 days
DeltaFile
+17-20share/man/man4/ntb_hw_amd.4
+17-201 files

FreeBSD/src 6acf079share/man/man4 ntb_hw_intel.4

ntb_hw_intel.4: Canonicalize SYNOPSIS + tag SPDX

MFC after:      3 days
DeltaFile
+6-10share/man/man4/ntb_hw_intel.4
+6-101 files

FreeBSD/src 8a6c20asys/dev/e1000 if_em.c

igb: Guard register dump during queue setup

The register-dump sysctl is installed before iflib allocates the queue
arrays and remains visible while they are freed. Return ENXIO outside
the queue lifetime instead of dereferencing a NULL or stale array.

Sponsored by:   BBOX.io

(cherry picked from commit bcb62ec0e3d592892f0f304269ed2722d1bae75a)
DeltaFile
+7-0sys/dev/e1000/if_em.c
+7-01 files

FreeBSD/src b91c0fcsys/dev/pci pci_iov.c

pci_iov: Permit non-ARI VFs on a secondary bus

A non-zero VF device number does not always require ARI. The Intel
82576 and I350 [1] explicitly support a non-ARI layout that places VFs
on the next bus.

Check every requested VF RID and reject a non-zero device only when it
is on the PF bus. This retains the ARI guard for invalid same-bus
layouts while permitting the documented second-bus layout.

[1] Intel I350 Datasheet, sections 7.8.2.6.1.2, 9.6.4.6

Sponsored by:   BBOX.io

(cherry picked from commit e795a31cb4d66368bdbe5ac7f61c0899d3ed39f8)
DeltaFile
+18-3sys/dev/pci/pci_iov.c
+18-31 files

FreeBSD/src 7827d43sys/dev/e1000 if_em.h if_em.c

e1000: Recover from the 82574 PHY hang

The shared code provides e1000_check_phy_82574() to recognize a PHY
hang from saturated receive error and idle error counters, but em(4)
never calls it.

Run the check from timer driven admin work.  Match Intel e1000e by
requiring two consecutive positive samples before requesting a full
iflib reset.

MFC after:      2 weeks
Sponsored by:   BBOX.io

(cherry picked from commit 81d5356799a1db1701cb3f91146131c34dede413)
DeltaFile
+24-1sys/dev/e1000/if_em.c
+1-0sys/dev/e1000/if_em.h
+25-12 files

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

e1000: Sample statistics at timer cadence

Mailbox and link interrupts share iflib admin service with the periodic
timer. Mark timer-driven passes explicitly and run the hardware
statistics sweep only for those samples instead of repeating 66 PF MMIO
reads for every VF mailbox message.

DTrace on the I350 DUT measured the PF sweep at about 79 us on average.
The normal hz/2 timer continues to extend clear-on-read counters
safely; exported counters may trail hardware by up to 500 ms.

Sponsored by:   BBOX.io

(cherry picked from commit d2cd0b57532ba35fe39744a60d53b90e6f13b5e4)
DeltaFile
+14-1sys/dev/e1000/if_em.c
+1-0sys/dev/e1000/if_em.h
+15-12 files

FreeBSD/src 640916dsys/dev/igc if_igc.c

igc: Propagate hardware initialization failures

The reset helper discards igc_reset_hw and igc_init_hw errors.  Runtime
initialization then continues programming rings and filters, and iflib
publishes the interface as running even though the controller did not
reach a usable state.  Initial attach similarly continues into NVM and
MAC setup after a failed reset.

Return errors from the reset helper.  Fail attach when the controller
cannot be reset or initialized, and report runtime failures through
iflib_init_failed() so iflib leaves the interface stopped.  Also stop
register accesses and report the error when a stop path reset fails.  A
later successful initialization completes pending fatal error cleanup
and re-arms FER.

Cache a requested MAC address before reset, but let init_hw program RAR0
after reset succeeds.  Let iflib perform its normal attach-post failure
cleanup instead of releasing the same driver resources from both layers,
and make queue cleanup idempotent.

    [4 lines not shown]
DeltaFile
+38-24sys/dev/igc/if_igc.c
+38-241 files

FreeBSD/src df5bdb5sys/dev/e1000 if_em.c

e1000: Propagate hardware initialization failures

The reset helper discards reset_hw and init_hw errors.  Runtime
initialization then continues programming rings and filters, and iflib
publishes the interface as running even though the controller did not
reach a usable state.  Initial attach similarly continues into NVM and
MAC setup after a failed reset.

Return errors from the reset helper.  Fail attach when the controller
cannot be reset or initialized, and report runtime failures through
iflib_init_failed() so iflib leaves the interface stopped.  Also stop
register accesses and report the error when a stop-path reset fails.

Sponsored by:   BBOX.io

(cherry picked from commit 41a0f7a0a447ef2092faadb35f6d4c3f80c088bf)
DeltaFile
+41-10sys/dev/e1000/if_em.c
+41-101 files