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

Maxime Chevallier maxime.chevallier at bootlin.com
Fri Nov 20 23:46:37 PST 2026



On 11/21/26 01:46, Jakub Kicinski wrote:
> On Wed, 18 Nov 2026 17:21:34 +0100 Maxime Chevallier wrote:
>> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_vlan.c
>> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_vlan.c
>> @@ -209,8 +209,12 @@ static void vlan_rx_hw(struct mac_device_info *hw,
>>  {
>>  	if (hw->desc->get_rx_vlan_valid(rx_desc)) {
>>  		u16 vid = hw->desc->get_rx_vlan_tci(rx_desc);
>> +		u16 proto = ETH_P_8021Q;
>>  
>> -		__vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), vid);
>> +		if (hw->desc->get_rx_vlan_proto)
>> +			proto = hw->desc->get_rx_vlan_proto(rx_desc);
>> +
>> +		__vlan_hwaccel_put_tag(skb, htons(proto), vid);
> 
> Heh, this function now does 3 indirect calls to get the info about 
> the stripped vlan. Isn't this slower than disabling the offload and
> stripping in SW at this point? Maybe the low-end CPUs are very
> different :) Or there's something else I'm missing?

We'll do like the rest of the driver and hide these indirections with
a nasty macro :)

(jk, but TBH I can't test that one at more than 1Gbps, it's very likely
there's ton of room for optimisation...)

Maxime




More information about the linux-arm-kernel mailing list