Re: [PATCH net-next] net: stmmac: xgmac: Report the VLAN tag type from the descriptor
From: Jakub Kicinski
Date: Fri Nov 20 2026 - 19:46:08 EST
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?
(not really expecting you to do any digging, to be clear, just found
the level of complexity in SW to support a trivial HW offload kinda
funny)