Fri, Feb 22, 2019 at 05:39:23PM CET, csfakian(a)redhat.com wrote:
From: Christos Sfakianakis <csfakian(a)redhat.com>
Add 'perf_reverse' parameter to handle from-both-sides
perf scenarios (used in 8 of the old phase 2 recipes).
Signed-off-by: Christos Sfakianakis <csfakian(a)redhat.com>
---
lnst/Recipes/ENRT/BaseEnrtRecipe.py | 44 ++++++++++++++++-------------
1 file changed, 25 insertions(+), 19 deletions(-)
diff --git a/lnst/Recipes/ENRT/BaseEnrtRecipe.py b/lnst/Recipes/ENRT/BaseEnrtRecipe.py
index 84a382c..125b209 100644
--- a/lnst/Recipes/ENRT/BaseEnrtRecipe.py
+++ b/lnst/Recipes/ENRT/BaseEnrtRecipe.py
@@ -83,6 +83,7 @@ class BaseEnrtRecipe(PingTestAndEvaluate, PerfRecipe):
perf_duration = IntParam(default=60)
perf_iterations = IntParam(default=5)
perf_parallel_streams = IntParam(default=1)
+ perf_reverse = BoolParam(default=False)
perf_msg_size = IntParam(default=123)
perf_usr_comment = StrParam(default="")
@@ -192,26 +193,31 @@ class BaseEnrtRecipe(PingTestAndEvaluate, PerfRecipe):
client_bind = client_nic.ips_filter(family=family)[0]
server_bind = server_nic.ips_filter(family=family)[0]
+ flow_ends = [(client_netns, client_bind, server_netns, server_bind)]
+ if self.params.perf_reverse:
+ flow_ends += [(server_netns, server_bind, client_netns, client_bind)]
+
Could you rename {server,client}_netns and {server,client}_bind to
something that won't be confused with the iterators below (client_ns)?
For example, rename it to host1_ns, host1_bind, host2_ns, host2_bind.
That would apply also to client_nic and server_nic variables in the code.
> for perf_test in self.params.perf_tests:
>- flow = PerfFlow(
>- type = perf_test,
>- generator = client_netns,
>- generator_bind = client_bind,
>- receiver = server_netns,
>- receiver_bind = server_bind,
>- msg_size = self.params.perf_msg_size,
>- duration = self.params.perf_duration,
>- parallel_streams = self.params.perf_parallel_streams,
>- cpupin = self.params.perf_intr_cpu
>- )
>-
>- flow_measurement = self.params.net_perf_tool([flow])
>- yield PerfRecipeConf(
>- measurements=[
>- self.params.cpu_perf_tool([client_netns, server_netns]),
>- flow_measurement
>- ],
>- iterations=self.params.perf_iterations)
>+ for client_ns, client_ip, server_ns, server_ip in flow_ends:
>+ flow = PerfFlow(
>+ type = perf_test,
>+ generator = client_ns,
>+ generator_bind = client_ip,
>+ receiver = server_ns,
>+ receiver_bind = server_ip,
>+ msg_size = self.params.perf_msg_size,
>+ duration = self.params.perf_duration,
>+ parallel_streams = self.params.perf_parallel_streams,
>+ cpupin = self.params.perf_intr_cpu
>+ )
>+
>+ flow_measurement = self.params.net_perf_tool([flow])
>+ yield PerfRecipeConf(
>+ measurements=[
>+ self.params.cpu_perf_tool([client_ns, server_ns]),
>+ flow_measurement
>+ ],
>+ iterations=self.params.perf_iterations)
>
> def _pin_dev_interrupts(self, dev, cpu):
> netns = dev.netns
>--
>2.17.1
>_______________________________________________
>LNST-developers mailing list -- lnst-developers(a)lists.fedorahosted.org
>To unsubscribe send an email to lnst-developers-leave(a)lists.fedorahosted.org
>Fedora Code of Conduct:
https://getfedora.org/code-of-conduct.html
>List Guidelines:
https://fedoraproject.org/wiki/Mailing_list_guidelines
>List Archives:
https://lists.fedorahosted.org/archives/list/lnst-developers@lists.fedora...