git: aca67c37a521 - main - dwc: add transmit checksum offload for IPv6
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sat, 17 Jan 2026 20:04:06 UTC
The branch main has been updated by tuexen:
URL: https://cgit.FreeBSD.org/src/commit/?id=aca67c37a5215448828a2974a2ff44e75e9159bc
commit aca67c37a5215448828a2974a2ff44e75e9159bc
Author: Michael Tuexen <tuexen@FreeBSD.org>
AuthorDate: 2026-01-17 20:01:54 +0000
Commit: Michael Tuexen <tuexen@FreeBSD.org>
CommitDate: 2026-01-17 20:01:54 +0000
dwc: add transmit checksum offload for IPv6
This patch adds support for transmit checksum offload for TCP/IPv6
and UDP/IPv6.
Reviewed by: Timo Völker
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D54754
---
sys/dev/dwc/dwc1000_dma.c | 2 +-
sys/dev/dwc/if_dwc.c | 10 ++++++++--
2 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/sys/dev/dwc/dwc1000_dma.c b/sys/dev/dwc/dwc1000_dma.c
index 8cc145216c2d..a2a6fbc84e58 100644
--- a/sys/dev/dwc/dwc1000_dma.c
+++ b/sys/dev/dwc/dwc1000_dma.c
@@ -276,7 +276,7 @@ dma1000_setup_txbuf(struct dwc_softc *sc, int idx, struct mbuf **mp)
m = *mp;
- if ((m->m_pkthdr.csum_flags & CSUM_DELAY_DATA) != 0)
+ if ((m->m_pkthdr.csum_flags & (CSUM_DELAY_DATA | CSUM_DELAY_DATA_IPV6)) != 0)
flags = sc->dma_ext_desc ? ETDESC0_CIC_SEG : NTDESC1_CIC_SEG;
else if ((m->m_pkthdr.csum_flags & CSUM_IP) != 0)
flags = sc->dma_ext_desc ? ETDESC0_CIC_HDR : NTDESC1_CIC_HDR;
diff --git a/sys/dev/dwc/if_dwc.c b/sys/dev/dwc/if_dwc.c
index 458ee01536ef..ac6e440cf95c 100644
--- a/sys/dev/dwc/if_dwc.c
+++ b/sys/dev/dwc/if_dwc.c
@@ -271,6 +271,12 @@ dwc_ioctl(if_t ifp, u_long cmd, caddr_t data)
if_sethwassistbits(ifp, CSUM_IP | CSUM_DELAY_DATA, 0);
else
if_sethwassistbits(ifp, 0, CSUM_IP | CSUM_DELAY_DATA);
+ if (mask & IFCAP_TXCSUM_IPV6)
+ if_togglecapenable(ifp, IFCAP_TXCSUM_IPV6);
+ if ((if_getcapenable(ifp) & IFCAP_TXCSUM_IPV6) != 0)
+ if_sethwassistbits(ifp, CSUM_DELAY_DATA_IPV6, 0);
+ else
+ if_sethwassistbits(ifp, 0, CSUM_DELAY_DATA_IPV6);
if (if_getdrvflags(ifp) & IFF_DRV_RUNNING) {
DWC_LOCK(sc);
@@ -607,8 +613,8 @@ dwc_attach(device_t dev)
if_setinitfn(ifp, dwc_init);
if_setsendqlen(ifp, TX_MAP_COUNT - 1);
if_setsendqready(sc->ifp);
- if_sethwassist(sc->ifp, CSUM_IP | CSUM_DELAY_DATA);
- if_setcapabilities(sc->ifp, IFCAP_VLAN_MTU | IFCAP_HWCSUM);
+ if_sethwassist(sc->ifp, CSUM_IP | CSUM_DELAY_DATA | CSUM_DELAY_DATA_IPV6);
+ if_setcapabilities(sc->ifp, IFCAP_VLAN_MTU | IFCAP_HWCSUM | IFCAP_TXCSUM_IPV6);
if_setcapenable(sc->ifp, if_getcapabilities(sc->ifp));
/* Attach the mii driver. */