aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniil Iskhakov <dish@amicon.ru>2026-07-28 11:07:33 +0000
committerKevin Bowling <kbowling@FreeBSD.org>2026-07-31 11:04:35 +0000
commit21e03ab39603fbab4bcef1dd61fe75e9e9276079 (patch)
treec5fd24579d8782076c5f5c4c5d4d027c3dddf8f5
parente45178957d3a25a162279687d82ce791d8253f97 (diff)
ixgbe: avoid flow control counter overflow
DPDK commit message net/ixgbe: fix flow control frame byte adjustment LXONTXC and LXOFFTXC are 32-bit counters for transmitted XON and XOFF packets. Their deltas are summed and used to adjust the transmitted packet and byte counters. Perform the addition in 64 bits so it cannot wrap before the result is used for the byte adjustment. Found by Linux Verification Center (linuxtesting.org) with SVACE. Fixes: af75078fece3 ("first public release") Cc: stable@dpdk.org Signed-off-by: Daniil Iskhakov <dish@amicon.ru> Acked-by: Bruce Richardson <bruce.richardson@intel.com> Obtained from: DPDK (bdf8608559) MFC after: 1 week
-rw-r--r--sys/dev/ixgbe/if_ix.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/dev/ixgbe/if_ix.c b/sys/dev/ixgbe/if_ix.c
index b9d88fcab523..b7ca21d4a313 100644
--- a/sys/dev/ixgbe/if_ix.c
+++ b/sys/dev/ixgbe/if_ix.c
@@ -1882,9 +1882,9 @@ ixgbe_update_stats_counters(struct ixgbe_softc *sc)
{
struct ixgbe_hw *hw = &sc->hw;
struct ixgbe_hw_stats *stats = &sc->stats.pf;
- u32 missed_rx = 0, bprc, lxon, lxoff, total;
+ u32 missed_rx = 0, bprc, lxon, lxoff;
u32 lxoffrxc;
- u64 total_missed_rx = 0;
+ u64 total_missed_rx = 0, total;
stats->crcerrs += IXGBE_READ_REG(hw, IXGBE_CRCERRS);
stats->illerrc += IXGBE_READ_REG(hw, IXGBE_ILLERRC);
@@ -1953,7 +1953,7 @@ ixgbe_update_stats_counters(struct ixgbe_softc *sc)
stats->lxontxc += lxon;
lxoff = IXGBE_READ_REG(hw, IXGBE_LXOFFTXC);
stats->lxofftxc += lxoff;
- total = lxon + lxoff;
+ total = (u64)lxon + lxoff;
stats->gptc += IXGBE_READ_REG(hw, IXGBE_GPTC);
stats->mptc += IXGBE_READ_REG(hw, IXGBE_MPTC);