From nobody Mon Feb 9 16:16:07 2026 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4f8qZ80yTJz6Rf3W; Mon, 09 Feb 2026 16:16:16 +0000 (UTC) (envelope-from ronald-lists@klop.ws) Received: from smtp-relay-int.realworks.nl (smtp-relay-int.realworks.nl [31.134.205.98]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4f8qZ74Y4Nz3LmQ; Mon, 09 Feb 2026 16:16:15 +0000 (UTC) (envelope-from ronald-lists@klop.ws) Authentication-Results: mx1.freebsd.org; none Received: from crmpreview3.colo2.realworks.nl (localhost [127.0.0.1]) by crmpreview3.colo2.realworks.nl (Postfix) with ESMTP id C69C2140150; Mon, 9 Feb 2026 17:16:07 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=klop.ws; s=rw2; t=1770653768; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=4HTqLrsoHVBRe5ZNGVD49kp+jqxFHgJuF5SNMxBy0FE=; b=rollBJ9pwx2twT32JBkKFiBHdcDUW/J1G4pxYTypdBwzy0chk5QoDOSKZCjybR9+GEfpzR vTkvi0lBLlJQaxATM3S6p/s+qfmcCNLVbFaEcp40iHuWbM/j/bJkPuZhgYm7RaQ5WDtVHO f3w4u6CTBG5NUgCDnEOi9ob5f4gizGf02JYd/KfQiOW1KR7mFQw8HkVh98yMUcX+LPaYbM XzvWYcD0CpVfGCU3h2j0Em3fwI3V1QXMlR5W4vjuKjleOA9Wlka7ydPROxjKFgjXgeqZRU r52bKuHuqF6H5N4xcq6MRTIAc0dT/MCvf1ciKWJJTsTqESUbH6AOvuI2G6Bkgg== Date: Mon, 9 Feb 2026 17:16:07 +0100 (CET) From: Ronald Klop To: Michael Tuexen Cc: dev-commits-src-all@FreeBSD.org, src-committers@FreeBSD.org, dev-commits-src-main@FreeBSD.org Message-ID: <1315337813.3441.1770653767432@localhost> In-Reply-To: <6988ef21.3e6ef.54b19aac@gitrepo.freebsd.org> References: <6988ef21.3e6ef.54b19aac@gitrepo.freebsd.org> Subject: Re: git: 7266121ce985 - main - ure: improve transmit checksum offloading List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_3440_1109492966.1770653767420" X-Mailer: Realworks (782.55) Importance: Normal X-Priority: 3 (Normal) X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:51088, ipnet:31.134.200.0/21, country:NL] X-Rspamd-Queue-Id: 4f8qZ74Y4Nz3LmQ X-Spamd-Bar: ---- ------=_Part_3440_1109492966.1770653767420 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Thanks, I noticed this last week and was still investigating when I saw this commit. TCP/IPv6 works fine now. ure0 on uhub1 ure0: on usbus1 ue0: on ure0 This is plugged into a Raspberry Pi 5. Thanks. Ronald. Van: Michael Tuexen Datum: zondag, 8 februari 2026 21:16 Aan: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Onderwerp: git: 7266121ce985 - main - ure: improve transmit checksum offloading > > The branch main has been updated by tuexen: > > URL: https://cgit.FreeBSD.org/src/commit/?id=7266121ce985a1a895441357c20b0e9d56b4e5f5 > > commit 7266121ce985a1a895441357c20b0e9d56b4e5f5 > Author: Michael Tuexen > AuthorDate: 2026-02-08 20:11:18 +0000 > Commit: Michael Tuexen > CommitDate: 2026-02-08 20:16:20 +0000 > > ure: improve transmit checksum offloading > > Apparently, the name of the variable l4off was correct. Providing the > offset to the TCP or UDP header allows the transmit checksum offload to > work for TCP/IPv4, TCP/IPv6, UDP/IPv4, and UDP/IPv6. > > Reported by: vishwin > Reviewed by: vishwin > MFC after: 1 week > Differential Revision: https://reviews.freebsd.org/D55187 > --- > sys/dev/usb/net/if_ure.c | 16 ++++++++++------ > 1 file changed, 10 insertions(+), 6 deletions(-) > > diff --git a/sys/dev/usb/net/if_ure.c b/sys/dev/usb/net/if_ure.c > index 3dea88eb10f1..92160fe9b1d2 100644 > --- a/sys/dev/usb/net/if_ure.c > +++ b/sys/dev/usb/net/if_ure.c > @@ -24,6 +24,8 @@ > * SUCH DAMAGE. > */ > > +#include "opt_inet6.h" > + > #include > #include > #include > @@ -44,6 +46,10 @@ > /* needed for checksum offload */ > #include > #include > +#ifdef INET6 > +#include > +#include > +#endif > > #include > #include > @@ -62,8 +68,6 @@ > > #include "miibus_if.h" > > -#include "opt_inet6.h" > - > #ifdef USB_DEBUG > static int ure_debug = 0; > > @@ -2179,7 +2183,6 @@ ure_txcsum(struct mbuf *m, int caps, uint32_t *regout) > struct ip ip; > struct ether_header *eh; > int flags; > - uint32_t data; > uint32_t reg; > int l3off, l4off; > uint16_t type; > @@ -2214,10 +2217,9 @@ ure_txcsum(struct mbuf *m, int caps, uint32_t *regout) > if (flags & CSUM_IP) > reg |= URE_TXPKT_IPV4_CS; > > - data = m->m_pkthdr.csum_data; > if (flags & (CSUM_IP_TCP | CSUM_IP_UDP)) { > m_copydata(m, l3off, sizeof ip, (caddr_t)&ip); > - l4off = l3off + (ip.ip_hl << 2) + data; > + l4off = l3off + (ip.ip_hl << 2); > if (__predict_false(l4off > URE_L4_OFFSET_MAX)) > return (1); > > @@ -2230,7 +2232,9 @@ ure_txcsum(struct mbuf *m, int caps, uint32_t *regout) > } > #ifdef INET6 > else if (flags & (CSUM_IP6_TCP | CSUM_IP6_UDP)) { > - l4off = l3off + data; > + l4off = ip6_lasthdr(m, l3off, IPPROTO_IPV6, NULL); > + if (__predict_false(l4off < 0)) > + return (1); > if (__predict_false(l4off > URE_L4_OFFSET_MAX)) > return (1); > > > > > ------=_Part_3440_1109492966.1770653767420 Content-Type: text/html; charset=us-ascii Content-Transfer-Encoding: 7bit Thanks,

I noticed this last week and was still investigating when I saw this commit. TCP/IPv6 works fine now.

ure0 on uhub1
ure0: <Realtek USB 10/100/1G/2.5G LAN, class 0/0, rev 3.20/31.04, addr 1> on usbus1
ue0: <USB Ethernet> on ure0

This is plugged into a Raspberry Pi 5.

Thanks.

Ronald.

 

Van: Michael Tuexen <tuexen@FreeBSD.org>
Datum: zondag, 8 februari 2026 21:16
Aan: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Onderwerp: git: 7266121ce985 - main - ure: improve transmit checksum offloading

The branch main has been updated by tuexen:

URL: https://cgit.FreeBSD.org/src/commit/?id=7266121ce985a1a895441357c20b0e9d56b4e5f5

commit 7266121ce985a1a895441357c20b0e9d56b4e5f5
Author:     Michael Tuexen <tuexen@FreeBSD.org>
AuthorDate: 2026-02-08 20:11:18 +0000
Commit:     Michael Tuexen <tuexen@FreeBSD.org>
CommitDate: 2026-02-08 20:16:20 +0000

    ure: improve transmit checksum offloading
    
    Apparently, the name of the variable l4off was correct. Providing the
    offset to the TCP or UDP header allows the transmit checksum offload to
    work for TCP/IPv4, TCP/IPv6, UDP/IPv4, and UDP/IPv6.
    
    Reported by:            vishwin
    Reviewed by:            vishwin
    MFC after:              1 week
    Differential Revision:  https://reviews.freebsd.org/D55187
---
 sys/dev/usb/net/if_ure.c | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/sys/dev/usb/net/if_ure.c b/sys/dev/usb/net/if_ure.c
index 3dea88eb10f1..92160fe9b1d2 100644
--- a/sys/dev/usb/net/if_ure.c
+++ b/sys/dev/usb/net/if_ure.c
@@ -24,6 +24,8 @@
  * SUCH DAMAGE.
  */
 
+#include "opt_inet6.h"
+
 #include <sys/param.h>
 #include <sys/systm.h>
 #include <sys/bus.h>
@@ -44,6 +46,10 @@
 /* needed for checksum offload */
 #include <netinet/in.h>
 #include <netinet/ip.h>
+#ifdef INET6
+#include <netinet/ip6.h>
+#include <netinet6/ip6_var.h>
+#endif
 
 #include <dev/mii/mii.h>
 #include <dev/mii/miivar.h>
@@ -62,8 +68,6 @@
 
 #include "miibus_if.h"
 
-#include "opt_inet6.h"
-
 #ifdef USB_DEBUG
 static int ure_debug = 0;
 
@@ -2179,7 +2183,6 @@ ure_txcsum(struct mbuf *m, int caps, uint32_t *regout)
    struct ip ip;
    struct ether_header *eh;
    int flags;
-   uint32_t data;
    uint32_t reg;
    int l3off, l4off;
    uint16_t type;
@@ -2214,10 +2217,9 @@ ure_txcsum(struct mbuf *m, int caps, uint32_t *regout)
    if (flags & CSUM_IP)
        reg |= URE_TXPKT_IPV4_CS;
 
-   data = m->m_pkthdr.csum_data;
    if (flags & (CSUM_IP_TCP | CSUM_IP_UDP)) {
        m_copydata(m, l3off, sizeof ip, (caddr_t)&ip);
-       l4off = l3off + (ip.ip_hl << 2) + data;
+       l4off = l3off + (ip.ip_hl << 2);
        if (__predict_false(l4off > URE_L4_OFFSET_MAX))
            return (1);
 
@@ -2230,7 +2232,9 @@ ure_txcsum(struct mbuf *m, int caps, uint32_t *regout)
    }
 #ifdef INET6
    else if (flags & (CSUM_IP6_TCP | CSUM_IP6_UDP)) {
-       l4off = l3off + data;
+       l4off = ip6_lasthdr(m, l3off, IPPROTO_IPV6, NULL);
+       if (__predict_false(l4off < 0))
+           return (1);
        if (__predict_false(l4off > URE_L4_OFFSET_MAX))
            return (1);
 
 


  ------=_Part_3440_1109492966.1770653767420--