From: Christos Sfakianakis csfakian@redhat.com
This patch set enables perf tests to be done from both sides. The main reason for this is that this feature is used in 8 cases from phase 2: - active_backup_team - round_robin_team - active_backup_double_team - round_robin_double_team - acive_backup_team_vs_active_backup_bond - acive_backup_team_vs_round_robin_bond - round_robin_team_vs_active_backup_bond - round_robin_team_vs_round_robin_bond
A suitable parameter is added in BaseEnrtRecipe as well as in TeamRecipe, TeamVsBondRecipe, DoubleTeamRecipe files.
In the old recipes, all perf tests from one side are completed before client/server roles are inverted. In the current patch, that order is not preserved (this should not affect the results).
Christos Sfakianakis (2): lnst.Recipes.ENRT: edit BaseEnrtRecipe lnst.Recipes.ENRT: enable bidirectional perfs
lnst/Recipes/ENRT/BaseEnrtRecipe.py | 44 +++++++++++++++------------ lnst/Recipes/ENRT/DoubleTeamRecipe.py | 3 +- lnst/Recipes/ENRT/TeamRecipe.py | 3 +- lnst/Recipes/ENRT/TeamVsBondRecipe.py | 3 +- 4 files changed, 31 insertions(+), 22 deletions(-)
From: Christos Sfakianakis csfakian@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@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)] + 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
Fri, Feb 22, 2019 at 05:39:23PM CET, csfakian@redhat.com wrote:
From: Christos Sfakianakis csfakian@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@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@lists.fedorahosted.org To unsubscribe send an email to lnst-developers-leave@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.fedorahos...
----- Original Message -----
From: "Jan Tluka" jtluka@redhat.com To: csfakian@redhat.com Cc: lnst-developers@lists.fedorahosted.org Sent: Monday, February 25, 2019 8:57:59 AM Subject: Re: [PATCH-next 1/2] lnst.Recipes.ENRT: edit BaseEnrtRecipe
Fri, Feb 22, 2019 at 05:39:23PM CET, csfakian@redhat.com wrote:
From: Christos Sfakianakis csfakian@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@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.
Sure, after I get Ondrej's comment on the patch, I can rename these as you suggested.
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@lists.fedorahosted.org To unsubscribe send an email to lnst-developers-leave@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.fedorahos...
On Fri, Feb 22, 2019 at 05:39:23PM +0100, csfakian@redhat.com wrote:
From: Christos Sfakianakis csfakian@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@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)]
I think a better option would be to create a "reverse_flow" help method that will accept a PerfFlow object as input and return a new PerfFlow object that has the generator and receivers reversed. Then I'd move the "if self.params.perf_reverse" condition down into the loop after the first "yield" and just do:
if self.params.perf_reverse: reverse_flow(flow) yield ReversedPerfConf(...)
This could also help with the unclear naming of the flow_ends etc...
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@lists.fedorahosted.org To unsubscribe send an email to lnst-developers-leave@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.fedorahos...
----- Original Message -----
From: "Ondrej Lichtner" olichtne@redhat.com To: csfakian@redhat.com Cc: lnst-developers@lists.fedorahosted.org Sent: Wednesday, February 27, 2019 12:02:10 PM Subject: Re: [PATCH-next 1/2] lnst.Recipes.ENRT: edit BaseEnrtRecipe
On Fri, Feb 22, 2019 at 05:39:23PM +0100, csfakian@redhat.com wrote:
From: Christos Sfakianakis csfakian@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@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)]
I think a better option would be to create a "reverse_flow" help method that will accept a PerfFlow object as input and return a new PerfFlow object that has the generator and receivers reversed. Then I'd move the "if self.params.perf_reverse" condition down into the loop after the first "yield" and just do:
if self.params.perf_reverse: reverse_flow(flow) yield ReversedPerfConf(...)
This could also help with the unclear naming of the flow_ends etc...
Adding a helper method and making the code clearer.
-Christos
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@lists.fedorahosted.org To unsubscribe send an email to lnst-developers-leave@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.fedorahos...
LNST-developers mailing list -- lnst-developers@lists.fedorahosted.org To unsubscribe send an email to lnst-developers-leave@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.fedorahos...
From: Christos Sfakianakis csfakian@redhat.com
Enable perf from both sides in 3 of the recipes to account for this missing feature (it exists in their old variants).
Signed-off-by: Christos Sfakianakis csfakian@redhat.com --- lnst/Recipes/ENRT/DoubleTeamRecipe.py | 3 ++- lnst/Recipes/ENRT/TeamRecipe.py | 3 ++- lnst/Recipes/ENRT/TeamVsBondRecipe.py | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/lnst/Recipes/ENRT/DoubleTeamRecipe.py b/lnst/Recipes/ENRT/DoubleTeamRecipe.py index e10ea79..1dd5899 100644 --- a/lnst/Recipes/ENRT/DoubleTeamRecipe.py +++ b/lnst/Recipes/ENRT/DoubleTeamRecipe.py @@ -2,7 +2,7 @@ Implements scenario similar to regression_tests/phase2/ ({active_backup,round_robin}_double_team.xml + team_test.py) """ -from lnst.Common.Parameters import Param, IntParam, StrParam +from lnst.Common.Parameters import Param, IntParam, StrParam, BoolParam from lnst.Common.IpAddress import ipaddress from lnst.Controller import HostReq, DeviceReq from lnst.Recipes.ENRT.BaseEnrtRecipe import BaseEnrtRecipe, EnrtConfiguration @@ -23,6 +23,7 @@ class DoubleTeamRecipe(BaseEnrtRecipe): dict(gro="on", gso="off", tso="off", tx="on"), dict(gro="on", gso="on", tso="off", tx="off")))
+ perf_reverse = BoolParam(default=True) runner_name = StrParam(mandatory=True)
def test_wide_configuration(self): diff --git a/lnst/Recipes/ENRT/TeamRecipe.py b/lnst/Recipes/ENRT/TeamRecipe.py index 6b95ccd..35bd988 100644 --- a/lnst/Recipes/ENRT/TeamRecipe.py +++ b/lnst/Recipes/ENRT/TeamRecipe.py @@ -2,7 +2,7 @@ Implements scenario similar to regression_tests/phase2/ ({active_backup,round_robin}_team.xml + team_test.py) """ -from lnst.Common.Parameters import Param, IntParam, StrParam +from lnst.Common.Parameters import Param, IntParam, StrParam, BoolParam from lnst.Common.IpAddress import ipaddress from lnst.Controller import HostReq, DeviceReq from lnst.Recipes.ENRT.BaseEnrtRecipe import BaseEnrtRecipe, EnrtConfiguration @@ -22,6 +22,7 @@ class TeamRecipe(BaseEnrtRecipe): dict(gro="on", gso="off", tso="off", tx="on"), dict(gro="on", gso="on", tso="off", tx="off")))
+ perf_reverse = BoolParam(default=True) runner_name = StrParam(mandatory=True)
def test_wide_configuration(self): diff --git a/lnst/Recipes/ENRT/TeamVsBondRecipe.py b/lnst/Recipes/ENRT/TeamVsBondRecipe.py index dfec20e..ed555e0 100644 --- a/lnst/Recipes/ENRT/TeamVsBondRecipe.py +++ b/lnst/Recipes/ENRT/TeamVsBondRecipe.py @@ -3,7 +3,7 @@ Implements scenario similar to regression_tests/phase2/ ({active_backup,round_robin}_team_vs_{active_backup,round_robin} _bond.xml + team_test.py) """ -from lnst.Common.Parameters import Param, IntParam, StrParam +from lnst.Common.Parameters import Param, IntParam, StrParam, BoolParam from lnst.Common.IpAddress import ipaddress from lnst.Controller import HostReq, DeviceReq from lnst.Recipes.ENRT.BaseEnrtRecipe import BaseEnrtRecipe, EnrtConfiguration @@ -25,6 +25,7 @@ class TeamVsBondRecipe(BaseEnrtRecipe): dict(gro="on", gso="off", tso="off", tx="on"), dict(gro="on", gso="on", tso="off", tx="off")))
+ perf_reverse = BoolParam(default=True) runner_name = StrParam(mandatory = True) bonding_mode = StrParam(mandatory = True) miimon_value = IntParam(mandatory = True)
lnst-developers@lists.fedorahosted.org