Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 15 May 2022 17:04:52 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: f4262a065dcf - stable/12 - e1000: Increase rx_buffer_size to 32b
Message-ID:  <202205151704.24FH4qlt087430@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=f4262a065dcf32169d2e8b5434a5030bf60f1ae3

commit f4262a065dcf32169d2e8b5434a5030bf60f1ae3
Author:     Kevin Bowling <kbowling@FreeBSD.org>
AuthorDate: 2022-05-12 15:38:09 +0000
Commit:     Kevin Bowling <kbowling@FreeBSD.org>
CommitDate: 2022-05-15 17:04:38 +0000

    e1000: Increase rx_buffer_size to 32b
    
    Extend the size of the local rx_buffer_size variable to account for
    larger buffer sizes possible on 82580, i350 chips.
    
    From i350 datasheet, 6.2.10 Initialization Control 4 (LAN Base Address
    + Offset 0x13):
    When 4 ports are enabled maximum buffer size is 36 KB. When 2 ports are
    enabled maximum buffer size is 72 KB. When only a single port is
    enabled maximum buffer size is 144 KB.
    
    and 8.3:
    The overall available internal buffer size in the I350 for all ports is
    144 KB for receive buffers and 80 KB for transmit Buffers. Disabled
    ports memory can be shared between active ports and sharing can be
    asymmetric. The default buffer size for each port is loaded from the
    EEPROM on initialization.
    
    From the reporter:
    But for I350 when only 2 ports are used PBA size can be set as 72KB
    (see datasheet RXPbsize or e1000_rxpbs_adjust_82580 function in
    e1000_82575.c). In this case calculating the rx_buffer_size overflows
    as 0x0048 << 10 = 73728 or 0x12000 pushed into u16. It is then set as
    0x2000 or 8192.
    
    PR:             263896
    Reported by:    hannula@gmail.com
    Tested by:      hannula@gmail.com
    Approved by:    markj
    Differential Revision:  https://reviews.freebsd.org/D35167
    
    (cherry picked from commit 6987c47569b377f4b6eba9966afdedfb1b39fca8)
---
 sys/dev/e1000/if_em.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sys/dev/e1000/if_em.c b/sys/dev/e1000/if_em.c
index 7e854514aafb..821bb87f0ff3 100644
--- a/sys/dev/e1000/if_em.c
+++ b/sys/dev/e1000/if_em.c
@@ -2467,7 +2467,7 @@ em_reset(if_ctx_t ctx)
 	struct e1000_softc *sc = iflib_get_softc(ctx);
 	struct ifnet *ifp = iflib_get_ifp(ctx);
 	struct e1000_hw *hw = &sc->hw;
-	u16 rx_buffer_size;
+	u32 rx_buffer_size;
 	u32 pba;
 
 	INIT_DEBUGOUT("em_reset: begin");



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