git: 2a7af8ebcf90 - main - e1000: Limit the TSO sentinel to lem(4) controllers

Kevin Bowling <[email protected]>
Newsgroups gmane.os.freebsd.devel.cvs.src
Message-ID <6a88ff8b.33e2e.70e5e234__26124.8381271557$1787363232$gmane$org@gitrepo.freebsd.org>
The branch main has been updated by kbowling:

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

commit 2a7af8ebcf90af83f01f9523b25bfc6e58c7b809
Author:     Kevin Bowling <[email protected]>
AuthorDate: 2026-08-22 01:24:28 +0000
Commit:     Kevin Bowling <[email protected]>
CommitDate: 2026-08-22 01:46:44 +0000

    e1000: Limit the TSO sentinel to lem(4) controllers
    
    The TSO workaround splits the final DMA segment to create a four byte
    sentinel descriptor.  Intel documents the premature descriptor writeback
    erratum and this workaround in the 82540EP and 82545GM specification
    updates (erratum 3) and the 82546GB specification update (erratum 1).
    
    Limit the workaround and its preceding TSO state to the legacy PCI and
    PCI-X controllers so PCIe controllers retain their natural descriptor
    layout using one fewer descriptor per TSO packet, no split of the final
    segment, and one less four byte DMA.
    
    MFC after:      2 weeks
    Sponsored by:   BBOX.io
---
 sys/dev/e1000/em_txrx.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/sys/dev/e1000/em_txrx.c b/sys/dev/e1000/em_txrx.c
index dced12770c40..df952c8f2ef1 100644
--- a/sys/dev/e1000/em_txrx.c
+++ b/sys/dev/e1000/em_txrx.c
@@ -214,7 +214,11 @@ em_tso_setup(struct e1000_softc *sc, if_pkt_info_t pi, uint32_t *txd_upper,
 	TXD->cmd_and_length = htole32(cmd_type_len |
 	    (pi->ipi_len - hdr_len)); /* Total len */
 
-	txr->tx_tso = true;
+	/*
+	 * 82540EP and 82545GM erratum 3 and 82546GB erratum 1 require
+	 * a second descriptor for the final four bytes of an LSO packet.
+	 */
+	txr->tx_tso = sc->hw.mac.type < e1000_82571;
 
 	if (++cur == scctx->isc_ntxd[0]) {
 		cur = 0;
@@ -380,7 +384,7 @@ em_isc_txd_encap(void *arg, if_pkt_info_t pi)
 	/* Do hardware assists */
 	if (do_tso) {
 		i = em_tso_setup(sc, pi, &txd_upper, &txd_lower);
-		tso_desc = true;
+		tso_desc = txr->tx_tso;
 	} else if (csum_flags & EM_CSUM_OFFLOAD) {
 		i = em_transmit_checksum_setup(sc, pi, &txd_upper,
 		    &txd_lower);
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.