From owner-dev-commits-src-branches@freebsd.org Tue May 18 07:49:11 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C2CD964361C; Tue, 18 May 2021 07:49:11 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Fkp6b4bGfz3p5y; Tue, 18 May 2021 07:49:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 80A9C1BA27; Tue, 18 May 2021 07:49:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 14I7nBTo092244; Tue, 18 May 2021 07:49:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 14I7nBI1092243; Tue, 18 May 2021 07:49:11 GMT (envelope-from git) Date: Tue, 18 May 2021 07:49:11 GMT Message-Id: <202105180749.14I7nBI1092243@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: 1a132077c2cb - stable/12 - e1000: fix em_mac_min and 82547 packet buffer 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/12 X-Git-Reftype: branch X-Git-Commit: 1a132077c2cb500410079f9120c3f676d15f7931 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 May 2021 07:49:12 -0000 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 AuthorDate: 2021-04-15 16:58:36 +0000 Commit: Kevin Bowling 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 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 #include -#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 */