[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <a914f668-95b2-4e6d-bd04-01932fe0fe48@altera.com>
Date: Wed, 24 Sep 2025 10:24:44 +0530
From: "G Thomas, Rohan" <rohan.g.thomas@...era.com>
To: Jakub Kicinski <kuba@...nel.org>,
Rohan G Thomas via B4 Relay <devnull+rohan.g.thomas.altera.com@...nel.org>
Cc: Andrew Lunn <andrew+netdev@...n.ch>, "David S. Miller"
<davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>,
Paolo Abeni <pabeni@...hat.com>, Maxime Coquelin
<mcoquelin.stm32@...il.com>, Alexandre Torgue
<alexandre.torgue@...s.st.com>, Jose Abreu <Jose.Abreu@...opsys.com>,
Rohan G Thomas <rohan.g.thomas@...el.com>, netdev@...r.kernel.org,
linux-stm32@...md-mailman.stormreply.com,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
Matthew Gerlach <matthew.gerlach@...era.com>,
"Ng, Boon Khai" <boon.khai.ng@...era.com>
Subject: Re: [PATCH net v2 2/2] net: stmmac: Consider Tx VLAN offload tag
length for maxSDU
Hi Jakub,
On 9/18/2025 4:24 AM, Jakub Kicinski wrote:
>>> + sdu_len = skb->len;
>>> + if (has_vlan) {
>>> + /* Add VLAN tag length to sdu length in case of txvlan offload */
>>> + if (priv->dev->features & NETIF_F_HW_VLAN_CTAG_TX)
>>> + sdu_len += VLAN_HLEN;
>>> + if (skb->vlan_proto == htons(ETH_P_8021AD) &&
>>> + priv->dev->features & NETIF_F_HW_VLAN_STAG_TX)
>>> + sdu_len += VLAN_HLEN;
>>
>> Is the device adding the same VLAN tag twice if the proto is 8021AD?
>> It looks like it from the code, but how every strange..
>>
>> In any case, it doesn't look like the driver is doing anything with
>> the NETIF_F_HW_VLAN_* flags right? stmmac_vlan_insert() works purely
>> off of vlan proto. So I think we should do the same thing here?
>
> I suppose the double tagging depends on the exact SKU but first check
> looks unnecessary. Maybe stmmac_vlan_insert() should return the number
> of vlans it decided to insert?
>
I overlooked the behavior of stmmac_vlan_insert(). It seems the hardware
supports inserting only one VLAN tag at a time, with the default setting
being SVLAN for 802.1AD and CVLAN for 802.1Q. I'll update the patch to
simply add VLAN_HLEN when stmmac_vlan_insert() returns true. Please let
me know if you have any further concerns.
Best Regards,
Rohan
Powered by blists - more mailing lists