Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 4 Aug 2023 01:23:37 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: 17b587e0ba8e - stable/13 - e1000: Fix/enable IPv6 transmit checksum offload
Message-ID:  <202308040123.3741NbZC021262@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by kbowling:

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

commit 17b587e0ba8ed4d1092537232b969b755b7a92f1
Author:     Kevin Bowling <kbowling@FreeBSD.org>
AuthorDate: 2023-07-22 22:58:34 +0000
Commit:     Kevin Bowling <kbowling@FreeBSD.org>
CommitDate: 2023-08-04 01:21:41 +0000

    e1000: Fix/enable IPv6 transmit checksum offload
    
    Fixes and enables txcsum6 offload for lem(4) and em(4).
    
    MFC after:      2 weeks
    
    (cherry picked from commit 4f9a44a215f873c6842a693f2e81e0abbe1531cf)
---
 sys/dev/e1000/em_txrx.c | 4 ++--
 sys/dev/e1000/if_em.h   | 7 +++++--
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/sys/dev/e1000/em_txrx.c b/sys/dev/e1000/em_txrx.c
index 069a1c00a4b2..1192286d1c9c 100644
--- a/sys/dev/e1000/em_txrx.c
+++ b/sys/dev/e1000/em_txrx.c
@@ -285,13 +285,13 @@ em_transmit_checksum_setup(struct e1000_softc *sc, if_pkt_info_t pi,
 		cmd |= E1000_TXD_CMD_IP;
 	}
 
-	if (csum_flags & (CSUM_TCP|CSUM_UDP)) {
+	if (csum_flags & (CSUM_TCP | CSUM_UDP | CSUM_IP6_TCP | CSUM_IP6_UDP)) {
 		uint8_t tucso;
 
 		*txd_upper |= E1000_TXD_POPTS_TXSM << 8;
 		*txd_lower = E1000_TXD_CMD_DEXT | E1000_TXD_DTYP_D;
 
-		if (csum_flags & CSUM_TCP) {
+		if (csum_flags & CSUM_TCP | CSUM_IP6_TCP) {
 			tucso = hdr_len + offsetof(struct tcphdr, th_sum);
 			cmd |= E1000_TXD_CMD_TCP;
 		} else
diff --git a/sys/dev/e1000/if_em.h b/sys/dev/e1000/if_em.h
index a46ce2fdb6ae..8c5abf5b48cb 100644
--- a/sys/dev/e1000/if_em.h
+++ b/sys/dev/e1000/if_em.h
@@ -333,10 +333,13 @@
 #define EM_TSO_SIZE		65535
 #define EM_TSO_SEG_SIZE		4096	/* Max dma segment size */
 #define ETH_ZLEN		60
-#define EM_CSUM_OFFLOAD		(CSUM_IP | CSUM_IP_UDP | CSUM_IP_TCP) /* Offload bits in mbuf flag */
+
+/* Offload bits in mbuf flag */
+#define EM_CSUM_OFFLOAD		(CSUM_IP | CSUM_IP_UDP | CSUM_IP_TCP | \
+				    CSUM_IP6_UDP | CSUM_IP6_TCP)
 #define IGB_CSUM_OFFLOAD	(CSUM_IP | CSUM_IP_UDP | CSUM_IP_TCP | \
 				    CSUM_IP_SCTP | CSUM_IP6_UDP | CSUM_IP6_TCP | \
-				    CSUM_IP6_SCTP)	/* Offload bits in mbuf flag */
+				    CSUM_IP6_SCTP)
 
 #define IGB_PKTTYPE_MASK	0x0000FFF0
 #define IGB_DMCTLX_DCFLUSH_DIS	0x80000000  /* Disable DMA Coalesce Flush */



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