net: stmmac: Add support for HW-accelerated VLAN stripping
authorGan, Yi Fang <yi.fang.gan@intel.com>
Tue, 21 Nov 2023 05:38:42 +0000 (13:38 +0800)
committerDavid S. Miller <davem@davemloft.net>
Wed, 22 Nov 2023 10:54:14 +0000 (10:54 +0000)
commit750011e239a50873251c16207b0fe78eabf8577e
tree94e16234cef54d99ec1193e91b83deec59fe0977
parent36b20fcdd9663ced36d3aef96f0eff8eb79de4b8
net: stmmac: Add support for HW-accelerated VLAN stripping

Current implementation supports driver level VLAN tag stripping only.
The features is always on if CONFIG_VLAN_8021Q is enabled in kernel
config and is not user configurable.

This patch add support to MAC level VLAN tag stripping and can be
configured through ethtool. If the rx-vlan-offload is off, the VLAN tag
will be stripped by driver. If the rx-vlan-offload is on, the VLAN tag
will be stripped by MAC.

Command: ethtool -K <interface> rx-vlan-offload off | on

Signed-off-by: Lai Peter Jun Ann <jun.ann.lai@intel.com>
Signed-off-by: Gan, Yi Fang <yi.fang.gan@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/stmicro/stmmac/common.h
drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c
drivers/net/ethernet/stmicro/stmmac/dwmac4_descs.c
drivers/net/ethernet/stmicro/stmmac/hwif.h
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c