From nobody Sun Aug 2 04:23:07 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 4hCRVz5ZPqz6n6CR for ; Sun, 02 Aug 2026 04:23:07 +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 4hCRVz4HjVz498l for ; Sun, 02 Aug 2026 04:23:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1785644587; 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=nCCDOgfghvhFYHlJhDU80QLAmvmQ0r/5o6gHMhlO5gw=; b=dN2KNSLOqELT5jvxHqRL2+e+G/M6X2kWQNx/biehSR//ETr1fN04l4GDFwMKZjUhus/Nt+ Szso10hF4FJ8hTN7w4Gt5GQbMsAMKKt2VCB+qCq86LOPBWzW4HN7UxsWiLty4Q73Fotnel x0pWTMwUggRdJqr7X7yrQPdIqCtuQIYh3SDYkbZ5TdiT7KI56cI5DT7o/bJMlKUDVnE20m /J34zacZEjuphxIglZml5Mze/HPM43udsQtqGkhtKuo2CsDHVw53wSOGsQVH2v6dh8uJJV 2rXtZE51xncLza12DXO5iXcR7dHtYmr4umWG1HR1aDyXUZdEC9uFYy4tf2l+xA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1785644587; a=rsa-sha256; cv=none; b=iV0LhzsHY4aM/jpFOrtpAaZv73RDIIMKC0wqOsVjRkbh1m81TbU3YYYgm+X1Ie6caglett 1xRLaS/rtAJLkjva+tFtaf4bsDe/I0Lyx6DdK58v8DomipKGHnpwYFr7FpjRrALI2+v5Ai qfyOXiqj1yuJ59fAtcudWhxEIIbdZUaaSvxbkzakZYqZ8koIHmCEsQY8RhNvkayWky4Z4g P+8/Owgahj4wgo62C9VggNYZNpAhNNv2TWXdGG4OfNp7r8z/ARgTE6ykjhIxul7ABsIm5t 6H6JGCtU40T2wjqIMvhkyZpDVAVdTkLBBtvBslhYvmaEExtO/pRe2DWz2o//mw== 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=1785644587; 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=nCCDOgfghvhFYHlJhDU80QLAmvmQ0r/5o6gHMhlO5gw=; b=urg9Tz2MKGm0foZbkgWipsvx2DgrHc25tdewEAsa2s4Hh7SfYc0MqONI82wdLVrNgdF4KG bljyviNvq1K5KH2o1rWykhROGDXBQzQho4vNSbzK3SIfro/9WdOL0RFRou2OI80mkXkEOY WdCIHfJ7TPl04kUluujMnGnc79mkpH/FeHYbZObXhJWLWXc203VFRLiw8l4Dg64TpZJSH4 7Mugld97IUvknzedlLnxjdrZg3dVoUaifQgrbdTtN4ozTl3OP8gXOXkqhhg1sYsyQRS/O7 nLLgLzsPkkxo+NQNHszVGAjJKSFbqELdETJ+iMedv/rm8UZFR/PNSJvHkPNfzA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4hCRVz34PMz1D6b for ; Sun, 02 Aug 2026 04:23:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3c504 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sun, 02 Aug 2026 04:23:07 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: adaa4c666cee - stable/15 - 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/stable/15 X-Git-Reftype: branch X-Git-Commit: adaa4c666ceedbed855e013700cc6cc9bf4c3749 Auto-Submitted: auto-generated Date: Sun, 02 Aug 2026 04:23:07 +0000 Message-Id: <6a6ec62b.3c504.7f353e46@gitrepo.freebsd.org> The branch stable/15 has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=adaa4c666ceedbed855e013700cc6cc9bf4c3749 commit adaa4c666ceedbed855e013700cc6cc9bf4c3749 Author: Kevin Bowling AuthorDate: 2026-07-26 00:01:06 +0000 Commit: Kevin Bowling CommitDate: 2026-08-02 04:22:08 +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. (cherry picked from commit e389a05164ccb1dd41ee8d7f09203b475322dd72) --- 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 905b859e843f..4f6e57083894 100644 --- a/sys/dev/igc/igc_txrx.c +++ b/sys/dev/igc/igc_txrx.c @@ -319,10 +319,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); }