public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next v2 0/2] selftests: openvswitch: add pop_vlan test
@ 2026-05-01 13:39 Minxi Hou
  2026-05-01 13:39 ` [PATCH net-next v2 1/2] selftests: openvswitch: add vlan() and encap() flow string parsing Minxi Hou
  2026-05-01 13:39 ` [PATCH net-next v2 2/2] selftests: openvswitch: add pop_vlan test Minxi Hou
  0 siblings, 2 replies; 7+ messages in thread
From: Minxi Hou @ 2026-05-01 13:39 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>
---
v1 -> v2: rebase to latest net-next/main, drop --base=auto

v1: https://lore.kernel.org/netdev/20260501122756.3081754-1-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(-)

-- 
2.53.0


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

end of thread, other threads:[~2026-05-04 16:14 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-01 13:39 [PATCH net-next v2 0/2] selftests: openvswitch: add pop_vlan test Minxi Hou
2026-05-01 13:39 ` [PATCH net-next v2 1/2] selftests: openvswitch: add vlan() and encap() flow string parsing Minxi Hou
2026-05-04 15:43   ` Aaron Conole
2026-05-04 15:52     ` 侯敏熙
2026-05-01 13:39 ` [PATCH net-next v2 2/2] selftests: openvswitch: add pop_vlan test Minxi Hou
2026-05-04 15:51   ` Aaron Conole
2026-05-04 16:14     ` 侯敏熙

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