git: bb1b375fa748 - main - e1000: fix em_mac_min and 82547 packet buffer

Kevin Bowling kbowling at FreeBSD.org
Thu Apr 15 17:20:27 UTC 2021


The branch main has been updated by kbowling (ports committer):

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

commit bb1b375fa7487ee5c3843121a0621ac8379c18e6
Author:     Kevin Bowling <kbowling at FreeBSD.org>
AuthorDate: 2021-04-15 16:58:36 +0000
Commit:     Kevin Bowling <kbowling at FreeBSD.org>
CommitDate: 2021-04-15 17:19:30 +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 at protogate.com>
    Reviewed by:    markj
    MFC after:      1 month
    Differential Revision:  https://reviews.freebsd.org/D29766
---
 sys/dev/e1000/if_em.c | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)

diff --git a/sys/dev/e1000/if_em.c b/sys/dev/e1000/if_em.c
index 6f44bdc9ae4c..6f022c80c01c 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
 
 /*********************************************************************
@@ -2469,13 +2469,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:
@@ -2520,6 +2529,7 @@ em_reset(if_ctx_t ctx)
 		pba = E1000_PBA_34K;
 		break;
 	default:
+		/* 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


More information about the dev-commits-src-all mailing list