git: 21e03ab39603 - main - ixgbe: avoid flow control counter overflow
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Fri, 31 Jul 2026 11:06:35 UTC
The branch main has been updated by kbowling:
URL: https://cgit.FreeBSD.org/src/commit/?id=21e03ab39603fbab4bcef1dd61fe75e9e9276079
commit 21e03ab39603fbab4bcef1dd61fe75e9e9276079
Author: Daniil Iskhakov <dish@amicon.ru>
AuthorDate: 2026-07-28 11:07:33 +0000
Commit: Kevin Bowling <kbowling@FreeBSD.org>
CommitDate: 2026-07-31 11:04:35 +0000
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
---
sys/dev/ixgbe/if_ix.c | 6 +++---
1 file 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);