[PATCH net v2 2/2] net: stmmac: Consider Tx VLAN offload tag length for maxSDU
G Thomas, Rohan
rohan.g.thomas at altera.com
Thu Sep 25 04:03:21 PDT 2025
Hi Jakub,
On 9/25/2025 4:35 AM, Jakub Kicinski wrote:
> On Wed, 24 Sep 2025 10:24:44 +0530 G Thomas, Rohan wrote:
>>>> 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.
>
> SG, no further concerns.
>
> Please make sure to CC "Ng, Boon Khai" <boon.khai.ng at altera.com>
> who wrote the VLAN support (IIRC).
While testing 802.1AD with XGMAC hardware using a simple ping test, I
observed an unexpected behavior: the hardware appears to insert an
additional 802.1Q CTAG with VLAN ID 0. Despite this, the ping test
functions correctly.
Here’s a snapshot from the pcap captured at the remote end. Outer VLAN
tag used is 100 and inner VLAN tag used is 200.
Frame 1: 110 bytes on wire (880 bits), 110 bytes captured (880 bits)
Ethernet II, Src: <src> (<src>), Dst: <dst> (<dst>)
IEEE 802.1ad, ID: 100
802.1Q Virtual LAN, PRI: 0, DEI: 0, ID: 0(unexpected)
802.1Q Virtual LAN, PRI: 0, DEI: 0, ID: 200
Internet Protocol Version 4, Src: 192.168.4.10, Dst: 192.168.4.11
Internet Control Message Protocol
I’m working with Boon Khai to understand whether this behavior is
expected or SKU-specific.
Any insights will be helpful for us.
Best Regards,
Rohan
More information about the linux-arm-kernel
mailing list