Before this commit, the Testlib.pktgen packet's destination MAC address was
determined by the MAC address of the destination port. That cannot be used
when L3 routing is needed, as the destination MAC should be the MAC address
of the gateway.
Make the TestLib.pktgen function more flexible by allowing the caller to
determine the dst_eth.
Signed-off-by: Yotam Gigi <yotamg(a)mellanox.com>
---
recipes/switchdev/TestLib.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/recipes/switchdev/TestLib.py b/recipes/switchdev/TestLib.py
index d6b8fa7..d4c6749 100644
--- a/recipes/switchdev/TestLib.py
+++ b/recipes/switchdev/TestLib.py
@@ -283,8 +283,9 @@ class TestLib:
pktgen_option.append("clone_skb 0")
if "delay" not in kwargs.keys():
pktgen_option.append("delay 0")
+ if "dst_mac" not in kwargs.keys():
+ pktgen_option.append("dst_mac %s" % if2.get_hwaddr())
pktgen_option.append("pkt_size %s" % pkt_size)
- 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":
--
2.8.4