git: 7ea168178477 - stable/15 - ixgbe: Restore missed packet accounting
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Mon, 24 Aug 2026 00:53:45 UTC
The branch stable/15 has been updated by kbowling:
URL: https://cgit.FreeBSD.org/src/commit/?id=7ea168178477c211dc288e7e04165dca53f6a307
commit 7ea168178477c211dc288e7e04165dca53f6a307
Author: Kevin Bowling <kbowling@FreeBSD.org>
AuthorDate: 2026-08-10 15:09:29 +0000
Commit: Kevin Bowling <kbowling@FreeBSD.org>
CommitDate: 2026-08-24 00:50:20 +0000
ixgbe: Restore missed packet accounting
missed_rx and total_missed_rx are never populated. As a result, the
GPRC erratum workaround does not remove missed packets and iqdrops
always remains zero. The rx_missed_packets sysctl and input-error total
also expose only MPC bank zero.
Read and accumulate all eight MPC banks. Use the interval total to
correct GPRC and the cumulative total for iqdrops, input errors, and the
aggregate sysctl. This matches DPDK's coverage of the hardware banks.
(cherry picked from commit 660099c985e8bfc931b01398715441c90cf0d4db)
---
sys/dev/ixgbe/if_ix.c | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/sys/dev/ixgbe/if_ix.c b/sys/dev/ixgbe/if_ix.c
index 83848f4d1bd6..8c3bb0c790af 100644
--- a/sys/dev/ixgbe/if_ix.c
+++ b/sys/dev/ixgbe/if_ix.c
@@ -1911,7 +1911,7 @@ 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;
+ u32 missed_rx = 0, mpc, bprc, lxon, lxoff;
u32 lxoffrxc;
u64 total_missed_rx = 0, total;
@@ -1919,7 +1919,13 @@ ixgbe_update_stats_counters(struct ixgbe_softc *sc)
stats->illerrc += IXGBE_READ_REG(hw, IXGBE_ILLERRC);
stats->errbc += IXGBE_READ_REG(hw, IXGBE_ERRBC);
stats->mspdc += IXGBE_READ_REG(hw, IXGBE_MSPDC);
- stats->mpc[0] += IXGBE_READ_REG(hw, IXGBE_MPC(0));
+ for (int i = 0; i < nitems(stats->mpc); i++) {
+ mpc = IXGBE_READ_REG(hw, IXGBE_MPC(i));
+ missed_rx += mpc;
+ stats->mpc[i] += mpc;
+ total_missed_rx += stats->mpc[i];
+ }
+ stats->mpctotal = total_missed_rx;
for (int i = 0; i < 16; i++) {
stats->qprc[i] += IXGBE_READ_REG(hw, IXGBE_QPRC(i));
@@ -2041,7 +2047,7 @@ ixgbe_update_stats_counters(struct ixgbe_softc *sc)
* - jabber count.
*/
IXGBE_SET_IERRORS(sc, stats->crcerrs + stats->illerrc +
- stats->mpc[0] + stats->rlec + stats->ruc + stats->rfc +
+ stats->mpctotal + stats->rlec + stats->ruc + stats->rfc +
stats->roc + stats->rjc);
} /* ixgbe_update_stats_counters */
@@ -2154,7 +2160,7 @@ ixgbe_add_hw_stats(struct ixgbe_softc *sc)
SYSCTL_ADD_UQUAD(ctx, stat_list, OID_AUTO, "rec_len_errs",
CTLFLAG_RD, &stats->rlec, "Receive Length Errors");
SYSCTL_ADD_UQUAD(ctx, stat_list, OID_AUTO, "rx_missed_packets",
- CTLFLAG_RD, &stats->mpc[0], "RX Missed Packet Count");
+ CTLFLAG_RD, &stats->mpctotal, "RX Missed Packet Count");
/* Flow Control stats */
SYSCTL_ADD_UQUAD(ctx, stat_list, OID_AUTO, "xon_txd",