Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 08 Aug 2026 00:44:05 +0000
From:      Kevin Bowling <kbowling@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Cc:        Daniil Iskhakov <dish@amicon.ru>
Subject:   git: d535381ea414 - stable/14 - ixgbe: avoid flow control counter overflow
Message-ID:  <6a767bd5.4052c.3fff3bab@gitrepo.freebsd.org>

index | next in thread | raw e-mail

The branch stable/14 has been updated by kbowling:

URL: https://cgit.FreeBSD.org/src/commit/?id=d535381ea414ec12163339d8438ff03cbabdf7e9

commit d535381ea414ec12163339d8438ff03cbabdf7e9
Author:     Daniil Iskhakov <dish@amicon.ru>
AuthorDate: 2026-07-28 11:07:33 +0000
Commit:     Kevin Bowling <kbowling@FreeBSD.org>
CommitDate: 2026-08-08 00:41:23 +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)
    
    (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);


home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?6a767bd5.4052c.3fff3bab>