From nobody Sat Aug 22 00:58:11 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 4hRf1J2LKGz6prry for ; Sat, 22 Aug 2026 00:58:12 +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 "YR2" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4hRf1J0zHjz3QKP for ; Sat, 22 Aug 2026 00:58:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1787360292; 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=cU0DdiDfSZdYqLvd2IPPNUrKavLyHJaIgzmRUYzJOFU=; b=tnefCHvZMEtKD968NM2DDxWeztftVoRsvbRE1KYOG2zi6pRSgg1dS9dIQrZ8sGDrPufGmM Hdj+M96Wj888HBHM1uG+Dxutj1EHnc1HHTD3xjFTFc3P1x4IN8HGPTdoayYb3Aj/lJJ8b0 7cZAf8+xsl4fNlTKDRkRI4NI+p9WOllBvoAeA6LlBHvt5DHS+sHPVrcVPrE6FCSpLM1kI4 DOd3OvNSBSXktRuqGEd2C2/4jb4FgGpR+cfRJDuzBITcxdnvZ6s9vtkhIMazph4lEjvm7s hHpXYLcNShrXhkZFJ4EeB2w7tLexSe2LPHfdQNr5agPHdCGSpxscMonqhi+p8w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1787360292; a=rsa-sha256; cv=none; b=BzasOXDonTPV269S6CAA+4A99orWyhc6IVE21eWXk+3pNC/XTv8M7BRubl/7U848DNMRpb 7SupR6W4ij24UzdKK7ZbFg8iedOgo+82T5p7XCG5/dD5QEHpBQZOXTd8baHtJJQiFs/wsn 1eI/Tb65cKSfv1OL0rkxtTcEKr+skXecgsoLgrn9wN2dGXoNNzGgcaGkmbQCBAg+kzlBUL BPWCi0K4AbAn2kQqQHjHo3/uAyZNdp3LmfYNwGg9ICEUFOX4PMYQvNQdgT6a2ADqaiF1ew wv0pokR/zhvaAc+uRp5SQrY2WNoKM+MhU69B/xKQ24pKbTlAJ1LWRpVLo2XLTQ== 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=1787360292; 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=cU0DdiDfSZdYqLvd2IPPNUrKavLyHJaIgzmRUYzJOFU=; b=eZ70XLHj5WeHmyWAcu7fvxhCi0RgtroTtgUX9ORaDbBA0283HXfcdSMRTB7+7XfqwGzzWA 1rZpaQ5cvlKEYd0WbCxPhErLAM0VsgsHqn1i9kypDnMTa7lpM+gSSipnJHpi8sQSf0pUbr PStWfd3YXrF1Ldws+nFHjawNBRgy5yNzYe4S0KLVI2ddlNU8KOYa2HEmo/Qtnq3OdSCm4+ FIHxRIPWpQCLVjah3mWM+m/wi/GdrqICeYD9Rzp1dvOl89erTYk1hbk/t6/7psXja3XU5b LNmueqc8dChcpDB77Rm0nYHK8CuQEpqHvg9/GeQG2ag/FbU7RI6V3+NcAIuoqQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4hRf1H6mPBzBxg for ; Sat, 22 Aug 2026 00:58:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 25e74 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sat, 22 Aug 2026 00:58:11 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: 331274591146 - stable/14 - ix/ixv: Match Tx writeback thresholds to iflib 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: 33127459114663c6a95a3e45c0416d54ea5c650e Auto-Submitted: auto-generated Date: Sat, 22 Aug 2026 00:58:11 +0000 Message-Id: <6a88f423.25e74.642b572e@gitrepo.freebsd.org> The branch stable/14 has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=33127459114663c6a95a3e45c0416d54ea5c650e commit 33127459114663c6a95a3e45c0416d54ea5c650e Author: Kevin Bowling AuthorDate: 2026-08-08 11:10:18 +0000 Commit: Kevin Bowling CommitDate: 2026-08-22 00:57:51 +0000 ix/ixv: Match Tx writeback thresholds to iflib PTHRESH controls when the device prefetches transmit descriptors, HTHRESH controls how many host descriptors must be ready, and WTHRESH controls completion writeback batching. iflib places RS on selected descriptors and reclaims through those checkpoints. The data sheets require WTHRESH to be zero when software uses RS. Clear WTHRESH while retaining the established PTHRESH 32 and HTHRESH 1 fetch policy. This also follows DPDK in pairing sparse RS descriptors with WTHRESH zero. DPDK defaults to 32/0/0, while Linux ixgbevf uses 32/1/8. The 32/1/0 setting preserves FreeBSD's prefetch policy and the data-sheet requirement that HTHRESH be nonzero when PTHRESH is used. (cherry picked from commit 0baf0fabdb5e60e917458f85706707ee92683080) --- sys/dev/ixgbe/if_ix.c | 10 ++++------ sys/dev/ixgbe/if_ixv.c | 4 ++-- sys/dev/ixgbe/ixgbe.h | 8 ++++++++ 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/sys/dev/ixgbe/if_ix.c b/sys/dev/ixgbe/if_ix.c index 4baaa040cbce..3aaee0905dad 100644 --- a/sys/dev/ixgbe/if_ix.c +++ b/sys/dev/ixgbe/if_ix.c @@ -4000,17 +4000,15 @@ ixgbe_if_init(if_ctx_t ctx) struct tx_ring *txr = &tx_que->txr; txdctl = IXGBE_READ_REG(hw, IXGBE_TXDCTL(txr->me)); - txdctl |= IXGBE_TXDCTL_ENABLE; - /* Set WTHRESH to 8, burst writeback */ - txdctl |= (8 << 16); + txdctl &= ~IXGBE_TXDCTL_THRESH_MASK; + txdctl |= IXGBE_TXDCTL_ENABLE | IXGBE_TXDCTL_THRESH_DEFAULT; /* * When the internal queue falls below PTHRESH (32), * start prefetching as long as there are at least - * HTHRESH (1) buffers ready. The values are taken - * from the Intel linux driver 3.8.21. + * HTHRESH (1) buffers ready. Leave WTHRESH at zero + * so that writeback follows iflib's sparse RS bits. * Prefetching enables tx line rate even with 1 queue. */ - txdctl |= (32 << 0) | (1 << 8); IXGBE_WRITE_REG(hw, IXGBE_TXDCTL(txr->me), txdctl); } diff --git a/sys/dev/ixgbe/if_ixv.c b/sys/dev/ixgbe/if_ixv.c index 556da3ffbb5a..14b63dbf1570 100644 --- a/sys/dev/ixgbe/if_ixv.c +++ b/sys/dev/ixgbe/if_ixv.c @@ -1349,9 +1349,9 @@ ixv_initialize_transmit_units(if_ctx_t ctx) u32 txctrl, txdctl; int j = txr->me; - /* Set WTHRESH to 8, burst writeback */ txdctl = IXGBE_READ_REG(hw, IXGBE_VFTXDCTL(j)); - txdctl |= (8 << 16); + txdctl &= ~IXGBE_TXDCTL_THRESH_MASK; + txdctl |= IXGBE_TXDCTL_THRESH_DEFAULT; IXGBE_WRITE_REG(hw, IXGBE_VFTXDCTL(j), txdctl); /* Set the HW Tx Head and Tail indices */ diff --git a/sys/dev/ixgbe/ixgbe.h b/sys/dev/ixgbe/ixgbe.h index 90ce3e470686..2c53f417724f 100644 --- a/sys/dev/ixgbe/ixgbe.h +++ b/sys/dev/ixgbe/ixgbe.h @@ -121,6 +121,14 @@ /* Alignment for rings */ #define DBA_ALIGN 128 +/* + * iflib uses the RS bit to select the descriptors whose status it polls. + * Keep WTHRESH zero so the hardware honors RS, and retain the driver's + * established descriptor-prefetch settings. + */ +#define IXGBE_TXDCTL_THRESH_MASK 0x007f7f7f +#define IXGBE_TXDCTL_THRESH_DEFAULT ((32 << 0) | (1 << 8)) + /* * This is the max watchdog interval, ie. the time that can * pass between any two TX clean operations, such only happening