diff options
| author | Michael Tuexen <tuexen@FreeBSD.org> | 2026-01-17 21:01:54 +0100 |
|---|---|---|
| committer | Michael Tuexen <tuexen@FreeBSD.org> | 2026-01-17 21:01:54 +0100 |
| commit | aca67c37a5215448828a2974a2ff44e75e9159bc (patch) | |
| tree | 2034f686c79fc889e01f49e51ac033c7db987648 /sys | |
| parent | 895eeb49239eae947742bc2501836cc774d3467a (diff) | |
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
Diffstat (limited to 'sys')
| -rw-r--r-- | sys/dev/dwc/dwc1000_dma.c | 2 | ||||
| -rw-r--r-- | 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. */ |
