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.
Signed-off-by: Christos Sfakianakis <csfakian(a)redhat.com>
---
lnst/Recipes/ENRT/BaseEnrtRecipe.py | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/lnst/Recipes/ENRT/BaseEnrtRecipe.py b/lnst/Recipes/ENRT/BaseEnrtRecipe.py
index ba4ff41..d97902a 100644
--- a/lnst/Recipes/ENRT/BaseEnrtRecipe.py
+++ b/lnst/Recipes/ENRT/BaseEnrtRecipe.py
@@ -132,6 +132,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)
@@ -147,6 +153,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")
@@ -207,6 +219,13 @@ class BaseEnrtRecipe(PingTestAndEvaluate, PerfRecipe):
server_bind = server_nic.ips_filter(family=family)[0]
for perf_test in self.params.perf_tests:
+ offload_pairs = sub_config.offload_settings.items()
+ if ((perf_test == 'udp_stream' and ('gro', 'off')
in offload_pairs)
+ or
+ (perf_test == 'sctp_stream' and not list(val[0] for val in
+ offload_pairs if val[1] == 'off') in [[],
['gso']])):
+ continue
+
flow = PerfFlow(
type = perf_test,
generator = client_netns,
--
2.17.1