Re: [PATCH net-next] net: stmmac: xgmac: Report the VLAN tag type from the descriptor

From: Muhammad Nazim Amirul Nazle Asmade

Date: Fri Nov 20 2026 - 12:13:52 EST


On 19/11/2026 4:09 am, Nicolai Buchwitz wrote:
> [You don't often get email from nb@xxxxxxxxxxx. Learn why this is
> important at https://aka.ms/LearnAboutSenderIdentification ]
>
> 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.
>
> Anyway:
>
> Reviewed-by: Nicolai Buchwitz <nb@xxxxxxxxxxx>
>
> Thanks,
> Nicolai
Tested and working fine on my end with Agilex5

Tested-by: Nazim Amirul <muhammad.nazim.amirul.nazle.asmade@xxxxxxxxxx>