From: Ondrej Lichtner <olichtne(a)redhat.com>
Inheriting from the CommonHWConfigMixin automatically includes all the
common configuration, it's descriptions and takes care of
deconfiguration.
We can therefore remove the code that's doing the same thing from the
SimplePerfRecipe.
Signed-off-by: Ondrej Lichtner <olichtne(a)redhat.com>
---
lnst/Recipes/ENRT/SimplePerfRecipe.py | 23 ++++++++---------------
1 file changed, 8 insertions(+), 15 deletions(-)
diff --git a/lnst/Recipes/ENRT/SimplePerfRecipe.py
b/lnst/Recipes/ENRT/SimplePerfRecipe.py
index b5414c8..29c7c2c 100644
--- a/lnst/Recipes/ENRT/SimplePerfRecipe.py
+++ b/lnst/Recipes/ENRT/SimplePerfRecipe.py
@@ -9,10 +9,13 @@
from lnst.Recipes.ENRT.ConfigMixins.OffloadSubConfigMixin import (
OffloadSubConfigMixin,
)
+from lnst.Recipes.ENRT.ConfigMixins.CommonHWConfigMixin import (
+ CommonHWConfigMixin,
+)
class SimplePerfRecipe(
- OffloadSubConfigMixin, BaseEnrtRecipe
+ OffloadSubConfigMixin, CommonHWConfigMixin, BaseEnrtRecipe
):
host1 = HostReq()
host1.eth0 = DeviceReq(label="net1",
driver=RecipeParam("driver"))
@@ -32,10 +35,6 @@ def test_wide_configuration(self):
configuration = super().test_wide_configuration()
configuration.test_wide_devices = []
- if "mtu" in self.params:
- host1.eth0.mtu = self.params.mtu
- host2.eth0.mtu = self.params.mtu
-
host1.eth0.ip_add(ipaddress("192.168.101.1/24"))
host1.eth0.ip_add(ipaddress("fc00::1/64"))
host1.eth0.up()
@@ -46,16 +45,6 @@ def test_wide_configuration(self):
host2.eth0.up()
configuration.test_wide_devices.append(host2.eth0)
- if "adaptive_rx_coalescing" in self.params:
- for host in [host1, host2]:
- host.eth0.adaptive_rx_coalescing = self.params.adaptive_rx_coalescing
- if "adaptive_tx_coalescing" in self.params:
- for host in [host1, host2]:
- host.eth0.adaptive_tx_coalescing = self.params.adaptive_tx_coalescing
-
- if self.params.perf_parallel_streams > 1:
- for host in [host1, host2]:
- host.run("tc qdisc replace dev %s root mq" % host.eth0.name)
return configuration
@@ -83,3 +72,7 @@ def generate_perf_endpoints(self, config):
@property
def offload_nics(self):
return [self.matched.host1.eth0, self.matched.host2.eth0]
+
+ @property
+ def hw_config_dev_list(self):
+ return [self.matched.host1.eth0, self.matched.host2.eth0]
--
2.22.0