From: Christos Sfakianakis <csfakian(a)redhat.com>
Add checks related to UDP/SCTP that are present in the old recipes.
In particular, skip ('gro', 'off') offload setting with UDP perf
tests. Also, allow only 'gso' option to be set to 'off' with SCTP.
Finally, make sure SCTP will go out through the test interfaces
only.
v2:
Skip offload settings which contain 'off' values unless
('gso', 'off') is also contained in them when using SCTP.
Signed-off-by: Christos Sfakianakis <csfakian(a)redhat.com>
---
lnst/Recipes/ENRT/BaseEnrtRecipe.py | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
diff --git a/lnst/Recipes/ENRT/BaseEnrtRecipe.py b/lnst/Recipes/ENRT/BaseEnrtRecipe.py
index 314bf45..d79b386 100644
--- a/lnst/Recipes/ENRT/BaseEnrtRecipe.py
+++ b/lnst/Recipes/ENRT/BaseEnrtRecipe.py
@@ -134,6 +134,12 @@ class BaseEnrtRecipe(PingTestAndEvaluate, PerfRecipe):
client_netns = client_nic.netns
server_netns = server_nic.netns
+ if 'sctp_stream' in self.params.perf_tests:
+ client_netns.run("iptables -I OUTPUT ! -o %s -p sctp -j DROP" %
+ client_nic.name)
+ server_netns.run("iptables -I OUTPUT ! -o %s -p sctp -j DROP" %
+ server_nic.name)
+
ethtool_offload_string = ""
for name, value in sub_config.offload_settings.items():
ethtool_offload_string += " %s %s" % (name, value)
@@ -149,6 +155,12 @@ class BaseEnrtRecipe(PingTestAndEvaluate, PerfRecipe):
client_netns = client_nic.netns
server_netns = server_nic.netns
+ if 'sctp_stream' in self.params.perf_tests:
+ client_netns.run("iptables -D OUTPUT ! -o %s -p sctp -j DROP" %
+ client_nic.name)
+ server_netns.run("iptables -D OUTPUT ! -o %s -p sctp -j DROP" %
+ server_nic.name)
+
ethtool_offload_string = ""
for name, value in sub_config.offload_settings.items():
ethtool_offload_string += " %s %s" % (name, "on")
@@ -195,6 +207,14 @@ class BaseEnrtRecipe(PingTestAndEvaluate, PerfRecipe):
server_bind = server_nic.ips_filter(family=family)[0]
for perf_test in self.params.perf_tests:
+ offload_values = sub_config.offload_settings.values()
+ offload_items = sub_config.offload_settings.items()
+ if ((perf_test == 'udp_stream' and ('gro', 'off')
in offload_items)
+ or
+ (perf_test == 'sctp_stream' and 'off' in
offload_values and
+ ('gso', 'on') in offload_items)):
+ continue
+
flow = PerfFlow(
type = perf_test,
generator = client_netns,
--
2.17.1