Re: [PATCH net v2 6/6] selftests: drv-net: Add VLAN test

From: Andrew Lunn

Date: Sat Aug 22 2026 - 20:05:23 EST


On Fri, Aug 21, 2026 at 05:09:59PM +0000, Ovidiu Panait wrote:
> Add a test that validates ping traffic over VLAN interfaces. It aims
> to catch drivers which mishandle hardware VLAN tag stripping, in
> particular QinQ.
>
> Three VLAN configurations are covered, each with hardware VLAN stripping
> enabled and disabled:
> - a single 802.1q VLAN interface
> - a single 802.1ad VLAN interface
> - an 802.1q VLAN stacked on top of an 802.1ad interface
>
> NETIF=end1 LOCAL_V4=172.16.0.2 REMOTE_V4=172.16.0.3 \
> REMOTE_TYPE=ssh REMOTE_ARGS=root@172.16.0.3 \
> run_kselftest.sh -t drivers/net:vlan.py
> TAP version 13
> 1..1
> # timeout set to 360
> # selftests: drivers/net: vlan.py
> # # Interface: end0, driver: st_gmac
> # TAP version 13
> # 1..6
> # ok 1 vlan.test.8021q_hw
> # ok 2 vlan.test.8021q_sw
> # ok 3 vlan.test.8021ad_hw
> # ok 4 vlan.test.8021ad_sw
> # ok 5 vlan.test.qinq_hw
> # ok 6 vlan.test.qinq_sw
> # # Totals: pass:6 fail:0 xfail:0 xpass:0 skip:0 error:0

> +def _setup(cfg, outer_proto, inner_proto, hw_strip):
> + """Configure VLAN stripping and create the VLAN interfaces."""
> +
> + feat = ethtool(f"-k {cfg.ifname}", json=True)[0]
> + set_ethtool_feat(cfg.ifname, feat, {"rx-vlan-offload": hw_strip})


+ if current[name]["active"] != state:
+ no_change = False
+ if current[name]["fixed"]:
+ raise KsftXfailEx(f"Device does not support {name}")

I'm not too familiar with the self test framework, so i could have
this wrong.

It looks to me like you fail the text if it is fixed. But does not
fixed just mean the hardware does not support it? So i think it should
actually skip the test?

Now, if it does not say fixed, but ethtool -K reports EOPNOTSUPP, that
would be an error.

Having said that, thanks for spending the time to add a test. We need
more tests like this.

Andrew