🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: linux.kernel.netdev
4 messages
4 total messages Started by Jan Čermák Thu, 08 Oct 2026 11:35
Re: [REGRESSION][BISECTED] r8169: TX stall with checksum offload on VLAN frames with inline tag (REORDER_HDR off) since 1517d199...
#630
Author: Jan Čermák
Date: Thu, 08 Oct 2026 11:35
70 lines
11942 bytes
Hi Eric,

On Wed, 7 Oct 2026 at 00:00, Eric Dumazet <edumazet@kernel.org> wrote:
> Note to testers:
>
> My LLM agreed with the change in vlan_dev_hard_header() (above), but said
> that no change was needed in vlan_dev_hard_start_xmit() (below)
>

I'll need the patch applied to 6.18.y for testing, as I can't test it
personally and I want to provide testers with the same kernel/system
version as before just with minimal changes. So do I understand
correctly that the patch below is what you want to get tested, no
changes in vlan_dev_hard_start_xmit()?

Regards,
Jan

diff --git a/net/8021q/vlan_dev.c b/net/8021q/vlan_dev.c
index 560521cf596e..67648152add8 100644
--- a/net/8021q/vlan_dev.c
+++ b/net/8021q/vlan_dev.c
@@ -49,42 +49,14 @@ static int vlan_dev_hard_header(struct sk_buff
*skb, struct net_device *dev,
                                unsigned int len)
 {
        struct vlan_dev_priv *vlan = vlan_dev_priv(dev);
-       struct vlan_hdr *vhdr;
-       unsigned int vhdrlen = 0;
-       u16 vlan_tci = 0;
-       int rc;
-
-       if (!(vlan->flags & VLAN_FLAG_REORDER_HDR)) {
-               vhdr = skb_push(skb, VLAN_HLEN);
-
-               vlan_tci = vlan->vlan_id;
-               vlan_tci |= vlan_dev_get_egress_qos_mask(dev, skb->priority);
-               vhdr->h_vlan_TCI = htons(vlan_tci);
-
-               /*
-                *  Set the protocol type. For a packet of type ETH_P_802_3/2 we
-                *  put the length in here instead.
-                */
-               if (type != ETH_P_802_3 && type != ETH_P_802_2)
-                       vhdr->h_vlan_encapsulated_proto = htons(type);
-               else
-                       vhdr->h_vlan_encapsulated_proto = htons(len);
-
-               skb->protocol = vlan->vlan_proto;
-               type = ntohs(vlan->vlan_proto);
-               vhdrlen = VLAN_HLEN;
-       }
+       struct net_device *real_dev = vlan->real_dev;

        /* Before delegating work to the lower layer, enter our MAC-address */
        if (saddr == NULL)
                saddr = dev->dev_addr;

        /* Now make the underlying real hard header */
-       dev = vlan->real_dev;
-       rc = dev_hard_header(skb, dev, type, daddr, saddr, len + vhdrlen);
-       if (rc > 0)
-               rc += vhdrlen;
-       return rc;
+       return dev_hard_header(skb, real_dev, type, daddr, saddr, len);
 }

 static inline netdev_tx_t vlan_netpoll_send_skb(struct vlan_dev_priv
*vlan, struct sk_buff *skb)
Re: [REGRESSION][BISECTED] r8169: TX stall with checksum offload on VLAN frames with inline tag (REORDER_HDR off) since 1517d199...
#669
Author: Eric Dumazet
Date: Thu, 08 Oct 2026 12:48
26 lines
7560 bytes
Le jeu. 8 oct. 2026 à 13:35, Jan Čermák <sairon@sairon.cz> a écrit :
>
> Hi Eric,
>
> On Wed, 7 Oct 2026 at 00:00, Eric Dumazet <edumazet@kernel.org> wrote:
> > Note to testers:
> >
> > My LLM agreed with the change in vlan_dev_hard_header() (above), but said
> > that no change was needed in vlan_dev_hard_start_xmit() (below)
> >
>
> I'll need the patch applied to 6.18.y for testing, as I can't test it
> personally and I want to provide testers with the same kernel/system
> version as before just with minimal changes. So do I understand
> correctly that the patch below is what you want to get tested, no
> changes in vlan_dev_hard_start_xmit()?
>

This is the current patch under review :
https://lore.kernel.org/netdev/20261008123812.554729-1-edumazet@kernel.org/T/#u

Thanks.
Re: [REGRESSION][BISECTED] r8169: TX stall with checksum offload on VLAN frames with inline tag (REORDER_HDR off) since 1517d199...
#695
Author: Jan Čermák
Date: Thu, 08 Oct 2026 13:48
19 lines
10328 bytes
On Thu, 8 Oct 2026 at 14:48, Eric Dumazet <edumazet@kernel.org> wrote:
> This is the current patch under review :
> https://lore.kernel.org/netdev/20261008123812.554729-1-edumazet@kernel.org/T/#u
>
> Thanks.

Oh, I missed that, as GitHub "protected my privacy" and I ended up in
CC with its noreply address (which really leads to /dev/null). I've
applied that patch to our tree and started the build, I'll ask in the
issue tracker for testing once the build finishes and reply in the
patch thread if I get any feedback.

I've disabled the "privacy protection" on GitHub so I hope next time
it shouldn't happen - but just in case you'll be updating the patch,
please use my real address I use here.

Thanks,
Jan
Re: [REGRESSION][BISECTED] r8169: TX stall with checksum offload on VLAN frames with inline tag (REORDER_HDR off) since 1517d199...
#978
Author: Eric Dumazet
Date: Thu, 08 Oct 2026 22:30
83 lines
10261 bytes
Le jeu. 8 oct. 2026 à 15:48, Jan Čermák <sairon@sairon.cz> a écrit :
>
> On Thu, 8 Oct 2026 at 14:48, Eric Dumazet <edumazet@kernel.org> wrote:
> > This is the current patch under review :
> > https://lore.kernel.org/netdev/20261008123812.554729-1-edumazet@kernel.org/T/#u
> >
> > Thanks.
>
> Oh, I missed that, as GitHub "protected my privacy" and I ended up in
> CC with its noreply address (which really leads to /dev/null). I've
> applied that patch to our tree and started the build, I'll ask in the
> issue tracker for testing once the build finishes and reply in the
> patch thread if I get any feedback.
>
> I've disabled the "privacy protection" on GitHub so I hope next time
> it shouldn't happen - but just in case you'll be updating the patch,
> please use my real address I use here.

Sure!

It seems a V3 will be needed, I will send it for review tomorrow after
the 24 hour delay

diff --git a/net/8021q/vlan_dev.c b/net/8021q/vlan_dev.c
index c949c6a829456c2f75d6c514b35a85ff64c493d8..684820c772289f1b73aa01255cc9ae5fadae95a9
100644
--- a/net/8021q/vlan_dev.c
+++ b/net/8021q/vlan_dev.c
@@ -110,6 +110,8 @@ static netdev_tx_t vlan_dev_hard_start_xmit(struct
sk_buff *skb,
        unsigned int len;
        int ret;

+       len = skb->len;
+
        /* Handle non-VLAN frames if they are sent to us, for example by DHCP.
         *
         * NOTE: THIS ASSUMES DIX ETHERNET, SPECIFICALLY NOT SUPPORTING
@@ -121,10 +123,34 @@ static netdev_tx_t
vlan_dev_hard_start_xmit(struct sk_buff *skb,
                vlan_tci = vlan->vlan_id;
                vlan_tci |= vlan_dev_get_egress_qos_mask(dev, skb->priority);
                __vlan_hwaccel_put_tag(skb, vlan->vlan_proto, vlan_tci);
+       } else if (skb->len >= VLAN_ETH_HLEN + sizeof(__be16) &&
+                  !skb_shared(skb) &&
+                  vlan_hw_offload_capable(READ_ONCE(vlan->real_dev->features),
+                                          vlan->vlan_proto)) {
+               u16 vlan_tci;
+
+               /* The frame carries its outer tag in-band, either inserted
+                * by vlan_dev_hard_header() or provided by the sender.
+                * Let the real device insert it: some NICs can not offload
+                * checksum or TSO for frames carrying an in-band tag.
+                * Not all ndo_start_xmit() callers set the mac header.
+                * vlan_set_encap_proto() may read two bytes after the vlan
+                * header, so shorter frames are sent unchanged, as are
+                * shared skbs (e.g. from pktgen).
+                * On allocation failure, drop the frame rather than handing
+                * it to the real device with an in-band tag.
+                */
+               skb_reset_mac_header(skb);
+               if (unlikely(!pskb_may_pull(skb, VLAN_ETH_HLEN +
sizeof(__be16)) ||
+                            __skb_vlan_pop(skb, &vlan_tci))) {
+                       kfree_skb(skb);
+                       this_cpu_inc(vlan->vlan_pcpu_stats->tx_dropped);
+                       return NETDEV_TX_OK;
+               }
+               __vlan_hwaccel_put_tag(skb, vlan->vlan_proto, vlan_tci);
        }

        skb->dev = vlan->real_dev;
-       len = skb->len;
        if (unlikely(netpoll_tx_running(dev)))
                return vlan_netpoll_send_skb(vlan, skb);
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads