[PATCH] net/ixgbe: fix queue received bytes CRC adjustment

Bruce Richardson bruce.richardson at intel.com
Wed May 6 17:59:20 CEST 2026


On Mon, May 04, 2026 at 03:26:23PM +0300, Daniil Iskhakov wrote:
> For 82599, QBRC is a 36-bit clear-on-read counter, while
> QPRC is a 32-bit clear-on-read counter. ixgbe_read_stats_registers()
> accumulates QBRC in a 64-bit software counter and, when CRC stripping
> is disabled, subtracts the CRC bytes accounted for each received packet.
> 
> The CRC adjustment is computed as:
> 
> 	delta_qprc * RTE_ETHER_CRC_LEN
> 
> Since delta_qprc is 32-bit, the multiplication is performed in 32 bits
> and may wrap before the result is subtracted from the 64-bit QBRC
> accumulator. A full 32-bit packet delta needs more than 32 bits to
> represent the CRC-byte adjustment.
> 
> Cast delta_qprc to uint64_t before the multiplication so the adjustment
> is computed with the same effective width as the byte counter.
> 
> Found by Linux Verification Center (linuxtesting.org) with SVACE.
> 
> Fixes: c03fcee9abbd ("ixgbe: remove CRC size from byte counters")
> Cc: stable at dpdk.org
> 
> Signed-off-by: Daniil Iskhakov <dish at amicon.ru>
> ---

Acked-by: Bruce Richardson <bruce.richardson at intel.com>

Applied to dpdk-next-net-intel.

Thanks,
/Bruce



More information about the dev mailing list