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
This commit is contained in:
Kevin Bowling 2021-04-15 09:58:36 -07:00
parent 548d8a131d
commit bb1b375fa7

View File

@ -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