|SUCCESS| net/ixgbe: fix flow control frame byte adjustment
dpdklab at iol.unh.edu
dpdklab at iol.unh.edu
Wed May 6 02:09:07 CEST 2026
Test-Label: ai-code-review
Test-Status: SUCCESS
https://dpdk.org/patch/163591
_AI Code Review_
=== Patch Review: series.patch (via Claude) ===
Review date: 2026-05-06
Commit SHA: 20260504145502.160806-1-dish at amicon.ru
Author: Daniil Iskhakov <dish at amicon.ru>
Subject: [PATCH] net/ixgbe: fix flow control frame byte adjustment
This patch changes total from uint32_t to uint64_t to prevent arithmetic
overflow when summing XON and XOFF packet counts and casts lxon to
uint64_t before addition.
> diff --git a/drivers/net/intel/ixgbe/ixgbe_ethdev.c b/drivers/net/intel/ixgbe/ixgbe_ethdev.c
> index 57d929cf2c..cff2dbd900 100644
> --- a/drivers/net/intel/ixgbe/ixgbe_ethdev.c
> +++ b/drivers/net/intel/ixgbe/ixgbe_ethdev.c
> @@ -3181,7 +3181,8 @@ ixgbe_read_stats_registers(struct ixgbe_hw *hw,
> uint64_t *total_missed_rx, uint64_t *total_qbrc,
> uint64_t *total_qprc, uint64_t *total_qprdc)
> {
> - uint32_t bprc, lxon, lxoff, total;
> + uint32_t bprc, lxon, lxoff;
> + uint64_t total;
Does the change in declaration order here conflict with DPDK coding
style requirements for reverse Christmas tree ordering of variable
declarations? The coding style guide requests that variable declarations
be ordered longest line to shortest.
> uint32_t delta_gprc = 0;
> unsigned i;
> /* Workaround for RX byte count not including CRC bytes when CRC
[ ... ]
> @@ -3310,7 +3311,7 @@ ixgbe_read_stats_registers(struct ixgbe_hw *hw,
> hw_stats->lxontxc += lxon;
> lxoff = IXGBE_READ_REG(hw, IXGBE_LXOFFTXC);
> hw_stats->lxofftxc += lxoff;
> - total = lxon + lxoff;
> + total = (uint64_t)lxon + lxoff;
The fix correctly promotes lxon to uint64_t before addition, which
prevents the 32-bit overflow issue described in the commit message.
More information about the test-report
mailing list