From nobody Sun Aug 2 04:27:42 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 4hCRcH0LJQz6n6QV for ; Sun, 02 Aug 2026 04:27:43 +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 4hCRcG2YMSz4Fc2 for ; Sun, 02 Aug 2026 04:27:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1785644862; 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=A9OrVSqS5miCLao8GaZAqW4GabgOZhVSfm0h5ZuUTLE=; b=iwsXseoegcKkJ/elGnyH6iO54W30wJzfj0tjo8H1hch95Rc/2Uq5/TZwBQcITcltW8beXe uaHET/b4YZ5sVhBh7btydVpmU3Ub7ANzfQI+Xh3zePEsJ4jyz1QlRjItRMw3HXENM88/2R hmvmp+3RGui8Db4cU0oaSgMBNmi2TDPzafWFNBaCiFZrHvk98r5CeQ3DVtezopZgfKecCY aJbSDHQo7s7tgqOH6o3pA/8oYMNrv6JuiKnNaPBAY5LCQ2vB64wSJ9a4thfbmHegr2/AMw 7OwvoS180xxdRE5kVk+79ZFsoYjMvpg/7K0vUJxCT309oMSLDYmr0xDTeAHa7A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1785644862; a=rsa-sha256; cv=none; b=iioSJY/a4wy1QST8ITqlzeszo677IEnvOGLS5au1+Ge/rsiZbRxnKUNzACOKVsSbcXXvkW Kw9KGpxnUc0r8ylMXKLyoWC+r355ZnKhEKNcJd5jVPdA0Y+zGuLcZ2rM3wx5cNbriEaKo5 QxQmOJZumSJXBxg2Few6WnjWMiAbRPO/1kah7gmTyCHDA7JsFBK55xdiTDg6nbHenr9//A fwDpLCZa5xMlX4dEGVysoe4yeudsHUEOoOOby4WnasLQTY+RqEQRMFUKh3wB3ZdjjZEb2K 42a3ZNpptn0UO98ZXu9M3OWjFPV3WI98YY1Kp4aPF1h8bkOKR29Cvg/eJoPTBw== 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=1785644862; 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=A9OrVSqS5miCLao8GaZAqW4GabgOZhVSfm0h5ZuUTLE=; b=P4E9XBd89fAPA0Z5ujtHJVT0ZiQ2+43DDfmpGAMaswfIp6UTl931uIxmH3m88kfS092zmW LYeWw7/PmVPEcvcNlMPbPTw0yWbxgNkjx0YgmPH5thXAqs0xZOyucIuzDfDBLi5B0AcEvm ZnEs0I4LGXRXF+mRlgNWwTTamUUZl0/5Z9b3O+Maunb1eX3JNQJ4BtPhk/RVRQ+xNxN9oI czZnn5v8tK1sS0tR4epxw1wTuyo8fzIEpjbmytIhb0xVdDoAv4YxWa517kbYMZm2nh+ACp 8KVTM/0c/l0HZGGx8Zuci47TsEbisQ/dzRnPvBnDIWkT6MjLQlaq8bb2BDAHNA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4hCRcG1GBbz1DL0 for ; Sun, 02 Aug 2026 04:27:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3c9d2 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sun, 02 Aug 2026 04:27:42 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: c303e5a0ac9d - stable/14 - igc: count TSO wire segments in the AIM counters 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/14 X-Git-Reftype: branch X-Git-Commit: c303e5a0ac9dafb1bf4cb5c27eda7879d221b381 Auto-Submitted: auto-generated Date: Sun, 02 Aug 2026 04:27:42 +0000 Message-Id: <6a6ec73e.3c9d2.39a3b79@gitrepo.freebsd.org> The branch stable/14 has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=c303e5a0ac9dafb1bf4cb5c27eda7879d221b381 commit c303e5a0ac9dafb1bf4cb5c27eda7879d221b381 Author: Kevin Bowling AuthorDate: 2026-07-26 00:01:06 +0000 Commit: Kevin Bowling CommitDate: 2026-08-02 04:27:09 +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); }