opnsense-src/sys/dev/axgbe
Stephan de Wit 97a14fd387
axgbe: fix receive buffers without split-header mode (#344)
When split-header mode is disabled, an RX descriptor contains two data buffers. The driver previously programmed both buffer addresses with the same physical address, causing the second DMA transfer to overwrite the first.

Split each iflib receive cluster into two contiguous hardware buffers and program the second descriptor address at the cluster midpoint. Keep the hardware buffer size consistent across attach, MTU changes, initialization and descriptor refill. The important bit here is to make pdata->rx_buf_size authoritative.

Update packet-length accounting so a complete non-final descriptor accounts for both buffers and the final descriptor contains only the remaining packet data. Validate the residual length before exposing it to iflib, returning an error when the hardware-reported length cannot fit in the descriptor.

Finally, clear the per-descriptor split-header length unconditionally and only read or use it when split-header mode is enabled.

Co-authored-by: @J-cztery
2026-10-30 11:33:06 +01:00
..
if_axgbe.c chore: replace {0, 0} with {DEV,KOBJ}METHOD_END 2026-04-25 09:46:07 -07:00
if_axgbe_pci.c axgbe: fix receive buffers without split-header mode (#344) 2026-10-30 11:33:06 +01:00
xgbe-common.h axgbe: add support for Yellow Carp Ethernet device 2026-06-25 11:18:46 +02:00
xgbe-dcb.c
xgbe-desc.c
xgbe-dev.c axgbe: fix receive buffers without split-header mode (#344) 2026-10-30 11:33:06 +01:00
xgbe-drv.c
xgbe-i2c.c axgbe: gracefully handle i2c bus failures 2026-06-25 11:18:46 +02:00
xgbe-mdio.c axgbe: gracefully handle i2c bus failures 2026-06-25 11:18:46 +02:00
xgbe-phy-v1.c axgbe: gracefully handle i2c bus failures 2026-06-25 11:18:46 +02:00
xgbe-phy-v2.c axgbe: Reset PHY RX data path when mailbox command times out 2026-06-25 11:18:46 +02:00
xgbe-ptp.c
xgbe-sysctl.c axgbe: use standard rounddown_pow_of_two 2024-07-18 13:56:31 -05:00
xgbe-txrx.c axgbe: fix receive buffers without split-header mode (#344) 2026-10-30 11:33:06 +01:00
xgbe.h axgbe: Implement ifdi_i2c_req for diagnostics information 2026-06-25 11:18:46 +02:00
xgbe_osdep.c
xgbe_osdep.h axgbe: use bit_foreach 2024-08-12 16:04:32 -05:00