Re: [PATCH net-next] net: stmmac: xgmac: Report the VLAN tag type from the descriptor
From: Maxime Chevallier
Date: Thu Nov 19 2026 - 02:36:59 EST
HI,
On 11/18/26 21:09, Nicolai Buchwitz wrote:
> Hi Maxime
>
> On 18.11.2026 17:21, Maxime Chevallier wrote:
>> Stmmac's double VLAN handling hasn't been working great for a while,
>> it's been recently reworked for dwmac4 by Ovidiu Panait. In that work,
>> it was found that the tag stripping hardcodes the 8021Q tag type for
>> XGMAC while stripping the tag, while the IP actually reports the outer
>> tag type in the descriptor.
>>
>> The tag type can be one of 6 different values (note inner/outer is
>> reversed in the macro names):
>>
>> - XGMAC_ET_LT_VLAN_STAG single S-tag
>> - XGMAC_ET_LT_VLAN_CTAG single C-tag
>> - XGMAC_ET_LT_DVLAN_CTAG_CTAG outer C-tag, inner C-tag
>> - XGMAC_ET_LT_DVLAN_STAG_STAG outer S-tag, inner S-tag
>> - XGMAC_ET_LT_DVLAN_CTAG_STAG outer S-tag, inner C-tag
>> - XGMAC_ET_LT_DVLAN_STAG_CTAG outer C-tag, inner S-tag
>>
>> Report that tag type through a dedicated desc ops and report it to the
>> stack.
>>
>> We keep the 8021Q fallback when we don't have the ops, as we don't
>> set NETIF_F_HW_VLAN_STAG_FILTER on the cores that don't support that.
>>
>> This has been tested on AgileX5 with the vlan.py selftest.
>>
>> Signed-off-by: Maxime Chevallier <maxime.chevallier@xxxxxxxxxxx>
>
> Isn't this a fix too? I mean xgmac advertises STAG_RX but still
> reports S-tags as 802.1Q. Then again nobody seems to have hit it
> so far, so net-next is probably fine.
Yeah not only was this discovered while working on something else, it
seems no-one noticed and it's always been broken... I wanted to avoid
spamming net too much, both options are fine for me TBH,
Thanks for the review :)
Maxime
>
> Anyway:
>
> Reviewed-by: Nicolai Buchwitz <nb@xxxxxxxxxxx>
>
> Thanks,
> Nicolai