The branch main has been updated by kbowling:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=4f9a44a215f873c6842a693f2e81e0abbe1531cf

commit 4f9a44a215f873c6842a693f2e81e0abbe1531cf
Author:     Kevin Bowling <[email protected]>
AuthorDate: 2023-07-22 22:58:34 +0000
Commit:     Kevin Bowling <[email protected]>
CommitDate: 2023-07-22 22:58:34 +0000

    e1000: Fix/enable IPv6 transmit checksum offload
    
    Fixes and enables txcsum6 offload for lem(4) and em(4).
    
    MFC after:      2 weeks
---
 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 */

Reply via email to