From nobody Sat Jul 25 21:36:49 2026 X-Original-To: dev-commits-src-all@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 4h6yqV5KqKz6m8ZK for ; Sat, 25 Jul 2026 21:36:54 +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 4h6yqV4phWz41d4 for ; Sat, 25 Jul 2026 21:36:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1785015414; 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=JRVevtCCcQyqOA9/ZTb5hjMbiOMvK+LopFzbTQKQdSU=; b=tB1kaMyScaVhH0M+hxeXzTD5k0dvaKXXAmBssw6f0k/nO0m9IitLE9OP0ZGVSiciD9YmAu lTiRMw4Op1UkQoZ3Nh6XJXFkrjjT9PE0QhJ1R2joeVkZkLSo8NLVPlWBu572vkSFdqYnaP Z024wBr7DtCZa8CLstzGWHUl70rkjI96sTzKasiYMnBCMb45SaXK/p+t9f58DcVCX2Me0+ FSK4fRQH6Ryyg1jIg8guktNCoeK2Vgf5PQy7OzJndzA3ELJ+qQWRhcC4Rc3Srq+l0/ha+w kCBqz+iNGRVy93EAR3IuhOQBjSpT6ERHMVwlTjgK8Gdb01NkaGWhsOHrP+LHFQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1785015414; a=rsa-sha256; cv=none; b=JYlTHe+NEmUKPmQ1Op1VsOS3ykXk2LlWJO0gp6Ud3O+dXnjgZ/3hBm8g1tqDrMWakls8aG pvWSCFxWAedH0NInMaJGPv+qJPdEhkO+7LXGyDSEYOG/mUMxU8wM6qmLMxWEJp4ae34OH3 JxWDakLK3vPzNY8cv20ZVrqYw4BRsmEloYHrHT4VRMjLSc2ePIB2T8e+siewL/H+hf+GFI 7mCYlmqgZYfGwNB0CRinsB0LuYkQNZk5wtkaUnirR7CTAV9jQMzJV2u9kCVsQwWgkxNY0c kKzX9BlIy4ZUj668SHI9Rcxjq7R19WQXIcrA8lRY12vu79zemCBwPkTWxkTA2w== 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=1785015414; 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=JRVevtCCcQyqOA9/ZTb5hjMbiOMvK+LopFzbTQKQdSU=; b=ecw7IM5+3I5uCEqIT1vm+XM7GOmIii7FvlmX3ZhWmjRwcD5FYABKO0zUniNnikkES1/5Fh DxTT2+y7lLIKbrwBH9A2g1ZOcMEFB+uOAAFFQaU6+TvliYGIQaZXGKwcKFfYNVkynlqhT4 MZecHkxuTPIuEvErMqKPnZvl8mvXity2AnuKKjHR0kOtdBoPkv/OAEgMItXAzn/8Kc4GeC w4/MVpjwHwFwKjJJsAgYb+qxygsBi6xqgCnrAOZukI5hE9BjET58+KTV5uT/8MeP4l8lPn jLVmj0crzF/t4Gse1XgYouCPPhncnCqaJr/E0IvuRZgboXC/71TLk/c2I2ChVA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4h6yqV3LRMztbS for ; Sat, 25 Jul 2026 21:36:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 43139 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sat, 25 Jul 2026 21:36:49 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: 41a46c2d46aa - main - e1000: fix rx accounting for multi-descriptor packets List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@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/main X-Git-Reftype: branch X-Git-Commit: 41a46c2d46aa4078c597ce3a0d19323cab988277 Auto-Submitted: auto-generated Date: Sat, 25 Jul 2026 21:36:49 +0000 Message-Id: <6a652c71.43139.60a2f8ab@gitrepo.freebsd.org> The branch main has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=41a46c2d46aa4078c597ce3a0d19323cab988277 commit 41a46c2d46aa4078c597ce3a0d19323cab988277 Author: Kevin Bowling AuthorDate: 2026-07-25 11:02:36 +0000 Commit: Kevin Bowling CommitDate: 2026-07-25 21:36:18 +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. MFC after: 1 week --- 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 b86222e363e9..f2b48d6518f7 100644 --- a/sys/dev/e1000/em_txrx.c +++ b/sys/dev/e1000/em_txrx.c @@ -679,7 +679,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; @@ -745,7 +745,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 e01bc72cdc55..fc690dcfc100 100644 --- a/sys/dev/e1000/igb_txrx.c +++ b/sys/dev/e1000/igb_txrx.c @@ -458,7 +458,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);