git: bbf0372feeb3 - main - igc: fix RX accounting for multi-descriptor packets

Kevin Bowling <[email protected]>
Newsgroups gmane.os.freebsd.devel.cvs.src
Message-ID <6a655c5a.32f97.76bb2afc__6116.56250418804$1785027768$gmane$org@gitrepo.freebsd.org>
The branch main has been updated by kbowling:

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

commit bbf0372feeb321a5bfeff7b1e79576ab01240441
Author:     Kevin Bowling <[email protected]>
AuthorDate: 2026-07-25 23:56:29 +0000
Commit:     Kevin Bowling <[email protected]>
CommitDate: 2026-07-26 01:00:02 +0000

    igc: fix RX accounting for multi-descriptor packets
    
    The receive path adds the running packet length to rx_bytes for every
    descriptor.  A packet spanning descriptors of length l1, l2, and l3 is
    therefore counted as 3*l1 + 2*l2 + l3.
    
    Add each descriptor length once.  Single-descriptor accounting remains
    unchanged.
    
    MFC after:      1 week
---
 sys/dev/igc/igc_txrx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sys/dev/igc/igc_txrx.c b/sys/dev/igc/igc_txrx.c
index 7ab09078d8f4..526631528f51 100644
--- a/sys/dev/igc/igc_txrx.c
+++ b/sys/dev/igc/igc_txrx.c
@@ -486,7 +486,7 @@ igc_isc_rxd_pkt_get(void *arg, if_rxd_info_t ri)
 		    le32toh(rxd->wb.lower.lo_dword.data) & IGC_PKTTYPE_MASK;
 
 		ri->iri_len += len;
-		rxr->rx_bytes += ri->iri_len;
+		rxr->rx_bytes += len;
 
 		rxd->wb.upper.status_error = 0;
 		eop = ((staterr & IGC_RXD_STAT_EOP) == IGC_RXD_STAT_EOP);
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.