pci: Expose a VF's owning PF to bus subclasses
ofw_pcibus now uses pci_iov_get_pf() to inherit PF locality for
VFs, but the accessor was inadvertently left in an uncommited ACPI
change. This breaks powerpc builds.
Expose the accessor from the PCI core and provide a stub when PCI_IOV
is omitted. Record VF ownership before pci_add_child() so child added
callbacks can safely query it, and remove the later redundant
assignment.
Fixes: f003e86335c9 ofw_pcibus: Inherit PF locality for SR-IOV VFs
MFC after: 2 weeks
Sponsored by: BBOX.io
examples/jails: Allow any character in interface names
Interface names have no limitations on the allowed character set, only
a length restriction.
Widen the allowed character set for interface names to include any
printable character.
PR: 290916
Reviewed by: dteske
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D53865
examples/jails: New version of jib (9.0)
Add $Version, -h/-v, and SPDX-License-Identifier: BSD-2-Clause.
Drop the long-form license and bump the copyright to 2026.
MFC after: 1 week
e1000: Limit the TSO sentinel to lem(4) controllers
The TSO workaround splits the final DMA segment to create a four byte
sentinel descriptor. Intel documents the premature descriptor writeback
erratum and this workaround in the 82540EP and 82545GM specification
updates (erratum 3) and the 82546GB specification update (erratum 1).
Limit the workaround and its preceding TSO state to the legacy PCI and
PCI-X controllers so PCIe controllers retain their natural descriptor
layout using one fewer descriptor per TSO packet, no split of the final
segment, and one less four byte DMA.
MFC after: 2 weeks
Sponsored by: BBOX.io
dounmount(): generalize comment on covered vnode lock recursion
The need for recursion applies (in somewhat different form) to both
nullfs and unionfs, and would likely apply to any other hypothetical
stacked filesystem as well.
Reviewed by: kib, markj
Differential Revision: https://reviews.freebsd.org/D58858
unionfs_lock(): eliminate LK_CANRECURSE special-case
As of commit 9f5c4ef328 ("dounmount(9): temporarily enable recursion
for the covered vnode lock"), the unmount path handles recursion
automatically, so there's no longer a need to handle this case
in unionfs-specific code.
Reviewed by: kib, markj
Tested by: pho
Differential Revision: https://reviews.freebsd.org/D58858
unionfs7.sh: eliminate stderr redirection
The bash-ism here results in an "ambiguous output redirect"
error when run under tcsh. Similar unionfs stress2 tests don't
do this, and unionfs7 doesn't seem to generate spurious output
when run locally, so just delete it.
Reviewed by: pho
Differential Revision: https://reviews.freebsd.org/D58856
snd_hdsp: Avoid allocation in the interrupt handler
Cache PCM children instead of calling device_get_children() from the
interrupt handler. Drain callbacks before child detach so cached
pointers cannot outlive the PCM softc. Allocate the parent softc by
its actual size.
This mirrors snd_hdspe's interrupt dispatch and detach lifecycle.
Reported by: christos
MFC after: 1 week
ofw_pcibus: Honor device proximity for DMA tags
BUS_GET_DOMAIN can report a PCI function's firmware locality, including
an SR-IOV VF's inherited PF locality, but ordinary OFW PCI functions
still use the shared bus DMA tag. Consequently, busdma metadata and
coherent memory can be allocated from the bus's domain instead of the
function's domain.
Create and cache a child tag for each function that requests a DMA tag
and apply its reported domain without modifying the shared parent tag.
Apply the same domain to the private IOMMU tag already created by the
pSeries PCI bus. Destroy cached tags when PCI children are removed so
VF create and destroy cycles do not leak them.
Reviewed by: PowerPC (jhibbits)
MFC after: 2 weeks
Sponsored by: BBOX.io
Differential Revision: https://reviews.freebsd.org/D59065
ofw_pcibus: Inherit PF locality for SR-IOV VFs
PCI VFs are allocated dynamically and have no corresponding OFW node.
The zero-filled OFW PCI devinfo currently leaves obd_node as 0, which
is not the invalid-node sentinel and can send NUMA lookup through an
unrelated firmware node.
Initialize dynamically allocated devinfo with an invalid OFW node. For
VF locality queries, use the owning PF's node when it exists. Fall back
to the PCI bus when neither the VF nor PF has a firmware node.
This preserves existing CPU-locality behavior for ordinary PCI devices
while making VF domain and interrupt placement follow their PF.
Reviewed by: PowerPC (jhibbits)
MFC after: 2 weeks
Sponsored by: BBOX.io
Differential Revision: https://reviews.freebsd.org/D59064
ixv: Negotiate VF queue-set limits
ixv uses one queue set on 82599 and X540 VFs and assumes two on
X550-family VFs. The PF reports the queues assigned to each VF with
GET_QUEUES after mailbox API 1.1 negotiation.
Query the PF during attach. Bound symmetric iflib queue sets by the PF
grant and available MSI-X data vectors. Retain one queue set per data
vector: ixgbe VFs expose at most three vectors and one is reserved for
the mailbox. The hardware permits each pool to use a subset of its RSS
queues, so a two-queue ceiling is valid when the PF assigns four.
This enables the second data vector on 82599 and X540 while avoiding an
assumed second queue when an X550-family VF is granted only one. Keep
the existing family limits if the mailbox is unavailable or the PF uses
an older API.
(cherry picked from commit 98fad621ed697586782e488afdc05252c060fec3)
ix/ixv: Match Tx writeback thresholds to iflib
PTHRESH controls when the device prefetches transmit descriptors,
HTHRESH controls how many host descriptors must be ready, and WTHRESH
controls completion writeback batching.
iflib places RS on selected descriptors and reclaims through those
checkpoints. The data sheets require WTHRESH to be zero when software
uses RS. Clear WTHRESH while retaining the established PTHRESH 32 and
HTHRESH 1 fetch policy.
This also follows DPDK in pairing sparse RS descriptors with
WTHRESH zero. DPDK defaults to 32/0/0, while Linux ixgbevf uses
32/1/8. The 32/1/0 setting preserves FreeBSD's prefetch policy and the
data-sheet requirement that HTHRESH be nonzero when PTHRESH is used.
(cherry picked from commit 0baf0fabdb5e60e917458f85706707ee92683080)
igc: Correct descriptor control programming
The transmit-ring setup was copied from the e1000 path. On I225
and I226, bits 22 through 24 are reserved and bit 25 enables the
queue; it is not a legacy low-water threshold. Correct the field
masks, remove the nonapplicable legacy definitions, and program only
defined fields.
Use PTHRESH=8 and HTHRESH=1. Keep WTHRESH at zero so the hardware
honors sparse RS descriptors issued by iflib. Linux and DPDK use a
writeback threshold of 16, but request status on every packet. A
nonzero threshold makes hardware ignore individual RS bits and is
unsuitable for the iflib completion model.
The receive-ring setup likewise used a magic mask that left bit 20
of the five-bit WTHRESH field untouched. Define the receive threshold
fields and replace them exactly before installing the established
PTHRESH=8, HTHRESH=8, WTHRESH=4 policy.
(cherry picked from commit e2aff50727cbe4cb5e99f825c2c6bd8a4915de67)
igb: Program Rx descriptor thresholds by family
82576 specification-update erratum 26 says MSI-X EITR expiration can
fail to trigger receive descriptor writeback. A WTHRESH above one can
therefore leave received packets invisible until the threshold fills.
The shared threshold macros selected policy by enum ordering, so an
82576 VF fell into the generic WTHRESH=4 case. VFs always use MSI-X
and require the same WTHRESH=1 workaround as the PF.
Use PTHRESH=8 for 82575 and 82576 PFs and VFs, matching DPDK and the
current Linux PF driver. The legacy FreeBSD PF and Linux igbvf value
of 16 thrashes limited descriptor cache; no specification or erratum
requires it. Retain the i354 PTHRESH=12 exception.
Enumerate every supported igb PF and VF MAC type so each receives its
intended policy. Also clear every threshold bit before installing the
new values. The old mask retained the high WTHRESH bit, and 82575
uses six-bit fields while later controllers use five-bit fields.
[2 lines not shown]
Revert "e1000: Correct Rx descriptor threshold programming"
Commit 98b95af873ac accidentally applied abe22383f1b1 a second
time after its complete MFC in 081745262395. It added a duplicate
em_integrated_jumbo_rx() definition and broke the build.
Revert only the duplicate application. The original MFC remains in
place.
This reverts commit 98b95af873acf4beeb4ac9a0c83e5d009fb78cd9.
igb: Match Tx descriptor control to iflib
iflib requests transmit completion status only on selected descriptors.
Program a zero writeback threshold so igb hardware honors those sparse
RS bits instead of writing back every descriptor in threshold-sized
batches.
Use the existing family specific prefetch threshold: eight descriptors
on most controllers and 20 on I354, with a host threshold of one. These
values match the Intel-derived Linux and DPDK drivers. Their nonzero
writeback settings are not appropriate here because those drivers set
RS on every packet.
A zero writeback threshold also avoids depending on interrupt timer
flushes affected by 82576 specification update erratum 26. Remove the
old IGB_TX_WTHRESH macro as well. It has had no callers since the iflib
conversion, so its 82575 conditional no longer implements any policy.
(cherry picked from commit fddc393d93169b428fe64e9513ee463b5154b62a)
e1000: Correct Rx descriptor threshold programming
Jumbo receive tuning on integrated controllers enabled PTHRESH without
a nonzero HTHRESH, contrary to the hardware programming requirements.
It also covered only the integrated MAC generations present when the
workaround was added. Enumerate every jumbo-capable ICH and PCH type
and program PTHRESH=3 with HTHRESH=1. Linux fixed the same HTHRESH
omission in b701cacdbcfb.
The 82574 path combined threshold values with the reset values using
bitwise OR. Requesting WTHRESH=4 while the reset value was one thus
programmed five. Clear the complete threshold fields before installing
the established PTHRESH=32, HTHRESH=4, WTHRESH=4 descriptor-granularity
policy.
(cherry picked from commit abe22383f1b144f0868aa0654ec4514d36f7a4f5)