[PATCH net v6 4/5] net: stmmac: Do not advertise S-VLAN stripping when it is disabled

Maxime Chevallier maxime.chevallier at bootlin.com
Wed Sep 30 14:42:54 PDT 2026


Hi,

On 9/28/26 22:34, Ovidiu Panait wrote:
> C-VLAN and S-VLAN tag stripping are both controlled by the EVLS bit,
> so disabling rx-vlan-offload also disables S-VLAN tag stripping.
> However, rx-vlan-stag-hw-parse keeps being advertised as enabled:
> 
> root at rzv2h-evk:~# ethtool -K end1 rx-vlan-offload off
> root at rzv2h-evk:~# ethtool -k end1 | grep -i vlan
> rx-vlan-offload: off
> tx-vlan-offload: off [fixed]
> rx-vlan-filter: on [fixed]
> vlan-challenged: off [fixed]
> tx-vlan-stag-hw-insert: off [fixed]
> rx-vlan-stag-hw-parse: on [fixed]
> rx-vlan-stag-filter: on [fixed]
> 
> Fix this inconsistency by making NETIF_F_HW_VLAN_STAG_RX follow
> NETIF_F_HW_VLAN_CTAG_RX.
> 
> Fixes: 750011e239a5 ("net: stmmac: Add support for HW-accelerated VLAN stripping")
> Signed-off-by: Ovidiu Panait <ovidiu.panait.rb at renesas.com>

Reviewed-by: Maxime Chevallier <maxime.chevallier at bootlin.com>

Maxime


> ---
> v6 changes: None.
> 
> v5 changes:
> - Rebased on top of the rename patch: used dwmac_is_xmac() instead of
>   the dropped hw_svlan_en flag.
> 
> v4 changes:
> - New patch.
> 
>  drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> index 0d70eb452af7..b007ff120471 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> @@ -6211,6 +6211,13 @@ static netdev_features_t stmmac_fix_features(struct net_device *dev,
>  	if (priv->plat->bugged_jumbo && (dev->mtu > ETH_DATA_LEN))
>  		features &= ~NETIF_F_CSUM_MASK;
>  
> +	if (dwmac_is_xmac(priv->plat->core_type)) {
> +		if (features & NETIF_F_HW_VLAN_CTAG_RX)
> +			features |= NETIF_F_HW_VLAN_STAG_RX;
> +		else
> +			features &= ~NETIF_F_HW_VLAN_STAG_RX;
> +	}
> +
>  	return features;
>  }
>  




More information about the linux-arm-kernel mailing list