Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 18 May 2021 07:49:11 GMT
From:      Kevin Bowling <kbowling@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: 1a132077c2cb - stable/12 - e1000: fix em_mac_min and 82547 packet buffer
Message-ID:  <202105180749.14I7nBI1092243@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/12 has been updated by kbowling (ports committer):

URL: https://cgit.FreeBSD.org/src/commit/?id=1a132077c2cb500410079f9120c3f676d15f7931

commit 1a132077c2cb500410079f9120c3f676d15f7931
Author:     Kevin Bowling <kbowling@FreeBSD.org>
AuthorDate: 2021-04-15 16:58:36 +0000
Commit:     Kevin Bowling <kbowling@FreeBSD.org>
CommitDate: 2021-05-18 07:48:49 +0000

    e1000: fix em_mac_min and 82547 packet buffer
    
    The boundary differentiating "lem" vs "em" class devices was wrong
    after the iflib conversion of lem(4).
    
    The Packet Buffer size for 82547 class chips was not set correctly
    after the iflib conversion of lem(4).
    
    These changes restore functionality on an 82547 for the submitter.
    
    PR:             236119
    Reported by:    Jeff Gibbons <jgibbons@protogate.com>
    Reviewed by:    markj
    MFC after:      1 month
    Differential Revision:  https://reviews.freebsd.org/D29766
    
    (cherry picked from commit bb1b375fa7487ee5c3843121a0621ac8379c18e6)
---
 sys/dev/e1000/if_em.c | 18 ++++++++++++++----
 1 file changed, 14 insertions(+), 4 deletions(-)

diff --git a/sys/dev/e1000/if_em.c b/sys/dev/e1000/if_em.c
index 2c13f7750af2..ce60b1f5d437 100644
--- a/sys/dev/e1000/if_em.c
+++ b/sys/dev/e1000/if_em.c
@@ -31,7 +31,7 @@
 #include <sys/sbuf.h>
 #include <machine/_inttypes.h>
 
-#define em_mac_min e1000_82547
+#define em_mac_min e1000_82571
 #define igb_mac_min e1000_82575
 
 /*********************************************************************
@@ -2492,13 +2492,22 @@ em_reset(if_ctx_t ctx)
 	 * the remainder is used for the transmit buffer.
 	 */
 	switch (hw->mac.type) {
-	/* Total Packet Buffer on these is 48K */
+	/* 82547: Total Packet Buffer is 40K */
+	case e1000_82547:
+	case e1000_82547_rev_2:
+		if (hw->mac.max_frame_size > 8192)
+			pba = E1000_PBA_22K; /* 22K for Rx, 18K for Tx */
+		else
+			pba = E1000_PBA_30K; /* 30K for Rx, 10K for Tx */
+		break;
+	/* 82571/82572/80003es2lan: Total Packet Buffer is 48K */
 	case e1000_82571:
 	case e1000_82572:
 	case e1000_80003es2lan:
 			pba = E1000_PBA_32K; /* 32K for Rx, 16K for Tx */
 		break;
-	case e1000_82573: /* 82573: Total Packet Buffer is 32K */
+	/* 82573: Total Packet Buffer is 32K */
+	case e1000_82573:
 			pba = E1000_PBA_12K; /* 12K for Rx, 20K for Tx */
 		break;
 	case e1000_82574:
@@ -2546,7 +2555,8 @@ em_reset(if_ctx_t ctx)
 		pba = E1000_PBA_34K;
 		break;
 	default:
-		if (adapter->hw.mac.max_frame_size > 8192)
+		/* Remaining devices assumed to have a Packet Buffer of 64K. */
+		if (hw->mac.max_frame_size > 8192)
 			pba = E1000_PBA_40K; /* 40K for Rx, 24K for Tx */
 		else
 			pba = E1000_PBA_48K; /* 48K for Rx, 16K for Tx */



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202105180749.14I7nBI1092243>