From nobody Sat Aug 1 00:24:45 2026 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4hBkGQ1xTmz6mPWQ for ; Sat, 01 Aug 2026 00:24:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4hBkGP6Qndz3wRP for ; Sat, 01 Aug 2026 00:24:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1785543885; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FGAClPReo97P02FpKOZ/gm+WSPioijc1J6EmY6TpHbM=; b=x07igxnOwbi1/p8tw6+Tl2kapFhMXJKbjNAcx9QCsWlkU/N/xIJeWQKC/wR/q68VB3d3nr HyMw1L5/p++pOeKb8PVsECQVR9a8HGI75huWJaTbTLojbrvpIUwh8YVxD3etM1LYOUvw2n SGXgZlhj+exWn6FxVDE2EJqo36k2v6mTK8g9qZXlIaattEeSx1hbZFKI1+XRC1grkwD5MN Gwpj56CE7W5eAwE+NH7xA3uE9VKKb1pCVSqczgTS2rrebfHztGgQ7iu1xy+x04yXSdJKIF 1Qt+45mDdDCzx2eihYsgyi2bJoXudBdiwgY/Qh9RYIdldTGNgcD4rd1mfTC/RA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1785543885; a=rsa-sha256; cv=none; b=YyH626koOi14usEBxwIvnisG1y4m0cszy3/glwqxksCFIhKroRZhk89O+GQLo6egJKZ9C6 WcA+vm8injAm+TPQM86vC7EFM7WRCj/TBAdJjEeO3mtLq0Q1zvvTYhEYvHOjOD7h1orgW0 Axw1Zrynf5nAph9HDPqLagVTj03yGwdNBIBbLyPOQGxBJs+JVSgkmlX4zPJ7jESTfYuBnu Ji1MWw1aDpw1i8mbCTQlFlPzfZVpokyfP78rs28aQdf1lANNes+cvNblOIqgDaFzYM0iPL VVmKmr6Ktsd1Nw95t2CjuGekCr7XESAw6cPex3ndJZp+ALl/YqhJ0SrF3GB3og== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1785543885; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FGAClPReo97P02FpKOZ/gm+WSPioijc1J6EmY6TpHbM=; b=j1ny+no8kzHIJHEYjsK/yaG9G/9TnO/RXmfSmVdNCk/KFJEl+j3mW1yV3NxqC6nsLbajc0 J4gH7PElMeJckmPaSoekVsdzEbrc+JhmeDelsSRHOzAfFBqX2qYMhflgCRdB6+gtoI9xGh fdrwhw+HFLk+OPIMKkvgaTClK7dQll0Jqdyd2RB713OsxjHgzVxeJU5OgMakcx6T9mjioA 7Pv/2xxVTRlHV+iEjVoHqp+/cDahPDBR8FhdTl23ZntlIwXdisEZGpvcRgOp3kvq/T7umy 5F2EP21AVhdTeBHZPCAUlF59LImhocV1krGxc8PoXYbZ660oqJgIf6oHNaQHvw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4hBkGP5WsSz72k for ; Sat, 01 Aug 2026 00:24:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 1868f by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sat, 01 Aug 2026 00:24:45 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: 03125b959758 - stable/15 - e1000: fix rx accounting for multi-descriptor packets List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 03125b959758a5bfed0e4f10aa36a33fed279097 Auto-Submitted: auto-generated Date: Sat, 01 Aug 2026 00:24:45 +0000 Message-Id: <6a6d3ccd.1868f.431357f5@gitrepo.freebsd.org> The branch stable/15 has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=03125b959758a5bfed0e4f10aa36a33fed279097 commit 03125b959758a5bfed0e4f10aa36a33fed279097 Author: Kevin Bowling AuthorDate: 2026-07-25 11:02:36 +0000 Commit: Kevin Bowling CommitDate: 2026-08-01 00:24:33 +0000 e1000: fix rx accounting for multi-descriptor packets The receive paths accumulate ri->iri_len across the descriptors making up a packet, then add that running total to rxr->rx_bytes on every iteration of the loop. A packet spanning descriptors of length l1, l2 and l3 thus contributes 3*l1 + 2*l2 + l3 instead of l1 + l2 + l3. Single descriptor packets, the common case, are accounted correctly, so this only shows up on jumbo frames. Add the per descriptor length instead. iflib memsets the if_rxd_info before each isc_rxd_pkt_get() call, so summing len gives the same total as the final iri_len, and the frame error path that returns without incrementing rx_packets keeps counting bytes exactly as before. (cherry picked from commit 41a46c2d46aa4078c597ce3a0d19323cab988277) --- sys/dev/e1000/em_txrx.c | 4 ++-- sys/dev/e1000/igb_txrx.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/dev/e1000/em_txrx.c b/sys/dev/e1000/em_txrx.c index ced8d0f41d14..cfeb43036563 100644 --- a/sys/dev/e1000/em_txrx.c +++ b/sys/dev/e1000/em_txrx.c @@ -681,7 +681,7 @@ lem_isc_rxd_pkt_get(void *arg, if_rxd_info_t ri) len = le16toh(rxd->length); ri->iri_len += len; - rxr->rx_bytes += ri->iri_len; + rxr->rx_bytes += len; eop = (status & E1000_RXD_STAT_EOP) != 0; @@ -747,7 +747,7 @@ em_isc_rxd_pkt_get(void *arg, if_rxd_info_t ri) len = le16toh(rxd->wb.upper.length); ri->iri_len += len; - rxr->rx_bytes += ri->iri_len; + rxr->rx_bytes += len; eop = (staterr & E1000_RXD_STAT_EOP) != 0; diff --git a/sys/dev/e1000/igb_txrx.c b/sys/dev/e1000/igb_txrx.c index 568d84807173..19b365bf020a 100644 --- a/sys/dev/e1000/igb_txrx.c +++ b/sys/dev/e1000/igb_txrx.c @@ -460,7 +460,7 @@ igb_isc_rxd_pkt_get(void *arg, if_rxd_info_t ri) le32toh(rxd->wb.lower.lo_dword.data) & IGB_PKTTYPE_MASK; ri->iri_len += len; - rxr->rx_bytes += ri->iri_len; + rxr->rx_bytes += len; rxd->wb.upper.status_error = 0; eop = ((staterr & E1000_RXD_STAT_EOP) == E1000_RXD_STAT_EOP);