git: a83f6427c15d - stable/14 - dwc: improve IPv4 transmit checksum offloading
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Wed, 21 Jan 2026 14:04:30 UTC
The branch stable/14 has been updated by tuexen:
URL: https://cgit.FreeBSD.org/src/commit/?id=a83f6427c15d0ae24c89c583e72abab9a4669d8f
commit a83f6427c15d0ae24c89c583e72abab9a4669d8f
Author: Michael Tuexen <tuexen@FreeBSD.org>
AuthorDate: 2026-01-16 11:02:53 +0000
Commit: Michael Tuexen <tuexen@FreeBSD.org>
CommitDate: 2026-01-21 14:04:21 +0000
dwc: improve IPv4 transmit checksum offloading
This patch provides two improvements for TCP/IPv4 and UDP/IPv4
transmit checksum offloading:
(1) Use *CIC_SEG instead of *CIC_FULL, since FreeBSD always provides
a pseudo header checksum.
(2) Don't make transmit IPv4 header checksum offloading a prerequisite
for TCP/IPv4 or UDP/IPv4 transmit checksum offloading.
This is the root cause of PR 291696, since right now the epair
interface does not support transmit IPv4 header checksum offloading,
but TCP/IPv4 and UDP/IPv4 transmit checksum offloading.
PR: 291696
Reviewed by: Timo Voelker
Tested by: Marek Benc
Differential Revision: https://reviews.freebsd.org/D54395
(cherry picked from commit f8ddf74175c8013268e65b18750e247306fa088a)
---
sys/dev/dwc/if_dwc.c | 21 +++++++--------------
1 file changed, 7 insertions(+), 14 deletions(-)
diff --git a/sys/dev/dwc/if_dwc.c b/sys/dev/dwc/if_dwc.c
index 18e86ac025d4..62de67653761 100644
--- a/sys/dev/dwc/if_dwc.c
+++ b/sys/dev/dwc/if_dwc.c
@@ -685,7 +685,7 @@ dwc_setup_txbuf(struct dwc_softc *sc, int idx, struct mbuf **mp)
struct bus_dma_segment segs[TX_MAP_MAX_SEGS];
int error, nsegs;
struct mbuf * m;
- uint32_t flags = 0;
+ uint32_t flags;
int i;
int first, last;
@@ -713,19 +713,12 @@ dwc_setup_txbuf(struct dwc_softc *sc, int idx, struct mbuf **mp)
m = *mp;
- if ((m->m_pkthdr.csum_flags & CSUM_IP) != 0) {
- if ((m->m_pkthdr.csum_flags & (CSUM_TCP|CSUM_UDP)) != 0) {
- if (sc->mactype != DWC_GMAC_EXT_DESC)
- flags = NTDESC1_CIC_FULL;
- else
- flags = ETDESC0_CIC_FULL;
- } else {
- if (sc->mactype != DWC_GMAC_EXT_DESC)
- flags = NTDESC1_CIC_HDR;
- else
- flags = ETDESC0_CIC_HDR;
- }
- }
+ if ((m->m_pkthdr.csum_flags & CSUM_DELAY_DATA) != 0)
+ flags = (sc->mactype != DWC_GMAC_EXT_DESC) ? NTDESC1_CIC_SEG : ETDESC0_CIC_SEG;
+ else if ((m->m_pkthdr.csum_flags & CSUM_IP) != 0)
+ flags = (sc->mactype != DWC_GMAC_EXT_DESC) ? NTDESC1_CIC_HDR : ETDESC0_CIC_HDR;
+ else
+ flags = (sc->mactype != DWC_GMAC_EXT_DESC) ? NTDESC1_CIC_NONE : ETDESC0_CIC_NONE;
bus_dmamap_sync(sc->txbuf_tag, sc->txbuf_map[idx].map,
BUS_DMASYNC_PREWRITE);