From nobody Sat Aug 22 00:38:00 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 4hRdZ06CNqz6pqgC for ; Sat, 22 Aug 2026 00:38:00 +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 4hRdZ01gwhz3HQc for ; Sat, 22 Aug 2026 00:38:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1787359080; 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=/Y96clOsEP0+Y5XuyZ34k17WACN7/D08+9qbdV25XWw=; b=vGWl8ROstbYcITjcwaR8TUC/LQ80iP69HiVUxmjydpymbeT2nL62xPjV+E0b9O1l3c37Eb spcWUpz+NhsA67XFKYPio065w1CtgI6y0+Fe0+vuxhd9ms/JFU4ekxL61M2+PWGmv7Ii+1 FeylffrEGtGXNYaYtvZLNhgeGYWGlGdmV7EKROQbQdj+LTTAzXLMnkya59575Pfqmcm8ue fcEaFdGH7NlvZOIF5gnVfbWrgGF8lvc7ci/DgJaQwwfx3dJD7NBpqu2OuZ9DtjX40bukLI O8kxU8zrZa1gJUjMdoXCDcgGbPj8RYgeKixbJF54LL6LBTz2nudlhLRplODmPQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1787359080; a=rsa-sha256; cv=none; b=sZNoQwM63b+fZKAjzkE8CFjqkcCO5YQp9WKCX9k0KgYm0Y2rblgCd+60sk40TSjLd1ulfY t5K+sJZ0JuYM0j/CDho0nvMunbAHPKIXwM1GSeiTNYc3byNEctAJQNEteXn8wxI4R06Vr5 0RRAaG/tZlIVM3IZXl2o4l7eLq6V2NtMjRFEMYXFGxoM4hb6auhHLXi1a7NLKojSavm8vG 0YGO0Qjuq5qOGbWldlH1O2UPxYKmMcAsEVtUmq8Hrft4cmFGTp8vSs8dg87Kf0yUzeVJQo tRJQVO+OMpat2VfBSU/n3ef8esul++JUParMjVkxJ9WbPypaJ+JYBit50jVHZQ== 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=1787359080; 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=/Y96clOsEP0+Y5XuyZ34k17WACN7/D08+9qbdV25XWw=; b=ChQwz0UBhCbQA6xNqQYRI0CaIevXGm8GV+J/MR+amTJspNcRNo1olBB3GapAm3RYUPtIio PFUsUnEKLDdSVLNsx4UEFcYqmAVnk+ovWGyWua0cmV3KZWg16hR7WjdQEfritwHy8wIbx/ SVVL7hJ4vg+Kr9kNwzNLLwp4YTMwGvOoOwl7O6yGlOitE9zuAJgYV+gzC6b4lqafjRLEGx udXDThMll6I5RbO2MX361je+MoX+QsPouJU+ohHBI6Sx7gk0Wu5S1iip5jqG0WvRAmOpls CxJpfB9ryp5/o0RsG4bsjrmfQ0pfPFAd86jy87AQnjbZxCNYxyDN5vjVCgjYPQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4hRdZ00Jc0zBLk for ; Sat, 22 Aug 2026 00:38:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 2551e by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sat, 22 Aug 2026 00:38:00 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: 889b421a0986 - stable/15 - 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/15 X-Git-Reftype: branch X-Git-Commit: 889b421a098649ffce2badae0e7b49fbe1467209 Auto-Submitted: auto-generated Date: Sat, 22 Aug 2026 00:38:00 +0000 Message-Id: <6a88ef68.2551e.7f4c9764@gitrepo.freebsd.org> The branch stable/15 has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=889b421a098649ffce2badae0e7b49fbe1467209 commit 889b421a098649ffce2badae0e7b49fbe1467209 Author: Kevin Bowling AuthorDate: 2026-08-08 11:10:18 +0000 Commit: Kevin Bowling CommitDate: 2026-08-22 00:37:28 +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