From nobody Sat Aug 8 15:57:58 2026 X-Original-To: dev-commits-src-all@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 4hHQdz2Nbwz6nrQy for ; Sat, 08 Aug 2026 15:57: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 "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4hHQdy2f5Kz3pF4 for ; Sat, 08 Aug 2026 15:57:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1786204678; 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=KJr7c4F5xn0n84rai+TAaPeDIQsiGX7y0iRS28v0Xoo=; b=stb3AwCJZAsiyUbvmva7ekVKtSeQv9vLOnVqS8w5DszD64W+aHmXY7bOJ0mHwuKcKbvGj/ lGmaJAOEXbdMEz7Ueje2ADM0CGxPHHBdqogOz8yJlj1aM+1oHzgehpA2wncjn6gl9ReP0t s++k8cFzHGiBNmyjStf0suXVvvctV2c/eVl42LmAy5XtnCqtAddm3u2b8YhwH7edq2iv0V FgZCRx71WoadwzXjBV5khso7CCPDQcyUrn6Ioc2YBiHFtuEJKLFTaPZ4odA7cErtM1KPAw TQVv6y9m+tHGn+ccIcqPd8ift89em3TR4BHWb4RRPX8GK8XtNTPD7J8Jjb9Crw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1786204678; a=rsa-sha256; cv=none; b=VmbwHwjVpnuF7pTanK8XdX0KddrMu5EzMgiq9gz1NaSecbpsCVwuKKEkyzPORlRKKElksr wrkq5J72JTMbOwnP7LVn+JX/oZFFxVBTj+LsnBwo2OLNc4HP1PwgpfyAsToBKTWLjkbepL yQmGZ0RtmSTeDwyD77skx6pCkxn1DqJ6IbF55SWPjwD1W0I0n8wBrxqN3IORNlY77dL6pK 6fbKk3kU3k+swxtu3+Aj21phf5i/5FkCgzLDIXdFtFePgWp8Vn97xPUWnkhD7aevs9Gpm/ p66XLouXHqe9LxfdnDdg7UtDpmj9ewy1JWrB8tRxLKv/georJxFJUMOEV75rjA== 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=1786204678; 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=KJr7c4F5xn0n84rai+TAaPeDIQsiGX7y0iRS28v0Xoo=; b=cR9jaAwoBruAJdutGKuj789ldva3uOgm5cZvxfc3LZ7nIRILHDqY2AF6RbDqT056q7qbyT JNsNPkIqxFfs8o6TBHfM+RugJNKVXu/5lPxkGQ23scsWWm4LXdGpuo4IHqBfJ5+kqOfPDT HZjzsQMBtYRfw9hqQLXmipm28Vi1YvbVJld5ni5ri5iv8VfJiKgBdqLRuB07oaydlKWZZK jwAzEp02Wugd1McpfI1YNu9CyfnJxuyg7PoHcP4MJOgAvS8hjBC1S8znfvjfNRQ8z729Cu ptJM8itSy1QxlJeLWFq4YMeTIqiQyRZbbVEEij2ZBuEtvq6xMGmrfeA69oLkGg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4hHQdy0jRBzkW3 for ; Sat, 08 Aug 2026 15:57:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 31423 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sat, 08 Aug 2026 15:57:58 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: e2aff50727cb - main - igc: Correct descriptor control programming List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@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/main X-Git-Reftype: branch X-Git-Commit: e2aff50727cbe4cb5e99f825c2c6bd8a4915de67 Auto-Submitted: auto-generated Date: Sat, 08 Aug 2026 15:57:58 +0000 Message-Id: <6a775206.31423.5d7e8bd8@gitrepo.freebsd.org> The branch main has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=e2aff50727cbe4cb5e99f825c2c6bd8a4915de67 commit e2aff50727cbe4cb5e99f825c2c6bd8a4915de67 Author: Kevin Bowling AuthorDate: 2026-08-08 11:30:40 +0000 Commit: Kevin Bowling CommitDate: 2026-08-08 15:51:06 +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. MFC after: 2 weeks --- 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 84012414ec27..a06caaaceeab 100644 --- a/sys/dev/igc/if_igc.c +++ b/sys/dev/igc/if_igc.c @@ -2259,13 +2259,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); } @@ -2393,11 +2389,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