igb/igbv: MFC SR-IOV PF support and the VF driver split
Add SR-IOV PF support for Intel 82576 and I350 controllers and register
virtual functions as igbv. Bring over the shared mailbox and hardware
queue mapping changes, separate VF policy, filtering and statistics,
mailbox recovery, retained-queue sanitization, DMA fencing, and Hyper-V
support and recovery. Include the native VF-status provider for the
netlink framework already on stable/15.
Consolidate the series with the later e1000 and iflib fixes already
merged to stable/15. Complete the igb-specific pieces of the existing
IOV restart support, including configuration while the PF is down.
The resulting e1000 sources match main before the separate RSS hash-field
policy change in 86bdf7a4aec5. The reverted ioctl VF-status interface is
not imported.
Accept the VF interface rename from igbN to igbvN and document the
configuration and device-tunable migration in UPDATING. Preserve the
if_em.ko implementation and if_igb.ko alias, add if_igbv.ko and manual
[33 lines not shown]
netlink_snl: make snl_free() safe to call twice
snl_init() calls snl_free() on its own failure paths but leaves the
state marked initialised and the buffer pointers set, so a caller that
also frees the state on failure, as libpfctl's pfctl_open() does, closes
the descriptor twice and, on the lb_init() failure path, frees the
buffer twice. Reset what snl_free() releases so a second call is a
no-op.
Signed-off-by: Avinash Duduskar <avinash.duduskar at gmail.com>
Reviewed by: kp
Pull Request: https://github.com/freebsd/freebsd-src/pull/2508
(cherry picked from commit 489ded6d5231f44e02988e8c47969a9e6a1e07b7)
Bump __FreeBSD_version for SR-IOV VF status
Bump for the new ifnet and iflib VF-status provider KBI and the
rtnetlink VF-status interface.
Use 1501507 on stable/15 to identify the new provider and query APIs.
The backport preserves existing ifnet and driver member offsets and
the sizes of caller-owned structures.
(cherry picked from commit 9872a04038486676296501532337c767ffdec332)
rtnetlink: Allow VF priority reporting in trunk mode
PF-administered priority need not impose an access VLAN. Permit the
existing VLAN PCP attribute in either access or trunk mode, while
keeping VLAN identifier and protocol access only.
Display trunk PCP in ifconfig and document the broader meaning in the
kernel snapshot, libifconfig, and rtnetlink contracts. This changes no
attribute numbers, wire encoding, or structure layout.
Reported by: kib
Sponsored by: BBOX.io
(cherry picked from commit 429fbc7c35a6d860462db3109608b7f800f0e50b)
bnxt: Report SR-IOV VF status
Expose the PF-known effective per-VF MAC, allocated transmit and receive
queue counts, and policy state through the iflib VF status method.
Snapshot the state under the SR-IOV lock so concurrent trust and
anti-spoof sysctl updates cannot produce a torn report. Mark known queue
allocations present even when their value is zero.
Cache a VF-selected MAC only after firmware accepts the forwarded
request. Prefer that address in status. Replay the accepted address,
trust state, and MAC anti-spoof policy after firmware recovery.
Record completion of the per-VF configuration callback separately from
firmware resource allocation.
Track successful PCI SR-IOV attachment independently of the active VF
count. This lets a supported but unconfigured PF return an empty status
while unsupported devices and failed attachments omit it.
[7 lines not shown]
ixgbe: Report SR-IOV VF status
Expose cached VF configuration, policy, and runtime state through the
iflib VF status method. Include access or trunk VLAN mode, transmit and
receive queue counts selected by the current virtualization mode,
negotiated mailbox API, PF traffic permission, fault containment, and
quarantine state.
Initialize every cached API version before VF enumeration so an
unconfigured slot cannot be mistaken for API 1.0.
The query does not issue mailbox requests or read hardware registers.
Place the new attachment flag in existing padding on stable/15 to retain
the softc size and all existing member offsets.
Sponsored by: BBOX.io
(cherry picked from commit 049331b20657cf0e7723c071efb75fda53a655fd)
mlx5en: Report SR-IOV VF status
Query each enabled eswitch vport to report its effective MAC and VLAN
configuration and administrative link-state policy. Serialize the
query with vport enable and disable, and hold the interface state lock
so teardown joins an in-progress report.
Propagate firmware errors from MAC, administrative link-state, and
supported VLAN queries instead of returning a partially initialized
configuration. When the hardware lacks CVLAN enforcement, report the
remaining status with no imposed access VLAN.
Keep the existing caller-owned vport-info structure unchanged on
stable/15. Return the additional CVLAN state through a new helper,
and retain the original query entry point as a compatibility wrapper.
Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D58740
(cherry picked from commit 0c08d85c99b7b57e45816d011685d349b240a3e3)
cxgbe: Report SR-IOV VF status
Retain the PF-accepted MAC and VLAN settings from the per-port t4iov
companion and expose them through the corresponding cxgbe ifnet.
Publish, snapshot, and destroy the cache under the existing adapter
synchronized-operation mechanism so status queries cannot race IOV
configuration or teardown.
Track successful t4iov attachment independently of the active VF count.
Restrict reporting to the port main VI, return an empty status for a
supported but unconfigured PF, and omit status from VF and auxiliary
VIs.
On stable/15, append the cached status fields to port_info to preserve
all existing member offsets. Reject VF adapters before accessing the
extended portion, which an older VF module does not allocate.
Reviewed by: jhb
[4 lines not shown]
qlnx: Report SR-IOV VF status
Retain the PF-known MAC and allocated transmit and receive queue counts
for each VF and expose them through the PF ifnet. Sum queues across all
hardware functions rather than reporting only the first one.
Publish and snapshot the VF cache under the existing hardware lock.
Unpublish it before hardware teardown, and invalidate queue-allocation
knowledge when error recovery releases the underlying VF resources.
Initialize the cache, release it on failed initialization, and reject an
out-of-range VF index instead of continuing into the array.
Tested by: zlei
Place the new status flags in existing padding on stable/15, preserving
the VF attribute array stride and existing member offsets.
Sponsored by: BBOX.io
Differential Revision: https://reviews.freebsd.org/D58742
[2 lines not shown]
ice: Report SR-IOV VF status
Report the VF MAC, allocated transmit and receive queues, exact trunk
VLAN-filter count and capacity, negotiated virtchnl API, configured MAC,
VLAN, spoof-check, and promiscuous-mode policy, automatic link-state
policy, PF traffic permission, and fault containment through iflib.
Expose mirror configuration and active hardware rules, precise
malicious-driver isolation and counters, software mailbox-overflow
isolation and counters, VF-owned MAC-filter count and limit, and reset
diagnostics through a versioned driver.ice extension. Distinguish a
failed VF reset from a required VSI rebuild, which may still be pending
rather than failed. Keep the namespace schema local to the driver so
future extensions need no changes to common network headers or the
formatter.
Invalidate cached VF handshakes during preparation for an externally
initiated device reset, before releasing the context lock to wait for
hardware. Mark the VFs as requiring rebuild even if an early PF rebuild
[16 lines not shown]
rtnetlink(4): Qualify VF status descriptions
Driver-specific extension namespaces are optional. Describe their
role without implying that every provider supplies one.
Clarify that the VLAN count excludes membership installed implicitly by
the PF without implying that an explicit VID 0 request cannot consume a
reported filter.
Sponsored by: BBOX.io
(cherry picked from commit 949029692f361fb5a96b24cfc46cee74be2b3a9c)
ifconfig: Add SR-IOV VF status output
Add NIC-specific VF status to the existing ifconfig -v output. Fetch
the data through libifconfig using a separate native route Netlink
query.
Group optional identity, initialization, resources, VLAN policy,
administrator policy, protocol, traffic-permission, and
fault containment fields. Omitted fields remain distinct from false or
zero.
Refer users to iovctl -L for device-neutral PCI attachment and
passthrough state.
This is a Netlink-native evolution of the original interface by Eric
Joyner.
Relnotes: yes
Adapt the documentation to the iovctl features available on stable/15.
[7 lines not shown]
ixl: Report SR-IOV VF status
Expose cached per-VF configuration through the iflib VF status method.
Report mailbox initialization and the negotiated virtual-channel API, MAC
address, access or trunk VLAN mode, queue resources, administrator policy,
PF traffic permission, and fault containment.
Expose per-VF malicious-driver isolation and cumulative transmit and
receive event counts through a versioned driver.ixl extension.
Track successful PCI IOV attachment separately from hardware capability.
This lets a successfully attached but unconfigured PF return an empty
snapshot without claiming support when PCI IOV registration was
unavailable.
The query uses driver-cached state and does not issue AdminQ requests or
read device registers.
On stable/15, place the attachment flag in existing padding and restore
[7 lines not shown]
libifconfig: Add a native SR-IOV VF status query
Request RTEXT_FILTER_VF through route Netlink and parse the common VF
status schema into typed public structures. Preserve per-field
presence using IFLAF_VF_* attribute numbers as mask bit indices so
callers can distinguish omitted values from false or zero.
Validate required VF indices, repeated driver namespaces, and their
versioned typed fields while allowing unknown optional attributes.
Return VF records through a pointer vector so append-only growth of the
public VF structure does not change the array stride seen by existing
consumers.
Sponsored by: BBOX.io
Differential Revision: https://reviews.freebsd.org/D58777
(cherry picked from commit a8eca531e23b49b71115216a9d54bd78dd16d87b)
netlink: Make room for the unfinished message when growing the buffer
When a message outgrows the writer's buffer, _nlmsg_refill_buffer()
allocates a larger one and moves the unfinished message there. The new
buffer was sized for the data about to be added alone, so with enough of
the message already written the caller wrote past its end and left it
with datalen > buflen. A 20-byte message plus an attribute of 8176
bytes got a buffer of 8192 bytes for 8200 bytes of data, and reading it
panicked an INVARIANTS kernel in nl_soreceive().
Size the new buffer for both, and add a ktest for it.
Reviewed by: glebius
Fixes: 7e5bf68495cc ("netlink: add netlink support")
MFC after: 1 week
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D60541
(cherry picked from commit 5180fce1cf7ec7430ccf2adb88358602e5ccee1e)
rtnetlink: Add FreeBSD-specific IFLAF_GROUP support
Netlink IFLA_GROUP works with a single group id, in our
implementation an interface can be joined to multiple groups
and it works with group name.
Store interface groups in IFLAF_GROUP attribute.
Reviewed by: glebius, melifaro
Discussed with: markj
Differential Revision: https://reviews.freebsd.org/D58643
(cherry picked from commit 2f8f892ca344d884abbed0305886bb532f16368f)
netlink: Parse repeated nested attributes
Modern Netlink arrays encode their elements as repeated attributes of
the same type rather than as children of an additional array container.
Add an SNL callback that parses one nested element for each occurrence
and appends it to a geometrically grown parser array. Retain the
existing parray callback for protocols that use the legacy container
form.
Store the growth capacity in struct snl_parray, appended after its
existing public count and items fields so their offsets remain stable
on LP64 and ILP32. Require parser targets to be real snl_parray
objects, and convert bitset, generic Netlink, and route multipath arrays
accordingly. This avoids relying on layout aliases for private growth
state.
Add regression coverage for a nested bit array that grows beyond its
initial allocation, while preserving replacement semantics when a
[10 lines not shown]
rtnetlink: Add native SR-IOV VF status
Add a transport neutral kernel snapshot for NIC-specific SR-IOV VF
status and an optional iflib provider method. Providers gather state
under driver defined synchronization.
Honor RTEXT_FILTER_VF on RTM_GETLINK requests and encode the status as
native typed route Netlink attributes. Represent VFs, driver
namespaces, and namespace fields as directly repeated nested attributes.
Presence masks in consumers can distinguish omission from false or zero.
Drivers may add custom status under stable, versioned namespaces. The
named, typed representation lets generic transports and consumers carry
or display fields without knowing their driver-specific schemas, while
the driver retains ownership of their names and meanings.
Document the ABI and add parser and RTM_GETLINK coverage.
For stable/15, store the ifnet callback in reserved tail space, preserving
[10 lines not shown]
kqueue: stream the knote report instead of buffering all of it
kern_proc_kqueues_out() sized its intermediate sbuf from the preceding
sizing pass, so dumping core for a process with many knotes wired a
buffer as large as the entire report.
Shrank the intermediate to one page and added a drain that copied into
the caller's sbuf up to maxlen, stopping the walk once it was reached.
Truncation stayed byte exact.
A dump of 384k knotes peaked at 20 KB of M_SBUF instead of 445 MB.
Reviewed by: adrian, markj
Differential Revision: https://reviews.freebsd.org/D58584
MFC after: 1 week
(cherry picked from commit 9590878fca68e62c63d607da73139698e204d0f0)
kqueue: fix the always-empty NT_PROCSTAT_KQUEUES core note
sbuf reserves a byte of its buffer for the terminator, so the sbuf
created with maxlen held one byte less than the sizing pass had
computed. The last record overflowed it, sbuf_bcat() failed, and the
error == 0 guard skipped the copy into the caller's sbuf, so the note
has been emitted at full size but zero filled since 5e7c43ff02dc.
Fixes: 5e7c43ff02dc
Reviewed by: adrian, markj
Differential Revision: https://reviews.freebsd.org/D58583
MFC after: 1 week
(cherry picked from commit 5078280bb42c00eecffeabf93706c145e87b4b2b)
net-p2p/rtorrent: Warn about renamed config commands on upgrade
rtorrent 0.16 renamed several configuration commands (e.g.
network.port_range.set -> network.listen.port.range.set), so
configurations from earlier versions may fail at startup. Add an
upgrade pkg-message pointing users to rtorrent.conf.sample.
PR: 300316
Reported by: Benoit Felix <benoit.felix at outlook.com>
MFH: 2026Q4
(cherry picked from commit 53c1ff04d4ae1c7ee54af9e3b541f3c0bfc387bd)
tests/if_geneve: Fix ether_ipv6_blind_options flakiness
This test could fail under load due to lack of no_dad before.
PR: 299448
Reported by: siva
Fixes: aa9f669d09a7 ("geneve: Add tests for geneve")
net-p2p/rtorrent: Warn about renamed config commands on upgrade
rtorrent 0.16 renamed several configuration commands (e.g.
network.port_range.set -> network.listen.port.range.set), so
configurations from earlier versions may fail at startup. Add an
upgrade pkg-message pointing users to rtorrent.conf.sample.
PR: 300316
Reported by: Benoit Felix <benoit.felix at outlook.com>
MFH: 2026Q4