Date: Sun, 8 Feb 2026 11:20:09 +0100 From: Michael Tuexen <tuexen@FreeBSD.org> To: Charlie Li <vishwin@FreeBSD.org> Cc: "src-committers@freebsd.org" <src-committers@FreeBSD.org>, "dev-commits-src-all@freebsd.org" <dev-commits-src-all@FreeBSD.org>, "dev-commits-src-main@freebsd.org" <dev-commits-src-main@FreeBSD.org> Subject: Re: git: 7b6e84c9ac56 - main - ure: improve checksum offloading Message-ID: <C9827103-8C6C-4470-BFA5-6EAA56AAB983@FreeBSD.org> In-Reply-To: <2926D3E0-F01A-4D6E-BCE7-6AB370054D67@FreeBSD.org> References: <697ddd34.3ef70.43e05480@gitrepo.freebsd.org> <98155039-1cb4-4420-a66e-1b6bd94464c8@freebsd.org> <2926D3E0-F01A-4D6E-BCE7-6AB370054D67@FreeBSD.org>
index | next in thread | previous in thread | raw e-mail
> On 8. Feb 2026, at 09:45, Michael Tuexen <tuexen@freebsd.org> wrote: > >> On 7. Feb 2026, at 16:34, Charlie Li <vishwin@FreeBSD.org> wrote: >> >> Michael Tuexen wrote: >>> The branch main has been updated by tuexen: >>> URL: https://cgit.FreeBSD.org/src/commit/?id=7b6e84c9ac5668134ab2d075019ef0b827d90c84 >>> commit 7b6e84c9ac5668134ab2d075019ef0b827d90c84 >>> Author: Michael Tuexen <tuexen@FreeBSD.org> >>> AuthorDate: 2026-01-31 10:42:10 +0000 >>> Commit: Michael Tuexen <tuexen@FreeBSD.org> >>> CommitDate: 2026-01-31 10:42:10 +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 >>> MFC after: 3 days >>> Differential Revision: https://reviews.freebsd.org/D54974 >>> --- >>> 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 c3f7b622d687..3dea88eb10f1 100644 >>> --- a/sys/dev/usb/net/if_ure.c >>> +++ b/sys/dev/usb/net/if_ure.c >>> @@ -1015,6 +1015,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)); >>> @@ -1463,6 +1464,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) { >>> @@ -1471,6 +1473,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) { >> It seems that with this commit, all network traffic and then some, excluding ICMP{,v6}, time out. Even `route(8) get default` takes forever to query. > Do you use a GENERIC kernel? > What is the output of > ifconfig ue0 > and (if you compiled and installed tools/tools/ifinfo/) > ifinfo ue0 > > What happens if you run as root > ifconfig ue0 -txcsum > and/or > ifconfig ue0 -txcsum6 > Does the problem persist? > > This commit should actually only let the host stack know that TCP/IPv6 and UDP/IPv6 > transmit checksum offload is enabled. It should not affect TCP/IPv4 and UDP/IPv4 > transmit checksum offload (except that you can now disable it). > Is any other network interface (like epair, bridge, ...) involved? I did some more testing: It seems that transmit checksum offloading for TCP/IPv6 and UDP/IPv6 does not work correctly. So does ifconfig ue0 -txcsum6 resolve the networking problem for you? Best regards Michael > > Best regards > Michael >> >> -- >> Charlie Li >> ...nope, still don't have an exit line. >> > >home | help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?C9827103-8C6C-4470-BFA5-6EAA56AAB983>
