From nobody Sun Jul 26 01:01:18 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 4h73MM6bp9z6mQg2 for ; Sun, 26 Jul 2026 01:01:19 +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 4h73ML69kJz3M2d for ; Sun, 26 Jul 2026 01:01:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1785027678; 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=Dar3zIMLs6ibY5tjz5Ca+aKAM4zWZFqGd2SSjHQeOwA=; b=uuzw4ORPF8t3CJGab03bSHZuprzyQAmwi9cBmdCxsZ+Xb8tW40mtW8z6heABMFE240zG78 ExfCBd0v0IEDjaKyEhV7Zt+GlVLcQMGQJUjbOhbUlXTCDeHvIJc7Sp9vdR1PansyDgcmez yqkl8sFEyFruYtSSykqf9ulSiTMHkRBzeCHZMaFxL5ObrX4URIqONWQm93Uu1wCldHE4Rv V3LGtBobaQNgnKk4ZRbZifI7WKZnJXtO37K2twQxY6qU2I1NChVFLlo7u7tKIp6rVDvSIR x0O2VP5Z20qjSRiQ+JPVnPrhrypfPKIRb8S81m23lo1ks2GQKXyRjSpXzD75Ng== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1785027678; a=rsa-sha256; cv=none; b=x29tOntPsWb4MDal3ETiKI2sq5h68sm2bMW3AvQLNTbVk5kruqtRIzayp2AGsRg/RzfcmY De36Zn2NerR493T1Cnuluf4wbVTrNwacjDc5tCKyKNyv1wDV89lBEMEOwrFCIxc4KmHOLs frrjUjHG5BRGiGXcx4RT9J0U2GbRIYqkCV6wByzHe2IUN6fTTsNtaJ7e5cPb48+i+nne+0 yiL0fpdXRUDvXK4aiyhMgjxw78JIFR72ukWtGMl4E2y9U6dWHK+At3vP1P23IuzOQWajU2 5vLr9VIXiTr8dYADr/19Un0BupcFISasJikCB16zgzXHyMCQjYRkPKNIf4Beiw== 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=1785027678; 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=Dar3zIMLs6ibY5tjz5Ca+aKAM4zWZFqGd2SSjHQeOwA=; b=nn3UJS5tUPFGd0fOy82Pq7YPqEqfVPBcaOauKM7qwPkApHeNJGFGcLxK0yTjafrS/492zR o/OshQWqiGV4jw7a4HNLUPtG2TqH+wFBiBmhvmd6z6Q9KGo8Sc8GEfbQr3P9yAK03oATYg XSD9Fgm1Y7//DUNBJtitY8hhXx5ZABukCNQQuwKmDXzfWasKApvkgjSHTjI+f2HPeChBc2 QOl0fdLueWBTNPMxjeaFNUygGduBjv18ZWBhrOSYUEfcmKPQAVw0rfjh24wLfHJbcGh634 dQ3ThD/Qdr5KiU+rHdEmv1HpYpjCwWvI6kkeBI8on+lJn6o1x22GcVR2w+/2+Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4h73ML3MRZz10Lw for ; Sun, 26 Jul 2026 01:01:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 32f9b by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sun, 26 Jul 2026 01:01:18 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: e389a05164cc - main - igc: count TSO wire segments in the AIM counters 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: e389a05164ccb1dd41ee8d7f09203b475322dd72 Auto-Submitted: auto-generated Date: Sun, 26 Jul 2026 01:01:18 +0000 Message-Id: <6a655c5e.32f9b.6b98a342@gitrepo.freebsd.org> The branch main has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=e389a05164ccb1dd41ee8d7f09203b475322dd72 commit e389a05164ccb1dd41ee8d7f09203b475322dd72 Author: Kevin Bowling AuthorDate: 2026-07-26 00:01:06 +0000 Commit: Kevin Bowling CommitDate: 2026-07-26 01:00:02 +0000 igc: count TSO wire segments in the AIM counters The transmit path bills one packet of ipi_len bytes per request. For TSO that is the whole unsegmented payload, up to 64 KiB, rather than a packet size that appears on the wire. Count the segments the hardware emits and the header carried by each segment. Non-TSO accounting is unchanged. MFC after: 1 week --- sys/dev/igc/igc_txrx.c | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/sys/dev/igc/igc_txrx.c b/sys/dev/igc/igc_txrx.c index 12b6f2c43c39..0f88a0a5acd5 100644 --- a/sys/dev/igc/igc_txrx.c +++ b/sys/dev/igc/igc_txrx.c @@ -317,10 +317,27 @@ igc_isc_txd_encap(void *arg, if_pkt_info_t pi) txd->read.cmd_type_len |= htole32(IGC_ADVTXD_DCMD_EOP | txd_flags); pi->ipi_new_pidx = i; - /* Sent data accounting for AIM */ + /* + * Sent data accounting for AIM. For TSO, ipi_len is the whole + * unsegmented payload, which is not a size the moderation calculation + * can use. Count the segments the hardware will put on the wire and + * the header each of them carries, so that the average it sees is a + * wire packet. + */ + if ((pi->ipi_csum_flags & CSUM_TSO) && pi->ipi_tso_segsz != 0) { + u32 hdrlen, segs; + + hdrlen = pi->ipi_ehdrlen + pi->ipi_ip_hlen + pi->ipi_tcp_hlen; + if (pi->ipi_len > hdrlen) { + segs = howmany(pi->ipi_len - hdrlen, pi->ipi_tso_segsz); + txr->tx_bytes += pi->ipi_len + (segs - 1) * hdrlen; + txr->tx_packets += segs; + return (0); + } + } + txr->tx_bytes += pi->ipi_len; ++txr->tx_packets; - return (0); }