Commit graph

44833 commits

Author SHA1 Message Date
Kevin Bowling
8d203db2d4 ixv: Wire iflib suspend and resume methods
Register the standard iflib device suspend and resume methods so the
framework reinitializes the VF datapath after a system power
transition.

Sponsored by:	BBOX.io

(cherry picked from commit 10d09e6e8a7ff141b5dc39e6ddca5b7c2cb0b66b)
2026-09-23 08:46:23 +02:00
Hareshx Sankar Raj
5f261ee00d qat: driver updates to enhance qat infrastructure
- Updated QAT infrastructure FW version/AE mask/num_banks fields
  to facilitate integration of future QAT products.
- Exposed service as sym;asym instead of cy for gen4
- Enhanced cpaGetInstances() for accurate instance retrieval
- Added 57-bit virtual address support to lac_lock_free_stack
- Minor bug fixes and improvements

Signed-off-by: Hareshx Sankar Raj <hareshx.sankar.raj@intel.com>

Reviewed by:	markj
MFC after:	1 month
Differential Revision:	https://reviews.freebsd.org/D57746

(cherry picked from commit 682f135f5de39cfc24cfd529ea8a161e94c76c8e)
2026-09-13 13:58:02 +02:00
Krzysztof Galazka
a6b97d3e1b ice(4): Add two more 4-part IDs for E835 adapters
Two additional subdevice IDs were introduced
to distinguish between adapters with and without
manageability over USB support.

Signed-off-by: Krzysztof Galazka <krzysztof.galazka@intel.com>

Reviewed by:	erj
Tested by:      Mateusz Moga <mateusz.moga@intel.com>
Sponsored by:   Intel Corporation
Differential Revision:  https://reviews.freebsd.org/D57337

(cherry picked from commit f370d9e4d5844daa06d77e57236e03bd7c5f4ba1)
2026-09-13 13:53:23 +02:00
Pawel Sobczyk
716a3c00e9 ice(4): Add support for E835 CNSA 2.0 adapters
Added support for E835 adapters with post-quantum cryptographic (PQC)
algorithms in firmware/software signage and in SPDM attestation.

Signed-off-by: Pawel Sobczyk <pawel.sobczyk@intel.com>

Reviewed by:	Miłosz Linkiewicz <milosz.linkiewicz@intel.com>
Differential Revision:	https://reviews.freebsd.org/D57868

(cherry picked from commit 8194c32827e9c3867d4b295edca9842b71608526)
2026-09-13 13:53:15 +02:00
Kevin Bowling
3b63e75ca9 ice: Report initialization failures to iflib
The primary and mirror-VSI ifdi_init callbacks can return early when
reset state or hardware queue and filter setup prevents initialization.
Iflib then marks the interface running and enables interrupts although
the driver did not finish bringing it up.

Report each non-detach failure through iflib_init_failed().  Keep the
existing ice reset and subinterface-reinitialization machinery
responsible for scheduling recovery.

(cherry picked from commit dcdc00a41d3e4be0e75eb625cd3a23d5a927ed15)
2026-09-13 13:52:10 +02:00
Kevin Bowling
a5f6cebe39 ice: Add led(4) identification support
Expose the firmware-controlled physical port identification LED
through /dev/led/ice*.  Use the AdminQ port-identification command to
select blinking mode and restore the netlist-selected original mode
before the interface is stopped.

Sponsored by:	BBOX.io

(cherry picked from commit a781965b91ea390f9576ae42c35c842db74aab86)
2026-09-13 13:51:31 +02:00
Kevin Bowling
b8a3d9c626 e1000: Report corrected LAN management FIFO ECC errors
I350 and I354 report a corrected ECC error in the LAN transmit
management FIFO through LANPERRSTS bit 16.  Unlike the parity status in
the same register, this condition neither interrupts nor stops traffic.

Poll the latch with the other corrected error status, increment a
dedicated counter, and clear only its RW1C bit.  Expose it as
dev.igb.N.memory_errors.corrected_lan_mng_fifo.

Fatal error handling returns before the periodic statistics sweep and
may reset the device.  Drain all I350 and I354 corrected-error status in
the admin task before recovery so the reset does not discard pending
indications.

This follows section 6.21.16 of the Intel Atom Processor C2000 Product
Family Integrated GbE Controller Programmer's Reference Manual,
document 537426 revision 1.5.

Sponsored by:	BBOX.io

(cherry picked from commit 2f095faebb195735879d9caad164ce807d85ddf7)
2026-09-13 13:49:24 +02:00
Kevin Bowling
fb68099015 e1000: Handle I354 internal memory errors
The Atom C2000 integrated GbE programming reference documents the I354
internal memory error architecture.  It shares the I350 PEIND and
ICR.FER routing, DMA and packet-buffer status, LAN parity status, and
required reset recovery.

Extend the existing I350 recovery and corrected error accounting paths
to I354.  Keep the PCIe corrected error mask family-specific.  C2000
PCIEECCSTS ends at the transmit write-data indication in bit 4 and does
not implement the I350 retry buffer indication in bit 5.  Do not expose
the corresponding retry counter on I354.

The PRM overview says a PCIe region failure requires a system reboot,
while the individual PCIEERRSTS fields prescribe CTRL.RST followed by
port reinitialization.  Use the register specific recovery, matching the
existing I350 path; failed reinitialization still leaves the port down.

This follows sections 5.6 and 6.21 of the Intel Atom Processor C2000
Product Family Integrated GbE Controller Programmer's Reference Manual,
document 537426 revision 1.5.

Sponsored by:	BBOX.io

(cherry picked from commit 5b4a7fd9378abba882a87330af31351c6353aea7)
2026-09-13 13:49:21 +02:00
Kevin Bowling
332d07c446 bnxt: Add led(4) identification support
Query the firmware for the LEDs on each physical port and expose
/dev/led/bnxt* only when alternate blinking is supported.  Configure
every LED in the advertised group for identification and restore its
default firmware state before a function reset.

This follows the DPDK and Linux bnxt HWRM identification paths.

Reviewed against: DPDK, Linux

Reviewed by:	Sumit Saxena <sumit.saxena@broadcom.com>
Sponsored by:	BBOX.io

(cherry picked from commit 98b5640786f874949e441bee7c4ad5740cd6a649)
2026-09-11 10:53:05 +02:00
Kevin Bowling
e4f36724d2 bnxt: Report initialization failures to iflib
HWRM failures currently return from the void ifdi_init callback.
iflib then marks the interface running and enables interrupts despite an
incomplete ring or VNIC setup.

Move the hardware setup into an error-returning helper.  The ifdi_init
wrapper can report failure through iflib_init_failed(), while firmware
recovery can propagate the same error through bnxt_open().  Also clear
the initialized state after partial setup is torn down.

(cherry picked from commit cb0e8f5fb6de03428137c096b1c8b62710829029)
2026-09-11 10:52:55 +02:00
Kevin Bowling
2ed2a2be47 ixgbe: Probe additional controller variants
The shared base code already selects and configures the 82598 BX,
82599 KR, 82599 SFP Express Module, X552 XFI, X553 QSFP, and X553 N
QSFP device IDs, but the FreeBSD probe table omits them while DPDK lists
them.

Sponsored by:	BBOX.io

(cherry picked from commit 27f0491e3648722a892558416a768dda77850ad9)
2026-09-11 10:47:29 +02:00
Sobczyk, Pawel
9a5d923650 ix(4): Sanitize negative error codes
Due to development history FreeBSD driver error codes are reported
the same way as in Linux (as negatives) which is inconsistent
with FreeBSD standard. It may cause unexpected behavior when driver
errors are interpreted by a kernel as syscall handler return values.
This patch converts error codes from negative to positive values for
NVM access functions.

Signed-off-by: Pawel Sobczyk <pawel.sobczyk@intel.com>

Reviewed by:	kbowling, erj, milosz.linkiewicz_intel.com
Tested by:      Mateusz Moga <mateusz.moga@intel.com>
Sponsored by:   Intel Corporation
Differential Revision:	https://reviews.freebsd.org/D57642

(cherry picked from commit 33e2eac3e3e738daa95a06f42d6c661b87ad9aac)
2026-09-11 10:47:29 +02:00
Krzysztof Galazka
3add8f7553 ix(4): Remove workaround for 2.5/5G speeds on E610
The problem observed on X550 adapters with 2.5 and 5 Gbps speeds
negotiation on some switches is not affecting E610 adapters.
Remove workaround, which omitted those speeds in the list
of initially advertised speeds and advertise all speeds
supported by adapter.

Signed-off-by: Krzysztof Galazka <krzysztof.galazka@intel.com>

Reviewed by:	kbowling
Tested by:	Mateusz Moga <mateusz.moga@intel.com>
Sponsored by:	Intel Corporation
Differential Revision:	https://reviews.freebsd.org/D57339

(cherry picked from commit 62d5d119ee7d935ac05966f1c7c4333c33c4f3a9)
2026-09-11 10:47:29 +02:00
Kevin Bowling
a1966b94ad ixgbe: Add missing mailbox API 1.6 definition
The SR-IOV status change reports mailbox API 1.6 but omitted its enum
definition, leaving main unable to compile.

API 1.6 is an established ixgbe mailbox wire revision.  Add it at the
end of the revision enum, before the unknown sentinel as required by
the stable numbering contract.  Naming the revision does not enable
negotiation or operations which will come with the E610 support.

Reported by:	Herbert J. Skuhra <herbert@gojira.at>

(cherry picked from commit 6a1703c112ff2904feb39288f0746c8f0a04f938)
2026-09-11 10:47:29 +02:00
Kevin Bowling
43a3eeec58 ixgbe: Enable per-pool RSS on X550 family devices
X550 family devices provide a separate RSS key, redirection table,
and MRQC register for every VMDq pool.  With SR-IOV enabled, the
driver continued programming only the global RSS state and never
selected MRQC.MULTIPLE_RSS.  VF-local RSS programming was therefore
ineffective.

Enable multiple-RSS mode for X550, X552, X553, and E610.  Initialize
the PF pool's 64-entry key, redirection table, and RSS hash controls.
Leave each VF pool untouched so its driver retains ownership of its
RSS key and mapping.

E610 folds IPv6 extension-header traffic into its base RSS selectors
and reserves the legacy EX selector bits.  Translate those requested
hash types rather than programming reserved bits.

With two E610 VFs active and four PF queue sets, eight fixed TCP flows
distributed across all four PF receive queues.

E610 uses the same per-pool mode according to the E610 Datasheet,
sections 7.1.3.6.2 and 8.2.2.8.20-21.

Sponsored by:	Dirk-Willem van Gulik from Web Weaving (E610 hardware)
Sponsored by:	BBOX.io

(cherry picked from commit 87406f8351664aa444851499cda83b00fdc07662)
2026-09-11 10:47:29 +02:00
Kevin Bowling
bd02e728e4 ixv: Preserve statistics across resets
The VF statistics registers are free running and are not cleared on
read.  The existing code records attach time bases and pre-reset totals,
but never uses either when publishing counters.  It instead replaces
the low hardware bits directly, so counters can inherit pre-attach
traffic or jump backward after a reset.

Accumulate modular 32- and 36-bit deltas, following DPDK, while keeping
the software totals across planned resets.  Establish a fresh hardware
baseline after each successful reset and invalidate the sampling epoch
when mailbox state is lost.  Detect unsolicited PF resets explicitly so
a reset while link is down cannot be mistaken for counter wrap.

Remove the unused base and saved-reset bookkeeping.

On E610, packet and octet counters remained monotonic across a VF FLR
and a PF down/up cycle.  Traffic after each reset advanced both RX and
TX counters.

Sponsored by:	BBOX.io

(cherry picked from commit cb85c4397bb3f57e60ab20c239b9339c4b752412)
2026-09-11 10:47:28 +02:00
Kevin Bowling
f8f1cab119 ixgbe: Enable SR-IOV on E610 PFs
E610 inherits the X550-family virtualization registers, anti-spoofing
controls, and malicious-driver operations, but the frontend does not
advertise SR-IOV and cannot negotiate the mailbox revision needed by
E610 VFs.

Initialize the X550-family PF/VF mailbox registers for E610 and use
PFVFLREC for its VF reset events, following DPDK shared ixgbe code.
Advertise the E610 SR-IOV capability, accept API 1.6 only on E610, carry
the existing xcast and queue operations forward to that revision, and
return the cached physical link speed and state with the three-dword
E610 operation.  Unsupported RSS and optional feature requests continue
to receive explicit failures.

SR-IOV activation also enables the existing X550-derived per-pool MDD
recovery path on E610.  Document the expanded protection and link-state
coverage.

Hardware validation created 63 VFs and rejected a 64th without flapping
the running PF.  Invalid TX and RX descriptor DMA independently asserted
the offender's WQBR bit, gated only that VF, preserved sibling traffic,
and recovered after the VF reset.  FreeBSD ixv, FreeBSD DPDK, Linux
ixgbevf, and Linux DPDK exercised the PF mailbox and data paths.

Relnotes:	yes
Sponsored by:	Dirk-Willem van Gulik from Web Weaving (E610 hardware)
Sponsored by:	BBOX.io

(cherry picked from commit df02513fd44bcede0aa8833ae5c2af826f63ce10)
2026-09-11 10:47:28 +02:00
Kevin Bowling
eb30da7b37 ixv: Support E610 mailbox API 1.6
E610 VFs no longer report the actual PF link state and speed through
VFLINKS.  They can consequently report the default 10 Gb/s speed even
when the physical link uses another rate.

Negotiate mailbox API 1.6 on E610 and request the PF link state with its
three-dword operation.  Retain VFLINKS as the fallback when an older PF
rejects API 1.6.  Permit API 1.6 in the inherited xcast and queue
discovery helpers so negotiating the newer revision does not disable
existing operations.

Use GET_QUEUES to replace E610's one-queue fallback with the grant from
the PF.  The common path continues to use one iflib queue set per data
MSI-X vector and caps the result at two queue pairs.

Preserve mailbox transport errors so the driver can distinguish an
explicit PF NACK from a transient timeout.  A NACK means clear-to-send
state was lost and requires a VF reset.  Preserve the last confirmed
link state across brief transport failures and publish link down after
three consecutive failures.

Poll E610 link state every two seconds, matching Intel's ixgbevf service
timer, and phase VFs across the intervening iflib timer ticks.  This
avoids a mailbox polling herd when many VFs share a PF.  Media-status
queries return the cached state instead of starting another synchronous
exchange.  An admin interrupt caused by a mailbox reply only checks for
an unsolicited PF reset, preventing a request/reply interrupt loop.

Hardware validation on an E610 10GBASE-T PF exercised 63 VFs.  Each VF
negotiated API 1.6, two queue pairs, and three MSI-X vectors.  Phased
polling kept 31 active VFs idle, and all 63 recovered after a PF
down/up cycle without watchdogs.

Adapt the API 1.6 link-state operation from DPDK shared ixgbe code.  The
timeout and NACK distinction follows Intel ixgbevf 5.3.25.

Sponsored by:	Dirk-Willem van Gulik from Web Weaving (E610 hardware)
Sponsored by:	BBOX.io

(cherry picked from commit 40367d1f3b8ff694ffc3e4bf3278ec2a762648d2)
2026-09-11 10:47:28 +02:00
Kevin Bowling
725a805f11 iflib: Complete registration failure cleanup
Pre-attach sysctls contain pointers into the iflib context. Any later
registration failure that frees the context must first remove that
sysctl tree.

Failures after a successful IFDI_ATTACH_PRE also did not consistently
call IFDI_DETACH or free the private taskqueue. In particular, routing
a taskqueue creation failure through the context cleanup could free the
driver softc while resources allocated by attach_pre remained live.

Track successful interrupt and queue setup and use one common unwind
path. Invoke IFDI_DETACH with IFNET_WLOCK dropped and release only
resources whose setup completed. Leave a failed IFDI_ATTACH_PRE to
unwind its own partial state, as required by the existing driver
contract.

A failed post-attach can follow driver registration of an SR-IOV
schema. Remove that registration before detaching the interface and
driver, matching normal deregistration, so a failed attach cannot leave
a stale /dev/iov node or make the next attach report EBUSY.

A successful attach_pre can now be followed by detach before driver
queue allocation. Make the remaining queue-backed interrupt cleanup
paths tolerate absent queue arrays.

Mark a failed registration as detaching before draining the entire
private taskqueue. Drivers can register configuration tasks there, and
taskqueue_drain_all() does not wait for work queued during its drain.
Make every current non-admin callback reject detaching contexts so late
work cannot touch driver state.

Drain tasks and call ether_ifdetach() with neither the ifnet nor context
lock held. A callback already running may need either lock, while
ether_ifdetach() acquires ifnet_detach_sx. Reacquire IFNET_WLOCK before
the context lock to preserve the established lock order.

The shared automatic core-offset allocator also lacked acquisition
state. Late registration failures leaked its reference, while normal
detach could decrement a reference belonging to another device when a
configured offset or allocation failure meant that this context never
acquired one. Record acquisition explicitly and release only references
held.

Reviewed by:	gallatin
Sponsored by:	BBOX.io
Differential Revision:	https://reviews.freebsd.org/D58721

(cherry picked from commit fe00ca2f88718c7751b8953cc8ee7fc0dad0bbe1)
2026-09-11 10:47:28 +02:00
Kevin Bowling
e8ca446c32 ixgbe: Defer E610 thermal shutdown to iflib
The E610 firmware event handler invoked ixgbe_if_stop() directly from
IFDI_UPDATE_ADMIN_STATUS().  This reset the device without the iflib
queue lifecycle and left the interface marked running after its hardware
was stopped.

Request an iflib reset instead.  Fail the automatic initialization once
so the reset transaction stops the interface and publishes that state.
A later operator-requested initialization remains possible, matching the
previous recovery policy without bypassing iflib.

(cherry picked from commit 3aac283613bd3fd0228a06d6c854ca0bf190ecfb)
2026-09-11 10:47:28 +02:00
Kevin Bowling
66f8ac4e9a ixgbe: Defer firmware recovery transitions to iflib
The firmware-mode callout invoked ixgbe_if_stop() directly.  This
performed a full device reset without the iflib context lock or the
iflib queue lifecycle.  It could also poll the E610 firmware command
interface from callout context while identification was active.

Request an iflib reset from the callout instead.  Reject initialization
while firmware recovery remains active.  This leaves the interface
stopped and lets iflib publish that state.  Request initialization when
firmware exits recovery so an administratively-up interface can recover
without operator intervention.

(cherry picked from commit 43aa553ef45a4345bdfabadae40d811730151144)
2026-09-11 10:47:28 +02:00
Kevin Bowling
4e255c8115 ixgbe: Defer ECC recovery to iflib
The link interrupt filter performed a full hardware reset in interrupt
context.  This bypassed iflib stop and initialization, including queue
quiescence and restoration of temporary LED state.

Record the ECC event in the administrative request mask and ask iflib
to perform the reset from its taskqueue.  Keep the ECC cause masked
until reset so the intermediate admin pass cannot re-enable a sticky
condition.  Handle ECC independently of Flow Director and in legacy
interrupt mode.

Remove the redundant EICR write; the filter has already cleared the
reported causes.  Also remove the accompanying complement-mask update
of mac.flags.  It set every flag except DOUBLE_RESET_REQUIRED and had
no place in ECC recovery.

(cherry picked from commit c28f2c551daf07345ac78b74459efe1014c49464)
2026-09-11 10:47:28 +02:00
Kevin Bowling
dce50d5c17 ixgbe: Add led(4) identification support
Expose the physical port identification LED through /dev/led/ix*.
Save and restore the NVM-selected LEDCTL value around each request.
The X550 operations also clear their PHY manual override before the
register is restored.

Use the dedicated firmware port-identification command on E610.  Its
interface selects between firmware blinking and the original mode
rather than directly controlling LEDCTL.

Restore the normal indication before a device stop or reset.

(cherry picked from commit fb7e249ce4fd03fe53e4407efe661f9e94852bb6)
2026-09-11 10:47:28 +02:00
Kevin Bowling
87ff05c517 ixgbe: Avoid a signed shift while assembling the PHY ID
The PHY identifier word is promoted to signed int when the cast is
applied after the shift.  Cast the 16-bit register value first so
identifiers with their high bit set are assembled as unsigned data.

(cherry picked from commit f4bf1da7bac80cbe3ec862f395c22a3c5d176312)
2026-09-11 10:47:27 +02:00
Kevin Bowling
abce5e421f ixgbe: Use unsigned register bitmap shifts
VLAN, VMDq, and VF reset bit indices can reach 31.  Use unsigned
values when constructing their 32-bit register masks so the shifts do
not operate on signed integers.

(cherry picked from commit bf6feffef6c16559333048859b24547acea3dba5)
2026-09-11 10:47:27 +02:00
Kevin Bowling
8e57e64057 ixgbe: Avoid signed overflow in LED register masks
LED index three shifts the blink bit into bit 31.  Convert the base to
the register width before shifting so the operation is unsigned.

This is the ixgbe counterpart of the e1000 correction imported from
DPDK commit 214cb0d7f1.

(cherry picked from commit bbdd3c4692e2869817f77c359b4a2719e716921d)
2026-09-11 10:47:27 +02:00
Kevin Bowling
1745e1dd91 ixgbe: Avoid a signed shift while assembling the PBA number
The EEPROM word is promoted to signed int before the left shift when
the cast is applied to the complete expression.  Cast the word first so
all 16-bit values are shifted as unsigned data.

This is the ixgbe counterpart of the e1000 correction imported from
DPDK commit b932270c66.

(cherry picked from commit baa6e3af8525244e65a404fa13306fbca7feae9c)
2026-09-11 10:47:27 +02:00
Kevin Bowling
9fbe0b369e ixgbe: Avoid a signed multicast bitmap shift
The multicast vector bit can be 31.  Use an unsigned value so setting
the bit cannot shift a signed integer into its sign bit.

(cherry picked from commit 8704d29c6cc86f0780dff3d3d17d744106776ad3)
2026-09-11 10:47:27 +02:00
Kevin Bowling
94240b6a20 ixgbe: Recognize production X550 PHY IDs
According to Linux 5f1c3589b0f0, the X550 PHY classifier still matches
an alpha silicon ID, while the shared definitions contain the two
production IDs.  This can leave production hardware on the generic
probing path and issue unnecessary PHY queries.

(cherry picked from commit 392f0af6685a06e89fecdc38cc2e910d2b84d738)
2026-09-11 10:47:27 +02:00
Kevin Bowling
a34a02f8c1 ixgbe: Preserve the full VF RSS domain in the shared RETA
The 82599 and X540 share the global RSS redirection table between the
PF and its VFs.  Programming that table from the PF queue count
prevents a VF from using queue indices absent from the PF layout.  A
one-queue PF consequently directs every flow for a two- or four-queue
VF to queue zero.

Program at least four queue indices while SR-IOV is active.  Each pool
PSRTYPE.RQPL field masks the shared table to the queue subset available
to that function, so the PF can continue using fewer queues.

(cherry picked from commit 8b668bc7e7c8b0a1bcb018360a4aafa445ff554f)
2026-09-11 10:47:27 +02:00
Kevin Bowling
bc67f835bb ixgbe: Add 10GBase-BX BiDi SFP+ module support
10G-BX optics use paired wavelengths to carry 10 Gb/s Ethernet over a
single strand of single-mode fiber.  Their 10G compliance byte is
empty, so identify them from the SFF-8472 nominal signaling rate and
single-mode reach fields.

When an EEPROM also advertises 1G BASE-BX10, give the complete 10G
bitrate and reach signature precedence.  Otherwise retain FreeBSD's
permissive 1G-BX identification rather than requiring a nominal
1.3 GBd rate.

Relnotes:	yes

(cherry picked from commit f9ce33b0d8ef233063bd6c27bdba2580f97d9094)
2026-09-11 10:47:27 +02:00
Kevin Bowling
73fe8b7be6 ixgbe: Expose EEE LPI event counters
X550-family devices provide clear-on-read counters for transmit and
receive Low Power Idle events.  Accumulate each register once in the
normal statistics poll and expose the monotonic totals below the eee
sysctl node.  Document the counters together with the existing EEE
control.

Obtained from:	Intel ix 3.4.39

(cherry picked from commit ff86fd4f36618dacf1628180034c312c70294276)
2026-09-11 10:47:27 +02:00
Kevin Bowling
bce0299ca0 ixv: Report multigigabit link speeds
The VF link-status path can receive 2.5 and 5 Gb/s speed bits from
X550-family PFs, but media reporting has no cases for them.  The
bootverbose message also assumes every non-10-Gb/s link is 1 Gb/s.

Expose the corresponding ifmedia subtypes and derive the diagnostic
speed through the shared link-speed conversion helper.

(cherry picked from commit a884921abbaf52ff862a32ff6806bf071974faa6)
2026-09-11 10:47:27 +02:00
Kevin Bowling
c396fa4075 ixgbe: Compare flow control against requested mode
The flow-control sysctl represents the configured policy, while
current_mode is the mode negotiated with the link partner.  Comparing a
new request with current_mode can needlessly reprogram an unchanged
policy or skip a requested policy change that happens to match the
current negotiation result.

Compare with requested_mode before deciding that no update is needed.

(cherry picked from commit c410551b9feadf9b65f920fd25714fcda8299a56)
2026-09-11 10:47:27 +02:00
Kevin Bowling
f4ec8890a2 ixgbe: Validate EEPROM checksum section bounds
The generic checksum walker trusts NVM section pointers and lengths and
iterates with a 16-bit index.  A corrupt section that crosses the end of
the EEPROM can wrap the index and leave the driver in an effectively
unbounded read loop during attach.

Validate each non-empty section against the discovered EEPROM word size
before reading it, and use widened arithmetic for the inclusive end and
iterator.

(cherry picked from commit be3e1068ea8699fb719691453899ca20a601fe1d)
2026-09-11 10:47:26 +02:00
Kevin Bowling
dea818fc1f ixgbe: Restore missed packet accounting
missed_rx and total_missed_rx are never populated.  As a result, the
GPRC erratum workaround does not remove missed packets and iqdrops
always remains zero.  The rx_missed_packets sysctl and input-error total
also expose only MPC bank zero.

Read and accumulate all eight MPC banks.  Use the interval total to
correct GPRC and the cumulative total for iqdrops, input errors, and the
aggregate sysctl.  This matches DPDK's coverage of the hardware banks.

(cherry picked from commit 660099c985e8bfc931b01398715441c90cf0d4db)
2026-09-11 10:47:26 +02:00
Kevin Bowling
4dc09b2e3d ixgbe: Preserve VF jumbo frame size across PF resets
sc->max_frame_size represents the largest frame requested by the PF or
an active VF.  The MTU callback replaces it with the PF frame size, so
a subsequent reinitialization can program MHADD below an active VF's
jumbo-frame request.

Recompute the aggregate before hardware initialization and use it when
programming MHADD.  Recompute after each VF LPE request as well, so a
reduced request can lower the hardware limit when no other function
needs the previous value.

(cherry picked from commit 877f0ee40c2af801c5ca758a37b3ebddc560dad2)
2026-09-11 10:47:26 +02:00
Kevin Bowling
b76c496265 ixgbe: Enable PF RSS across queues with SR-IOV
PSRTYPE is indexed by pool in VMDq+RSS mode, and its RQPL
field selects the number of receive queues available within the pool.
The PF occupies the last pool, but the driver programmed pool zero and
left the PF RQPL value at zero.  As a result, all PF receive traffic
was directed to its first queue while SR-IOV was enabled.

Program PSRTYPE for the PF pool and encode its allocated receive queue
count.

(cherry picked from commit 49f9143d9a37a4646c9f4ddac53b97dde04e3fa3)
2026-09-11 10:47:26 +02:00
Kevin Bowling
7a4c735aed ixv: Recover when the PF mailbox is unavailable
A failed VF reset or mailbox API negotiation currently returns from
the void ifdi_init callback. Iflib then marks the interface running
even though ixv left its adapter stopped. Stopped media queries can
continue polling the PF, and no timer remains active to retry when the
PF returns.

Track mailbox readiness and report unsuccessful initialization to
iflib. Stopped admin and media-status passes now publish cached
link-down state without touching the mailbox. While the VF remains
administratively up, retry complete initialization after 250 ms, one
second, four seconds, and then at a capped eight-second interval.

Preserve the requested MAC across reset, then program it once after
mailbox API negotiation. The previous two pre-reset requests each
could wait a full mailbox timeout after an established PF disappeared,
holding the iflib context lock for about two seconds before the reset
handshake.

Avoid a redundant VF reset in the stop half of an immediate iflib
reinitialization. Also remove the stop-time RAR mailbox request: reset
has already discarded CTS at that point, and successful initialization
restores the current address. Retain a reset for an ordinary
administrative stop when the mailbox was established.

(cherry picked from commit 0e56ccb5d86618994f884da21dfce692ad21e458)
2026-09-11 10:47:26 +02:00
Kevin Bowling
4518348fd1 ixgbe: Correct the PFVFRSSRK index range comment
PFVFRSSRK contains ten 32-bit RSS key words, numbered 0 through 9.
The previous inclusive range incorrectly ended at 10.

Sponsored by:	BBOX.io

(cherry picked from commit f177ff939a91a3d710752438b13aff53d5afc725)
2026-09-11 10:47:26 +02:00
Kevin Bowling
b914089b39 ixv: Reject unsupported E610 Hyper-V VFs
E610 Hyper-V VFs use PCI configuration space communication instead of
the native PF/VF mailbox.  The generic E610 match currently attaches
native mailbox operations to those devices, and the imported Hyper-V
subdevice identifier is incorrect.

Correct the subdevice identifier to 0x00ff, as used by DPDK shared
ixgbe code, and reject that subtype until ixv has a complete Hyper-V
operations table.

Sponsored by:	BBOX.io

(cherry picked from commit 08c41a679b281505eb7f1fd0cb528f3c1fe87fed)
2026-09-11 10:47:26 +02:00
Kevin Bowling
45a80306c3 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)
2026-09-11 10:47:26 +02:00
Kevin Bowling
7474ca08a2 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)
2026-09-11 10:47:26 +02:00
Kevin Bowling
0fe55f92b5 ixv: Advertise SCTP checksum offload
The shared ixgbe transmit path already creates SCTP context
descriptors, and the hardware exposes the same checksum capability to
VFs.  Advertise it through iflib as the PF driver does.

(cherry picked from commit 4a13b8a7c5611059384309fdebad8e0fb49a73c2)
2026-09-11 10:47:26 +02:00
Kevin Bowling
68bbd5a400 ixv: Remove unused loader tunables
The flow_control and hdr_split variables have never been read.  VF
flow control is controlled by the PF, while implementing header split
would require receive-path support that ixv does not provide.

(cherry picked from commit 8eeb25899afd7818d99ce1500be27ae8d992131f)
2026-09-11 10:47:26 +02:00
Kevin Bowling
fcfb56b513 ixgbe: Reject Flow Director with SR-IOV
The iflib Flow Director path does not assign filters using the
absolute queue and pool identifiers required by SR-IOV.  Reject the
combination during preflight validation rather than allowing an
unsupported configuration to alter the PF receive path.

The loader tunable is fixed before VFs can be created, so validation
also prevents the reverse ordering of this combination.

(cherry picked from commit c017bceda48c766780ab1d2239b296242fcf9cf2)
2026-09-11 10:47:25 +02:00
Kevin Bowling
b2f13be38b ixgbe: Drain events for inactive VFs
The aggregate VF mailbox poll includes only VFs whose driver
configuration completed. A configured VF slot whose vf_add callback
failed can nevertheless report reset, request, or acknowledgement
events. Because the mailbox handler skips inactive entries, such an
event remains latched and can retrigger administrative work
indefinitely.

Build the poll masks from every configured VF index and consume reset,
message, and acknowledgement events for inactive entries without
treating them as usable VFs. Use the index rather than the pool because
early vf_add errors precede pool initialization. Also include E610
PFVFLREC in aggregate reset sampling.

(cherry picked from commit 5017a241b987d365beb2c35faf0017b6afef2b64)
2026-09-11 10:47:25 +02:00
Kevin Bowling
11a296e1ce ixgbe: Handle deferred link-status requests
The iflib conversion records link-status interrupts in the
administrative request mask, but the administrative task did not
consume them.  Timer polling usually hid the omission; frequent mailbox
interrupts could continually rearm that timer and leave cached link
state down after hardware recovered.

Claim request batches atomically, process link-setup dependencies, and
sample hardware before publishing link state.  Bound each invocation to
eight batches and requeue residual work so a continuous producer cannot
monopolize the admin taskqueue.

Queue every link-related request from the legacy interrupt path.
Unlike MSI-X, its threaded continuation services RX and does not enqueue
the admin task.  This restores the event-driven behavior of ix-3.4.39.

Fixes:	b2c1e8e620 ("ix(4): Run {mod,msf,mbx,fdir,phy}_task in if_update_admin_status")

(cherry picked from commit 2b763a82f9f21b722b50830bc22af2b2acf36746)
2026-09-11 10:47:25 +02:00
Kevin Bowling
f1c0af6ffb ixv: Tolerate temporary PF mailbox unavailability
A PF can be resetting, handling a slow link event, or deliberately
withholding mailbox CTS while its VFs enumerate. Keep the VF attached
when the reset handshake is temporarily unavailable so a later if_init
can retry.

Never leave VF hardware running without a negotiated mailbox API: start
hardware only after reset succeeds, stop it when negotiation fails in
attach or init, and defer later recovery through iflib. This prevents a
tight reset loop while preserving recovery when the PF returns.

(cherry picked from commit 26e3a8045ec7e2abfea9e2e49577c5e2c4226df1)
2026-09-11 10:47:25 +02:00
Kevin Bowling
228a9a5dbe ixgbe: Quiesce VFs across PF reset
Stop VF transmit and receive in hardware, clear PF-side mailbox CTS,
and notify active VFs before resetting a PF. A PF reset invalidates VF
queue state, so the no-CTS control message makes cooperative VFs
discard stale state and renegotiate after the PF returns.

The hardware queue gates synchronously prevent further VF DMA. Do not
hold the exclusive iflib context lock for a fixed VF-watchdog interval
after the reset. Report the PF link transition directly instead of
dispatching mailbox work from the stop path, which could otherwise
re-enable VF I/O mid-reset.

The CTS, PF-control, and VF queue controls follow the reset mechanisms
used by DPDK.

(cherry picked from commit aea4240ef5834fb4a47f80c659c80f902cb4bb06)
2026-09-11 10:47:25 +02:00