From: Ido Schimmel <idosch(a)mellanox.com>
In kernel 4.14 capable drivers started to provide offload indication on
a per-nexthop basis, so we need to parse these flags as well.
Signed-off-by: Ido Schimmel <idosch(a)mellanox.com>
Signed-off-by: Yuval Mintz <yuvalm(a)mellanox.com>
---
lnst/Slave/NetTestSlave.py | 4 ++--
recipes/switchdev/l3-007-ecmp-maxsize.py | 6 +++---
recipes/switchdev/l3-008-routes_stress.py | 2 +-
3 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/lnst/Slave/NetTestSlave.py b/lnst/Slave/NetTestSlave.py
index 1626a38..4561492 100644
--- a/lnst/Slave/NetTestSlave.py
+++ b/lnst/Slave/NetTestSlave.py
@@ -802,10 +802,10 @@ class SlaveMethods:
for nh_route_match in nh_route_matchs:
nexthop = { "ip" : nh_route_match[1],
"dev" : nh_route_match[2],
- "flags" : ""}
+ "flags" : nh_route_match[3]}
nh_route = {"prefix" : nh_route_match[0],
"nexthops": [ nexthop ],
- "flags" : nh_route_match[3] }
+ "flags" : ""}
nh_routes.append(nh_route)
# parse ECMP routes
diff --git a/recipes/switchdev/l3-007-ecmp-maxsize.py
b/recipes/switchdev/l3-007-ecmp-maxsize.py
index 794030e..f6c477a 100644
--- a/recipes/switchdev/l3-007-ecmp-maxsize.py
+++ b/recipes/switchdev/l3-007-ecmp-maxsize.py
@@ -40,9 +40,9 @@ def do_task(ctl, hosts, ifaces, aliases):
if len(nh_routes) != 1:
tl.custom(sw, "route", "could not find the ecmp route")
- route_flags = nh_routes[0]["flags"]
- if "offload" not in route_flags:
- tl.custom(sw, "route", "ecmp route is not offloaded")
+ for nh in nh_routes[0]["nexthops"]:
+ if "offload" not in nh["flags"]:
+ tl.custom(sw, "route", "ecmp route is not offloaded")
do_task(ctl, [ctl.get_host("machine1"),
ctl.get_host("switch"),
diff --git a/recipes/switchdev/l3-008-routes_stress.py
b/recipes/switchdev/l3-008-routes_stress.py
index 2187cd2..69738dd 100644
--- a/recipes/switchdev/l3-008-routes_stress.py
+++ b/recipes/switchdev/l3-008-routes_stress.py
@@ -97,7 +97,7 @@ def do_task(ctl, hosts, ifaces, aliases):
dc_routes, nh_routes = sw.get_routes()
offloaded_routes_num = 0
for nh_route in nh_routes:
- if "offload" in nh_route["flags"]:
+ if "offload" in nh_route["nexthops"][0]["flags"]:
offloaded_routes_num += 1
if offloaded_routes_num < ROUTES_COUNT:
--
2.4.3