From nobody Sat Aug 22 00:37:58 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 4hRdYz6DwJz6pqYY for ; Sat, 22 Aug 2026 00:37:59 +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 4hRdYz3KSZz3HTQ for ; Sat, 22 Aug 2026 00:37:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1787359079; 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=1icebJroxORuK393tevQWVZjuTYt1rvdY7y/2HVVoek=; b=JO/pl9FXCknM48dca2bv5lMdoZsW8gUByi6KK9cdmTydMvAZ1ukl6eAwoAk5OoQN3bOgXd GPpqb5aVSSR9osTwoaHIhrQAqX/lG/yG8SXr/44E5IHFuHebER4zuEWc8sC9Ylr4Q9+TT/ jNnwYCtiHZ4srpil/qgxr4Bkzad617wXWejMfrTdnxi+qymzSoZAU0kKW8NqGK5XvSt4KH s3Wg4V9TGZPX7dBnsmiUHg53w4fVilTXvTbhQYRCbZwNfKg7139nDrHQGOU7Y+cexTZYQy YDLuMpxjwe1FDEJKrDC3RySyNrFKwc3fhSRMJIjSMrY5m8syl2dB5LoejwBKvQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1787359079; a=rsa-sha256; cv=none; b=yadY7c4KkrcqDCs7vTRTjdXKBb0Mqoah6mJFJFZmDUD5a4xWKHgJMCbCvefulKKFyrv5VP w5xyUYnOpD1KAAt9Du8gqrkuHugniDPpnIy0s4TajHtETZn0q9F85IhdgZ/3oIeTsX5m4H P0YMIFd+E/fhZPEBOoAh6EqucGvIiRA1GjPe1nnVfBZwXbX2SR+2G4ePNgj+hH/FkyncQ9 FBCGxyWh1xvetnyv9wGzgQEiUXnA8DmhVjgZe5P0juR+1wTuzOhAoAORDqFhGsO8KGkWxv MlaOmBQfQF4Z84CKybbTqmi1QA38jIlTKtZHh+mi2N+Q5OTnMoXQY85GUwJUPQ== 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=1787359079; 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=1icebJroxORuK393tevQWVZjuTYt1rvdY7y/2HVVoek=; b=ThcNT91yL40JlzbZoRm/qsdD86a+vWgv1AMRjGzr2FVJyqq2FvfRWjjdONNl4NqUJRINWm muFKQzBWoK4alkl2d++AwXfPCHA+lgHmL2nX6ooqaD1ynpjLjUXi4WSJIw/v2oxQXrlQB5 KuKV/Vjp4tkmoY2BdCR6xZWTcxjHYb6XSHL00MwGZAvaRGx38xnmeILMyh7K6i7FcbjLA4 j46IS8OEEqI3xIIAOW3hOmBh1Oj1Yg4OZGkBmaHO0S18uivSlUcjYP31/5ubdjTZ7Z9Dcf 5PhyJYLPEnMAbHP9Bkbe1gmcaX5hgP45AV2hP/XlmeZBI8mM5yGfZHu7onBufQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4hRdYy6ZrCzBLh for ; Sat, 22 Aug 2026 00:37:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 24f97 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sat, 22 Aug 2026 00:37:58 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: 2b696953e130 - stable/15 - 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/15 X-Git-Reftype: branch X-Git-Commit: 2b696953e130f7ccce42d45f92a4e3ee3a6729a1 Auto-Submitted: auto-generated Date: Sat, 22 Aug 2026 00:37:58 +0000 Message-Id: <6a88ef66.24f97.212939ba@gitrepo.freebsd.org> The branch stable/15 has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=2b696953e130f7ccce42d45f92a4e3ee3a6729a1 commit 2b696953e130f7ccce42d45f92a4e3ee3a6729a1 Author: Kevin Bowling AuthorDate: 2026-08-08 11:30:40 +0000 Commit: Kevin Bowling CommitDate: 2026-08-22 00:34:47 +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