From nobody Sat Aug 22 00:57:43 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 4hRf0m1vmKz6ps8Z for ; Sat, 22 Aug 2026 00:57:44 +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 4hRf0l6fydz3Q2B for ; Sat, 22 Aug 2026 00:57:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1787360263; 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=0oU1CTV/JhggNhe16GHhoZRTBBVQ86fLYemMG/dTU3Y=; b=WlPcle7RFx+1WkLvdhIPZ0nGAYj8qlTFYRknQJOJDcOBqJTYFlruoejjxXV5wm64ooKsyS RytGKSMpiKLbQoBw0KjrAGtO7vHLr/E7dUqZi5ITOTg0oVWZ/H/gvJw2B0HF43boZhpwfj uKOqIP+YQe3wLV0bmZJLYp1SfsZvA/os96KKYlkNhJxCO+4VqxNnH+w3oB67Tk0z1eMLcF w3XZVBc9yeJdkMGkBPzEmpKC7G4obqQZvWy2Md3Rl98TunmR9RM5avTQXyhYr/FEH3y4SM dtfqtIq77uXs5kaXxD+mWnN7MG3jv76Crf/1ASpl4kXLmSOnoVzSMfqo5LH0Tg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1787360263; a=rsa-sha256; cv=none; b=TDlUx4n8UZPPPAhENJ6gzmye4u1/Jn6mKxuv1b4H+UFH3GQPPcz5HRVCNV2I+jHODK6Qg/ MBv0A3S6QiC/K15IKJXXDzeH73eT6W+0d/jqp97ZyvwFEvdtbK6nDsGEXksAvmicW6apWI 085dK9Ug4Oe3EGA0/9JKzeSgbPYK06iSGBuXkqizKXt4wE1UfdPMk8TRD4rhi12/TxHNlb XzxAG/5evHowlVy4bIhjaJAocwqt5lLew3vCOSYQsqnLMyCoQTmfjvXz0xBf8V4T6qOoyO lWNR8oM8kksT1rUlH9Ioz7/1OUiPvQ34qdHoRwyeQZ97YYplfXbrACgaq/RcGQ== 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=1787360263; 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=0oU1CTV/JhggNhe16GHhoZRTBBVQ86fLYemMG/dTU3Y=; b=RtqpYxt4VhMDr4umyQ3ddevSZsC9Qz6VceyTSkDEANuKsAPtCw3z2J4gFOirL3lfEkBH6N m78A9esoTf3WHOyLqGoCXZU7IiQA9sVrJF2TK6RfhbYmmIQlAiZkPr07/8JZ40iex9AQFx fzevjDK51rgGTnHQGqpYGlrM4yXR+HY15F8Vpfq3BmtM/ozvp28YFnvMLGZHGpHLB7dIwY gZJEskUn365S86KPoSfN/a+9FuTKPfV5eJ0Svfth4z8IVz1f3wIiS8eHzwWIyOaVfe5pk1 WTlpnOaQvpTX3hMf87z56m/ODbfjZywpt4JvQsz9xGOY5z7+Uq4i2NvAX0DN3g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4hRf0l5fMzzBZV for ; Sat, 22 Aug 2026 00:57:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 27205 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sat, 22 Aug 2026 00:57:43 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: c116b6fbf0bc - stable/14 - igc: Correct descriptor control programming 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: c116b6fbf0bc276b9b8ca654dd06ae467a4fac2f Auto-Submitted: auto-generated Date: Sat, 22 Aug 2026 00:57:43 +0000 Message-Id: <6a88f407.27205.204a6c6f@gitrepo.freebsd.org> The branch stable/14 has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=c116b6fbf0bc276b9b8ca654dd06ae467a4fac2f commit c116b6fbf0bc276b9b8ca654dd06ae467a4fac2f Author: Kevin Bowling AuthorDate: 2026-08-08 11:30:40 +0000 Commit: Kevin Bowling CommitDate: 2026-08-22 00:57:34 +0000 igc: Correct descriptor control programming The transmit-ring setup was copied from the e1000 path. On I225 and I226, bits 22 through 24 are reserved and bit 25 enables the queue; it is not a legacy low-water threshold. Correct the field masks, remove the nonapplicable legacy definitions, and program only defined fields. Use PTHRESH=8 and HTHRESH=1. Keep WTHRESH at zero so the hardware honors sparse RS descriptors issued by iflib. Linux and DPDK use a writeback threshold of 16, but request status on every packet. A nonzero threshold makes hardware ignore individual RS bits and is unsuitable for the iflib completion model. The receive-ring setup likewise used a magic mask that left bit 20 of the five-bit WTHRESH field untouched. Define the receive threshold fields and replace them exactly before installing the established PTHRESH=8, HTHRESH=8, WTHRESH=4 policy. (cherry picked from commit e2aff50727cbe4cb5e99f825c2c6bd8a4915de67) --- sys/dev/igc/if_igc.c | 19 +++++++------------ sys/dev/igc/igc_defines.h | 16 ++++++++-------- 2 files changed, 15 insertions(+), 20 deletions(-) diff --git a/sys/dev/igc/if_igc.c b/sys/dev/igc/if_igc.c index d9e2128d33eb..b31d3fcba896 100644 --- a/sys/dev/igc/if_igc.c +++ b/sys/dev/igc/if_igc.c @@ -2278,13 +2278,9 @@ igc_initialize_transmit_unit(if_ctx_t ctx) IGC_READ_REG(&sc->hw, IGC_TDBAL(i)), IGC_READ_REG(&sc->hw, IGC_TDLEN(i))); - txdctl = 0; /* clear txdctl */ - txdctl |= 0x1f; /* PTHRESH */ - txdctl |= 1 << 8; /* HTHRESH */ - txdctl |= 1 << 16;/* WTHRESH */ - txdctl |= 1 << 22; /* Reserved bit 22 must always be 1 */ - txdctl |= IGC_TXDCTL_GRAN; - txdctl |= 1 << 25; /* LWTHRESH */ + /* WTHRESH must be zero when iflib uses sparse RS. */ + txdctl = IGC_TX_PTHRESH | (IGC_TX_HTHRESH << 8) | + IGC_TXDCTL_QUEUE_ENABLE; IGC_WRITE_REG(hw, IGC_TXDCTL(i), txdctl); } @@ -2412,11 +2408,10 @@ igc_initialize_receive_unit(if_ctx_t ctx) IGC_WRITE_REG(hw, IGC_RDT(i), 0); /* Enable this Queue */ rxdctl = IGC_READ_REG(hw, IGC_RXDCTL(i)); - rxdctl |= IGC_RXDCTL_QUEUE_ENABLE; - rxdctl &= 0xFFF00000; - rxdctl |= IGC_RX_PTHRESH; - rxdctl |= IGC_RX_HTHRESH << 8; - rxdctl |= IGC_RX_WTHRESH << 16; + rxdctl &= ~(IGC_RXDCTL_PTHRESH | IGC_RXDCTL_HTHRESH | + IGC_RXDCTL_WTHRESH); + rxdctl |= IGC_RX_PTHRESH | (IGC_RX_HTHRESH << 8) | + (IGC_RX_WTHRESH << 16) | IGC_RXDCTL_QUEUE_ENABLE; IGC_WRITE_REG(hw, IGC_RXDCTL(i), rxdctl); } diff --git a/sys/dev/igc/igc_defines.h b/sys/dev/igc/igc_defines.h index 3e6309176204..9fc1c72022c3 100644 --- a/sys/dev/igc/igc_defines.h +++ b/sys/dev/igc/igc_defines.h @@ -551,15 +551,15 @@ /* IGC_EITR_CNT_IGNR is only for 82576 and newer */ #define IGC_EITR_CNT_IGNR 0x80000000 /* Don't reset counters on write */ +/* Receive Descriptor Control */ +#define IGC_RXDCTL_PTHRESH 0x0000001F /* RXDCTL Prefetch Threshold */ +#define IGC_RXDCTL_HTHRESH 0x00001F00 /* RXDCTL Host Threshold */ +#define IGC_RXDCTL_WTHRESH 0x001F0000 /* RXDCTL Writeback Threshold */ + /* Transmit Descriptor Control */ -#define IGC_TXDCTL_PTHRESH 0x0000003F /* TXDCTL Prefetch Threshold */ -#define IGC_TXDCTL_HTHRESH 0x00003F00 /* TXDCTL Host Threshold */ -#define IGC_TXDCTL_WTHRESH 0x003F0000 /* TXDCTL Writeback Threshold */ -#define IGC_TXDCTL_GRAN 0x01000000 /* TXDCTL Granularity */ -#define IGC_TXDCTL_FULL_TX_DESC_WB 0x01010000 /* GRAN=1, WTHRESH=1 */ -#define IGC_TXDCTL_MAX_TX_DESC_PREFETCH 0x0100001F /* GRAN=1, PTHRESH=31 */ -/* Enable the counting of descriptors still to be processed. */ -#define IGC_TXDCTL_COUNT_DESC 0x00400000 +#define IGC_TXDCTL_PTHRESH 0x0000001F /* TXDCTL Prefetch Threshold */ +#define IGC_TXDCTL_HTHRESH 0x00001F00 /* TXDCTL Host Threshold */ +#define IGC_TXDCTL_WTHRESH 0x001F0000 /* TXDCTL Writeback Threshold */ /* Flow Control Constants */ #define FLOW_CONTROL_ADDRESS_LOW 0x00C28001