The ping test in ipip_common checks that traffic actually went through
fast path (or, contrary, slow path). But so far it has only looked at
received packes, arbitrarily. However, for asymmetric offloads, each
direction needs to be verified.
Signed-off-by: Petr Machata <petrm(a)mellanox.com>
---
recipes/switchdev/ipip_common.py | 17 ++++++++++-------
1 file changed, 10 insertions(+), 7 deletions(-)
diff --git a/recipes/switchdev/ipip_common.py b/recipes/switchdev/ipip_common.py
index c5bad69..850d650 100644
--- a/recipes/switchdev/ipip_common.py
+++ b/recipes/switchdev/ipip_common.py
@@ -19,7 +19,7 @@ def ping_test(tl, m1, sw, addr, m1_if1, gre,
ipv6=False, ttl=None):
limit = int(0.9 * count)
if gre is not None:
- before_stats = gre.link_stats()["rx_packets"]
+ before_stats = gre.link_stats()
options = {
"addr": addr,
"count": count,
@@ -34,17 +34,20 @@ def ping_test(tl, m1, sw, addr, m1_if1, gre,
m1.run(ping_mod, fail_expected=fail_expected)
if not fail_expected and gre is not None:
- after_stats = gre.link_stats()["rx_packets"]
+ after_stats = gre.link_stats()
- delta = after_stats - before_stats
- if require_fastpath and delta > 10:
+ drx = after_stats["rx_packets"] - before_stats["rx_packets"]
+ dtx = after_stats["tx_packets"] - before_stats["tx_packets"]
+ if require_fastpath and (drx > 10 or dtx > 10):
# Allow a few packets of control plane traffic to go through slow
# path. All the data plane traffic should go through fast path.
tl.custom(sw, "ipip",
- "Too many packets (%d) observed at GRE netdevice" %
delta)
- if require_slowpath and delta < count / 2:
+ "Too many packets (rx:%d, tx:%d) observed at GRE
netdevice"
+ % (drx, dtx))
+ if require_slowpath and (drx < count / 2 and dtx < count / 2):
tl.custom(sw, "ipip",
- "Too few packets (%d) observed at GRE netdevice" %
delta)
+ "Too few packets (rx:%d, tx:%d) observed at GRE
netdevice"
+ % (drx, dtx))
def ipv4(test_ip):
return test_ip[0]
--
2.4.11
Show replies by date