git: 44193b7f8e2f - stable/15 - ixgbe: avoid flow control counter overflow
Kevin Bowling <[email protected]>
| Newsgroups | gmane.os.freebsd.devel.cvs.src |
|---|---|
| Message-ID | <6a767a7b.3dd60.24595d47__43204.6753865265$1786149575$gmane$org@gitrepo.freebsd.org> |
The branch stable/15 has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=44193b7f8e2f814c7777ca8bf7cdac62793011b3 commit 44193b7f8e2f814c7777ca8bf7cdac62793011b3 Author: Daniil Iskhakov <[email protected]> AuthorDate: 2026-07-28 11:07:33 +0000 Commit: Kevin Bowling <[email protected]> CommitDate: 2026-08-08 00:35:16 +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: [email protected] Signed-off-by: Daniil Iskhakov <[email protected]> Acked-by: Bruce Richardson <[email protected]> Obtained from: DPDK (bdf8608559) (cherry picked from commit 21e03ab39603fbab4bcef1dd61fe75e9e9276079) --- 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 05448da71604..eb7e2ab00d3f 100644 --- a/sys/dev/ixgbe/if_ix.c +++ b/sys/dev/ixgbe/if_ix.c @@ -1871,9 +1871,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); @@ -1942,7 +1942,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);