public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next 0/2] selftests: openvswitch: add pop_vlan test
@ 2026-05-01 12:27 Minxi Hou
  2026-05-01 12:27 ` [PATCH 1/2] selftests: openvswitch: add vlan() and encap() flow string parsing Minxi Hou
  2026-05-01 12:27 ` [PATCH 2/2] selftests: openvswitch: add pop_vlan test Minxi Hou
  0 siblings, 2 replies; 3+ messages in thread
From: Minxi Hou @ 2026-05-01 12:27 UTC (permalink / raw)
  To: netdev; +Cc: linux-kselftest, dev, Minxi Hou

This series extends the ovs-dpctl.py flow parser to support vlan() and
encap() match strings, then adds a test for the OVS datapath POP_VLAN
action.

The ovs-dpctl.py flow parser currently cannot express VLAN-tagged flow
matches.  The kernel unconditionally forces an exact match on VLAN TCI
when parsing flow keys, and requires both OVS_KEY_ATTR_VLAN and
OVS_KEY_ATTR_ENCAP for VLAN frame validation.  Without vlan()/encap()
parsing, no VLAN flow match is possible from ovs-dpctl.py.

Patch 1 fixes two pre-existing nla_map type bugs: OVS_KEY_ATTR_VLAN
was mapped to "uint16" instead of the correct big-endian "be16", and
OVS_KEY_ATTR_ENCAP was mapped to "none" instead of "nested".  It then
adds the vlan() and encap() flow string parsers, dpstr() display
support, and proper ovskey instance returns for encap.

Patch 2 adds a test that uses kernel VLAN sub-interfaces to generate
802.1Q tagged frames and verifies pop_vlan via pcap at the egress
veth.  A negative check confirms tagged frames arrive intact without
pop_vlan, then the positive check confirms the tag is stripped.

No regression in the existing OVS selftests.

Signed-off-by: Minxi Hou <houminxi@gmail.com>

Minxi Hou (2):
  selftests: openvswitch: add vlan() and encap() flow string parsing
  selftests: openvswitch: add pop_vlan test

 .../selftests/net/openvswitch/openvswitch.sh  | 132 ++++++++++++
 .../selftests/net/openvswitch/ovs-dpctl.py    | 190 +++++++++++++++++-
 2 files changed, 320 insertions(+), 2 deletions(-)


base-commit: 4baf2415992e3051cb39b831191d12cb7e85ab60
-- 
2.53.0


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-05-01 12:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-01 12:27 [PATCH net-next 0/2] selftests: openvswitch: add pop_vlan test Minxi Hou
2026-05-01 12:27 ` [PATCH 1/2] selftests: openvswitch: add vlan() and encap() flow string parsing Minxi Hou
2026-05-01 12:27 ` [PATCH 2/2] selftests: openvswitch: add pop_vlan test Minxi Hou

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox