git: a0a0fa1dd922 - stable/14 - ure: improve checksum offloading
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sun, 26 Apr 2026 08:23:11 UTC
The branch stable/14 has been updated by tuexen:
URL: https://cgit.FreeBSD.org/src/commit/?id=a0a0fa1dd92289d3b7b5336c409303662a7ec7fa
commit a0a0fa1dd92289d3b7b5336c409303662a7ec7fa
Author: Michael Tuexen <tuexen@FreeBSD.org>
AuthorDate: 2026-01-31 10:42:10 +0000
Commit: Michael Tuexen <tuexen@FreeBSD.org>
CommitDate: 2026-04-26 06:21:44 +0000
ure: improve checksum offloading
This patch fixes three issues:
(1) Initially, set the hwassist flags correctly when enabling
transmit checksum offload for TCP/IPv6 and UDP/IPv6.
(2) Keep the hwassist flags in sync with the capabilities when
changing txcsum.
(3) Keep the hwasssit flags in sync with the capabilities when
changing txcsum6.
Without this patch, transmit checksum offloading for TCP/IPv6 and
UDP/IPv6 is never used and transmit checksum offloading for IPv4,
TCP/IPv4 and UDP/IPv4 is always used, even if disabled via
ifconfig ue? -txcsum.
Reviewed by: Timo Völker
Differential Revision: https://reviews.freebsd.org/D54974
Event: Wiesbaden Hackathon 2026
(cherry picked from commit 7b6e84c9ac5668134ab2d075019ef0b827d90c84)
---
sys/dev/usb/net/if_ure.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/sys/dev/usb/net/if_ure.c b/sys/dev/usb/net/if_ure.c
index b0ddd8af7285..e6b101587421 100644
--- a/sys/dev/usb/net/if_ure.c
+++ b/sys/dev/usb/net/if_ure.c
@@ -1011,6 +1011,7 @@ ure_attach_post_sub(struct usb_ether *ue)
if_sethwassist(ifp, CSUM_IP|CSUM_IP_UDP|CSUM_IP_TCP);
#ifdef INET6
if_setcapabilitiesbit(ifp, IFCAP_HWCSUM_IPV6, 0);
+ if_sethwassistbits(ifp, CSUM_IP6_UDP|CSUM_IP6_TCP, 0);
#endif
if_setcapenable(ifp, if_getcapabilities(ifp));
@@ -1459,6 +1460,7 @@ ure_ioctl(if_t ifp, u_long cmd, caddr_t data)
if ((mask & IFCAP_TXCSUM) != 0 &&
(if_getcapabilities(ifp) & IFCAP_TXCSUM) != 0) {
if_togglecapenable(ifp, IFCAP_TXCSUM);
+ if_togglehwassist(ifp, CSUM_IP|CSUM_IP_UDP|CSUM_IP_TCP);
}
if ((mask & IFCAP_RXCSUM) != 0 &&
(if_getcapabilities(ifp) & IFCAP_RXCSUM) != 0) {
@@ -1467,6 +1469,7 @@ ure_ioctl(if_t ifp, u_long cmd, caddr_t data)
if ((mask & IFCAP_TXCSUM_IPV6) != 0 &&
(if_getcapabilities(ifp) & IFCAP_TXCSUM_IPV6) != 0) {
if_togglecapenable(ifp, IFCAP_TXCSUM_IPV6);
+ if_togglehwassist(ifp, CSUM_IP6_UDP|CSUM_IP6_TCP);
}
if ((mask & IFCAP_RXCSUM_IPV6) != 0 &&
(if_getcapabilities(ifp) & IFCAP_RXCSUM_IPV6) != 0) {