From nobody Sat Aug 22 00:37:57 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 4hRdYy1G86z6pqnF for ; Sat, 22 Aug 2026 00:37:58 +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 4hRdYy0cjJz3HT7 for ; Sat, 22 Aug 2026 00:37:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1787359078; 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=rZwCQEk4gZjLkSmCxOOuMoGavnSQIsjvGgCU0+BVGaw=; b=UN3mFdIf2AA6NFjZqUTlHpVPQ70uA3WDxpRlT6UeXeZhyytjvBMsKQa4rLfrAusyvMLo5R hrvpLfd6ySjebhVVnXIQ1W+XkIJIHCgycHswJxLXw2iCMr2W4qgVCcHjRAr3xgNbrvjVXW pK4Wizpokxj2AxuelCoSHwP64FTobltw5YxzHCLCZKTMul0/UgfhUsCWqzF0tlMaUbyvKb AcEwrqm5+V36jp4sZudypieUQ7Nm/Fvx7UQYauZsIUR0QT2k9rA86tVjpKsDklmTXX8l7H DkjP8riUtv4gdmRRZPPWiF2Hmqa44qsinU87HMtOYcv+RTBKQAal4Wm1Y4QkNA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1787359078; a=rsa-sha256; cv=none; b=B9CadaLDoCBVBF1PjO7T0LUmFyOb7tyOHx11M+HGOS3JLNIgVKv78ebmSPFcq78rSleLbq cVjovkBuKvxsLfdliTH5l65Ea1zMIAsDkd9/bTfjVxkWm8YJuw4XIZYRRfkRa5biG6XjQp yd9OUNsck+R6/muaUZi4I9L42WTJyvz/fuqMjT94Jr+kwi1lS+b++A+uImKxjVW09XuRp7 FgDo4DcuUhHOn3OE9gTYonD5p3X6ujnrEwbPMUB5Njui5wbR2l66qRx3PdW9eJGXk1LMpo XgEUhPFGDP6ivnNLeiqFSCSgpY4l8JddfyU6if086T65EzD2WtSGF7MaGXBplg== 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=1787359078; 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=rZwCQEk4gZjLkSmCxOOuMoGavnSQIsjvGgCU0+BVGaw=; b=u0r1p583mmuFyplUiWczXB34uHRqdxlgCetTeFhggknRKy1UwPZSwYzHa8uzkhvkkBnYOp U+yk58P0NOkJ4S6wCZ9FlVWm6krYU6PG5XnhqMtYEfUL3ElbsA/s/+okTlCWdTOpx2uhPe 0/rISqTRLWhD0QGfFWn82PSc7oD3bcM8FDwAcYWSG5QU9mVnUivJZC3/xI4RuKim4HNTz7 KInVzHXBDTClFhNrdjLLAMK3IFiQghTemWnIkzLBl8u47ULNunBR6XhUrcugZCUirDXAyB bbk00sMgVblO2o18zSo4+y9mqjOQlQ8jwU9Ih3ht4KwZBxgKPlY7tRr3Cn3jiQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4hRdYx65WdzB6G for ; Sat, 22 Aug 2026 00:37:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 24f92 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sat, 22 Aug 2026 00:37:57 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: 51cae2cbf19a - stable/15 - igb: Program Rx descriptor thresholds by family 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/stable/15 X-Git-Reftype: branch X-Git-Commit: 51cae2cbf19a20b5fd4877713ce0eb55fdde5691 Auto-Submitted: auto-generated Date: Sat, 22 Aug 2026 00:37:57 +0000 Message-Id: <6a88ef65.24f92.1d841fd1@gitrepo.freebsd.org> The branch stable/15 has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=51cae2cbf19a20b5fd4877713ce0eb55fdde5691 commit 51cae2cbf19a20b5fd4877713ce0eb55fdde5691 Author: Kevin Bowling AuthorDate: 2026-08-08 12:27:37 +0000 Commit: Kevin Bowling CommitDate: 2026-08-22 00:34:28 +0000 igb: Program Rx descriptor thresholds by family 82576 specification-update erratum 26 says MSI-X EITR expiration can fail to trigger receive descriptor writeback. A WTHRESH above one can therefore leave received packets invisible until the threshold fills. The shared threshold macros selected policy by enum ordering, so an 82576 VF fell into the generic WTHRESH=4 case. VFs always use MSI-X and require the same WTHRESH=1 workaround as the PF. Use PTHRESH=8 for 82575 and 82576 PFs and VFs, matching DPDK and the current Linux PF driver. The legacy FreeBSD PF and Linux igbvf value of 16 thrashes limited descriptor cache; no specification or erratum requires it. Retain the i354 PTHRESH=12 exception. Enumerate every supported igb PF and VF MAC type so each receives its intended policy. Also clear every threshold bit before installing the new values. The old mask retained the high WTHRESH bit, and 82575 uses six-bit fields while later controllers use five-bit fields. (cherry picked from commit bd4182a2c96eb8329de54448a96bbd15f14238da) --- sys/dev/e1000/if_em.c | 57 +++++++++++++++++++++++++++++++++++++++++++++------ sys/dev/e1000/if_em.h | 18 +++++++++++----- 2 files changed, 64 insertions(+), 11 deletions(-) diff --git a/sys/dev/e1000/if_em.c b/sys/dev/e1000/if_em.c index 54302fe01b4b..c236aed04634 100644 --- a/sys/dev/e1000/if_em.c +++ b/sys/dev/e1000/if_em.c @@ -3931,6 +3931,56 @@ em_initialize_transmit_unit(if_ctx_t ctx) **********************************************************************/ #define BSIZEPKT_ROUNDUP ((1<hw; + mask = IGB_RXDCTL_THRESH_MASK; + switch (hw->mac.type) { + case e1000_82575: + mask = IGB_82575_RXDCTL_THRESH_MASK; + pthresh = IGB_RX_PTHRESH; + wthresh = IGB_RX_WTHRESH; + break; + case e1000_82576: + pthresh = IGB_RX_PTHRESH; + wthresh = sc->intr_type == IFLIB_INTR_MSIX ? + IGB_82576_RX_WTHRESH : IGB_RX_WTHRESH; + break; + case e1000_vfadapt: + /* 82576 VFs always need the MSI-X writeback workaround. */ + pthresh = IGB_RX_PTHRESH; + wthresh = IGB_82576_RX_WTHRESH; + break; + case e1000_i354: + pthresh = I354_RX_PTHRESH; + wthresh = IGB_RX_WTHRESH; + break; + case e1000_82580: + case e1000_i350: + case e1000_i210: + case e1000_i211: + case e1000_vfadapt_i350: + pthresh = IGB_RX_PTHRESH; + wthresh = IGB_RX_WTHRESH; + break; + default: + KASSERT(0, ("%s: unsupported MAC type %d", __func__, + hw->mac.type)); + pthresh = IGB_RX_PTHRESH; + wthresh = IGB_RX_WTHRESH; + break; + } + + rxdctl &= ~mask; + rxdctl |= pthresh | (IGB_RX_HTHRESH << 8) | + (wthresh << 16) | E1000_RXDCTL_QUEUE_ENABLE; + return (rxdctl); +} + static bool em_integrated_jumbo_rx(struct e1000_hw *hw) { @@ -4182,12 +4232,7 @@ em_initialize_receive_unit(if_ctx_t ctx) E1000_WRITE_REG(hw, E1000_RDH(i), 0); E1000_WRITE_REG(hw, E1000_RDT(i), 0); E1000_WRITE_REG(hw, E1000_SRRCTL(i), srrctl); - /* Enable this Queue */ - rxdctl |= E1000_RXDCTL_QUEUE_ENABLE; - rxdctl &= 0xFFF00000; - rxdctl |= IGB_RX_PTHRESH; - rxdctl |= IGB_RX_HTHRESH << 8; - rxdctl |= IGB_RX_WTHRESH << 16; + rxdctl = igb_rxdctl(sc, rxdctl); E1000_WRITE_REG(hw, E1000_RXDCTL(i), rxdctl); } } else if (hw->mac.type >= e1000_pch2lan) { diff --git a/sys/dev/e1000/if_em.h b/sys/dev/e1000/if_em.h index 749cb66424bd..6237639bd5a5 100644 --- a/sys/dev/e1000/if_em.h +++ b/sys/dev/e1000/if_em.h @@ -310,11 +310,19 @@ #define EM_82574_RX_HTHRESH 4 #define EM_82574_RX_WTHRESH 4 -#define IGB_RX_PTHRESH ((hw->mac.type == e1000_i354) ? 12 : \ - ((hw->mac.type <= e1000_82576) ? 16 : 8)) -#define IGB_RX_HTHRESH 8 -#define IGB_RX_WTHRESH ((hw->mac.type == e1000_82576 && \ - (sc->intr_type == IFLIB_INTR_MSIX)) ? 1 : 4) +#define IGB_RXDCTL_PTHRESH_MASK 0x0000001F +#define IGB_RXDCTL_HTHRESH_MASK 0x00001F00 +#define IGB_RXDCTL_WTHRESH_MASK 0x001F0000 +#define IGB_RXDCTL_THRESH_MASK (IGB_RXDCTL_PTHRESH_MASK | \ + IGB_RXDCTL_HTHRESH_MASK | \ + IGB_RXDCTL_WTHRESH_MASK) +#define IGB_82575_RXDCTL_THRESH_MASK 0x003F3F3F + +#define IGB_RX_PTHRESH 8 +#define I354_RX_PTHRESH 12 +#define IGB_RX_HTHRESH 8 +#define IGB_RX_WTHRESH 4 +#define IGB_82576_RX_WTHRESH 1 #define IGB_TX_PTHRESH 8 #define I354_TX_PTHRESH 20