From: Ido Schimmel <idosch(a)mellanox.com>
When using pktgen we must first set the VLAN ID we are going to use
before setting the PCP value in the 802.1Q header.
Signed-off-by: Ido Schimmel <idosch(a)mellanox.com>
---
recipes/switchdev/TestLib.py | 3 +++
1 file changed, 3 insertions(+)
diff --git a/recipes/switchdev/TestLib.py b/recipes/switchdev/TestLib.py
index 5541947..41ade9d 100644
--- a/recipes/switchdev/TestLib.py
+++ b/recipes/switchdev/TestLib.py
@@ -283,6 +283,9 @@ class TestLib:
pktgen_option.append("dst_mac %s" % if2.get_hwaddr())
pktgen_option.append("dst %s" % if2.get_ip(0))
for arg, argval in kwargs.iteritems():
+ if arg == "vlan_id":
+ pktgen_option.insert(0, "{} {}".format(arg, argval))
+ continue
pktgen_option.append("{} {}".format(arg, argval))
if not thread_option:
dev_names = if1.get_devname()
--
2.7.4