git: 98b95af873ac - stable/14 - e1000: Correct Rx descriptor threshold programming

From: Kevin Bowling <kbowling_at_FreeBSD.org>
Date: Sat, 22 Aug 2026 00:49:50 UTC
The branch stable/14 has been updated by kbowling:

URL: https://cgit.FreeBSD.org/src/commit/?id=98b95af873acf4beeb4ac9a0c83e5d009fb78cd9

commit 98b95af873acf4beeb4ac9a0c83e5d009fb78cd9
Author:     Kevin Bowling <kbowling@FreeBSD.org>
AuthorDate: 2026-08-08 12:26:23 +0000
Commit:     Kevin Bowling <kbowling@FreeBSD.org>
CommitDate: 2026-08-22 00:49:40 +0000

    e1000: Correct Rx descriptor threshold programming
    
    Jumbo receive tuning on integrated controllers enabled PTHRESH without
    a nonzero HTHRESH, contrary to the hardware programming requirements.
    It also covered only the integrated MAC generations present when the
    workaround was added.  Enumerate every jumbo-capable ICH and PCH type
    and program PTHRESH=3 with HTHRESH=1.  Linux fixed the same HTHRESH
    omission in b701cacdbcfb.
    
    The 82574 path combined threshold values with the reset values using
    bitwise OR.  Requesting WTHRESH=4 while the reset value was one thus
    programmed five.  Clear the complete threshold fields before installing
    the established PTHRESH=32, HTHRESH=4, WTHRESH=4 descriptor-granularity
    policy.
    
    (cherry picked from commit abe22383f1b144f0868aa0654ec4514d36f7a4f5)
---
 sys/dev/e1000/if_em.c | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/sys/dev/e1000/if_em.c b/sys/dev/e1000/if_em.c
index a35e14e20c1f..5603d63e480b 100644
--- a/sys/dev/e1000/if_em.c
+++ b/sys/dev/e1000/if_em.c
@@ -3920,6 +3920,27 @@ em_integrated_jumbo_rx(struct e1000_hw *hw)
 	}
 }
 
+static bool
+em_integrated_jumbo_rx(struct e1000_hw *hw)
+{
+	switch (hw->mac.type) {
+	case e1000_ich9lan:
+	case e1000_ich10lan:
+	case e1000_pchlan:
+	case e1000_pch2lan:
+	case e1000_pch_lpt:
+	case e1000_pch_spt:
+	case e1000_pch_cnp:
+	case e1000_pch_tgp:
+	case e1000_pch_adp:
+	case e1000_pch_mtp:
+	case e1000_pch_ptp:
+		return (true);
+	default:
+		return (false);
+	}
+}
+
 static void
 em_initialize_receive_unit(if_ctx_t ctx)
 {