Skip to content

Commit

Permalink
Recipes/ENRT: extend some recipes with config mixins
Browse files Browse the repository at this point in the history
Signed-off-by: Jan Tluka <[email protected]>
  • Loading branch information
jtluka committed Jan 5, 2024
1 parent 9ab0214 commit d1fc5eb
Show file tree
Hide file tree
Showing 4 changed files with 96 additions and 17 deletions.
22 changes: 18 additions & 4 deletions lnst/Recipes/ENRT/GeneveTunnelRecipe.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,14 @@
)
from lnst.Recipes.ENRT.BaseTunnelRecipe import BaseTunnelRecipe
from lnst.Recipes.ENRT.BaseEnrtRecipe import EnrtConfiguration
from lnst.Recipes.ENRT.ConfigMixins.CommonHWSubConfigMixin import CommonHWSubConfigMixin
from lnst.Recipes.ENRT.ConfigMixins.OffloadSubConfigMixin import (
OffloadSubConfigMixin,
)
from lnst.Recipes.ENRT.ConfigMixins.PauseFramesHWConfigMixin import (
PauseFramesHWConfigMixin,
)


class GeneveTunnelRecipe(
PauseFramesHWConfigMixin, OffloadSubConfigMixin, BaseTunnelRecipe
CommonHWSubConfigMixin, OffloadSubConfigMixin, BaseTunnelRecipe
):
"""
This class implements a recipe that configures a simple Geneve tunnel
Expand Down Expand Up @@ -202,3 +200,19 @@ def offload_nics(self):
@property
def pause_frames_dev_list(self):
return [self.matched.host1.eth0, self.matched.host2.eth0]

@property
def mtu_hw_config_dev_list(self):
return [self.matched.host1.gnv_tunnel, self.matched.host2.gnv_tunnel]

@property
def coalescing_hw_config_dev_list(self):
return [self.matched.host1.eth0, self.matched.host2.eth0]

@property
def dev_interrupt_hw_config_dev_list(self):
return [self.matched.host1.eth0, self.matched.host2.eth0]

@property
def parallel_stream_qdisc_hw_config_dev_list(self):
return [self.matched.host1.eth0, self.matched.host2.eth0]
21 changes: 14 additions & 7 deletions lnst/Recipes/ENRT/GreTunnelRecipe.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,14 @@
from lnst.RecipeCommon.PacketAssert import PacketAssertConf
from lnst.Recipes.ENRT.BaseTunnelRecipe import BaseTunnelRecipe
from lnst.Recipes.ENRT.BaseEnrtRecipe import EnrtConfiguration
from lnst.Recipes.ENRT.ConfigMixins.MTUHWConfigMixin import (
MTUHWConfigMixin,
)
from lnst.Recipes.ENRT.ConfigMixins.CommonHWSubConfigMixin import CommonHWSubConfigMixin
from lnst.Recipes.ENRT.ConfigMixins.OffloadSubConfigMixin import (
OffloadSubConfigMixin,
)
from lnst.Recipes.ENRT.ConfigMixins.PauseFramesHWConfigMixin import (
PauseFramesHWConfigMixin,
)


class GreTunnelRecipe(
MTUHWConfigMixin, PauseFramesHWConfigMixin, OffloadSubConfigMixin, BaseTunnelRecipe
CommonHWSubConfigMixin, OffloadSubConfigMixin, BaseTunnelRecipe
):
"""
This class implements a recipe that configures a simple GRE tunnel between
Expand Down Expand Up @@ -198,3 +193,15 @@ def pause_frames_dev_list(self):
@property
def mtu_hw_config_dev_list(self):
return [self.matched.host1.gre_tunnel, self.matched.host2.gre_tunnel]

@property
def coalescing_hw_config_dev_list(self):
return [self.matched.host1.eth0, self.matched.host2.eth0]

@property
def dev_interrupt_hw_config_dev_list(self):
return [self.matched.host1.eth0, self.matched.host2.eth0]

@property
def parallel_stream_qdisc_hw_config_dev_list(self):
return [self.matched.host1.eth0, self.matched.host2.eth0]
36 changes: 33 additions & 3 deletions lnst/Recipes/ENRT/LinuxBridgeOverBondRecipe.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from collections.abc import Collection
from lnst.Common.Parameters import (
Param,
IntParam,
StrParam,
IPv4NetworkParam,
Expand All @@ -12,13 +13,16 @@
from lnst.Recipes.ENRT.BaremetalEnrtRecipe import BaremetalEnrtRecipe
from lnst.RecipeCommon.Ping.PingEndpoints import PingEndpoints
from lnst.Recipes.ENRT.BaseEnrtRecipe import EnrtConfiguration
from lnst.Recipes.ENRT.ConfigMixins.MTUHWConfigMixin import MTUHWConfigMixin
from lnst.Recipes.ENRT.ConfigMixins.CommonHWSubConfigMixin import CommonHWSubConfigMixin
from lnst.Recipes.ENRT.ConfigMixins.OffloadSubConfigMixin import (
OffloadSubConfigMixin,
)
from lnst.Devices import BondDevice, BridgeDevice
from lnst.Devices.BridgeDevice import BridgeDevice as BridgeDeviceType
from lnst.Devices.BondDevice import BondDevice as BondDeviceType


class LinuxBridgeOverBondRecipe(MTUHWConfigMixin, BaremetalEnrtRecipe):
class LinuxBridgeOverBondRecipe(CommonHWSubConfigMixin, OffloadSubConfigMixin, BaremetalEnrtRecipe):
"""
This recipe implements Enrt testing for a network scenario that looks
as follows
Expand All @@ -44,6 +48,9 @@ class LinuxBridgeOverBondRecipe(MTUHWConfigMixin, BaremetalEnrtRecipe):
The actual test machinery is implemented in the :any:`BaseEnrtRecipe` class.
"""
offload_combinations = Param(
default=(dict(gro="on", gso="on", tso="on", tx="on"),)
)

host1 = HostReq()
host1.eth0 = DeviceReq(label="net1", driver=RecipeParam("driver"))
Expand Down Expand Up @@ -166,5 +173,28 @@ def generate_perf_endpoints(self, config: EnrtConfiguration) -> list[Collection[
return [ip_endpoint_pairs(config, (self.matched.host1.br0, self.matched.host2.br0))]

@property
def mtu_hw_config_dev_list(self):
def pause_frames_dev_list(self):
return [self.matched.host1.eth0, self.matched.host2.eth0]

@property
def offload_nics(self):
return [self.matched.host1.bond0, self.matched.host2.bond0]

@property
def mtu_hw_config_dev_list(self):
return [self.matched.host1.bond0, self.matched.host2.bond0]

@property
def coalescing_hw_config_dev_list(self):
host1, host2 = self.matched.host1, self.matched.host2
return [host1.eth0, host1.eth1, host2.eth0, host2.eth1]

@property
def dev_interrupt_hw_config_dev_list(self):
host1, host2 = self.matched.host1, self.matched.host2
return [host1.eth0, host1.eth1, host2.eth0, host2.eth1]

@property
def parallel_stream_qdisc_hw_config_dev_list(self):
host1, host2 = self.matched.host1, self.matched.host2
return [host1.eth0, host1.eth1, host2.eth0, host2.eth1]
34 changes: 31 additions & 3 deletions lnst/Recipes/ENRT/LinuxBridgeRecipe.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
from collections.abc import Collection
from lnst.Common.Parameters import IPv4NetworkParam, IPv6NetworkParam
from lnst.Common.Parameters import IPv4NetworkParam, IPv6NetworkParam, Param
from lnst.Common.IpAddress import interface_addresses
from lnst.Controller import HostReq, DeviceReq, RecipeParam
from lnst.RecipeCommon.endpoints import EndpointPair, IPEndpoint
from lnst.Recipes.ENRT.helpers import ip_endpoint_pairs
from lnst.Recipes.ENRT.BaremetalEnrtRecipe import BaremetalEnrtRecipe
from lnst.RecipeCommon.Ping.PingEndpoints import PingEndpoints
from lnst.Recipes.ENRT.BaseEnrtRecipe import EnrtConfiguration
from lnst.Recipes.ENRT.ConfigMixins.MTUHWConfigMixin import MTUHWConfigMixin
from lnst.Recipes.ENRT.ConfigMixins.CommonHWSubConfigMixin import CommonHWSubConfigMixin
from lnst.Recipes.ENRT.ConfigMixins.OffloadSubConfigMixin import (
OffloadSubConfigMixin,
)
from lnst.Devices import BridgeDevice


class LinuxBridgeRecipe(MTUHWConfigMixin, BaremetalEnrtRecipe):
class LinuxBridgeRecipe(CommonHWSubConfigMixin, OffloadSubConfigMixin, BaremetalEnrtRecipe):
"""
This recipe implements Enrt testing for a simple network scenario that looks
as follows
Expand All @@ -34,6 +37,11 @@ class LinuxBridgeRecipe(MTUHWConfigMixin, BaremetalEnrtRecipe):
The actual test machinery is implemented in the :any:`BaseEnrtRecipe` class.
"""
offload_combinations = Param(
default=(
dict(gro="on", gso="on", tso="on", tx="on", rx="on"),
)
)

host1 = HostReq()
host1.eth0 = DeviceReq(label="net1", driver=RecipeParam("driver"))
Expand Down Expand Up @@ -130,6 +138,26 @@ def generate_perf_endpoints(self, config: EnrtConfiguration) -> list[Collection[
"""
return [ip_endpoint_pairs(config, (self.matched.host1.br0, self.matched.host2.br0))]

@property
def pause_frames_dev_list(self):
return [self.matched.host1.eth0, self.matched.host2.eth0]

@property
def offload_nics(self):
return [self.matched.host1.eth0, self.matched.host2.eth0]

@property
def mtu_hw_config_dev_list(self):
return [self.matched.host1.eth0, self.matched.host2.eth0]

@property
def coalescing_hw_config_dev_list(self):
return [self.matched.host1.eth0, self.matched.host2.eth0]

@property
def dev_interrupt_hw_config_dev_list(self):
return [self.matched.host1.eth0, self.matched.host2.eth0]

@property
def parallel_stream_qdisc_hw_config_dev_list(self):
return [self.matched.host1.eth0, self.matched.host2.eth0]

0 comments on commit d1fc5eb

Please sign in to comment.