From nobody Sat Jul 25 21:36:49 2026 X-Original-To: dev-commits-src-main@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 4h6yqP5wpnz6m8r6 for ; Sat, 25 Jul 2026 21:36:49 +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 4h6yqP52P0z41l6 for ; Sat, 25 Jul 2026 21:36:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1785015409; 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=mJtmjEqLl7sU4jBnP12p9xYOEmHOln4qTBbTBE1aLJsG1S9pYwEkOEFBbsEu0DR037uuhx H34tqjq9TGZcyZmzlwtDaWnezsAnR/hN3rXS4Na7BodsFT6OBEUMPm7/eSLB+MBQfQ/Guv 8RNRURve1HNlWawl98uYR6kDWkOYAAdXL7BhwbJ5oGR0vUnZp2OMdNV3K9GzNsE0oJY03Q 3OBOTwNO1XkoP3v2VARhhV+6BQWzvOoKR57T6pVVismdDK6Rf95/ZFE0LiWrpgXb6uy3Jz 3lXLtuVu92vTicJzSRi1d0PhVwe0la7XHDPrv9QGA+IwDvFBTGY2A0jwqMXmQg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1785015409; a=rsa-sha256; cv=none; b=hkWL50DhP7kQQUiFa7TXSuGeHTf9+/Fk94uL9bdr69fqsYNWyHAKzJXKE6p9t50HRu9o1q afSepLgXJ1/Qt8lZcpAGR3FKuTb7GLQwoK/0nQE9nDputnPYHx/moJbqgD5IdkV2faTlG/ 9MyhM/Nvxm6jTVUiPnHroCIVFGYXQzgxqsftK8SUM14C5N44FyjLSVSawxNNkqTFJILtLe mC4LH3/Gr9v5+4buLooW8APFD8TAEQiPlR4qtJnVB1NU1P5f9yazcGjHYAnH/XfLh+4hhl eTX/G7anwNrymY5cm+5iR6GCwGpqjLG1aLtzweSYECK/Hang5VUeppp3AL00CA== 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=1785015409; 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=TfO7SfMH5NMrKi4RjPSyC6y7KU7jB+kahQS9F1G7lPONF/UxHvVCl5zLICNZEFJOHr6vZ1 /5xHfU/oC2WW4m1IlvkAE1OVDx2K2v+aQF9/kwKCd3O7laRGzqKdX2zUws1MnkSmnMTJna 6PmbNmrqK2bkotyPO8r5vTm3JDuOxYJ8fT2Pg9qGiVDRYMOfq1gdRFpDAQxTZl0CtUS5JP jDyk9C55+3NvPS5mjhPBtmtN/SjBSmHjpD0YJQ1HxHnhYi4Qatj+7YzdxDlBq068bJUnfc 5LDjgcukhvlnq9L+pZpjO26iEMaSXRqQMsWu4gHVmcy2SsWnAvztyvAR7aderQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4h6yqP3VxfzssZ for ; Sat, 25 Jul 2026 21:36:49 +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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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);