This includes several enhancements for the recently added tunnel recipes.
The L2TPTunnelRecipe is updated to automatically load the l2tp_eth kernel module that is required by the L2TPTunnelManager to function properly. A new parameter carrier_ipversion is added to this recipe.
Rest of the patches adds specific HWConfigMixins to the recipes, to allow mtu, pause frames and offload settings configuration.
Jan Tluka (11): Recipes.ENRT.L2TPTunnelRecipe: load l2tp_eth module before creating the tunnel Recipes.ENRT.L2TPTunnelRecipe: add carrier_ipversion parameter Recipes.ENRT.L2TPTunnelRecipe: add PauseFramesHWConfigMixin Recipes.ENRT.GeneveTunnelRecipe: add OffloadSubConfigMixin and PauseFramesHWConfigMixin Recipes.ENRT.SitTunnelRecipe: add {MTU,PauseFrames}HWConfigMixins Recipes.ENRT.Ip6TnlTunnelRecipe: add {MTU,PauseFrames}HWConfigMixins Recipes.ENRT.IpIpTunnelRecipe: add {MTU,PauseFrames}HWConfigMixins Recipes.ENRT.GreTunnelRecipe: add {MTU,PauseFrames}HWConfigMixins Recipes.ENRT.GreTunnelOverBondRecipe: add {MTU,PauseFrames}HWConfigMixins Recipes.ENRT.Ip6GreNetnsTunnelRecipe.py: add {MTU,PauseFrames}HWConfigMixins Recipes.ENRT.Ip6GreTunnelRecipe.py: add {MTU,PauseFrames}HWConfigMixins
lnst/Recipes/ENRT/GeneveTunnelRecipe.py | 14 +++- lnst/Recipes/ENRT/GreTunnelOverBondRecipe.py | 17 ++++- lnst/Recipes/ENRT/GreTunnelRecipe.py | 19 +++++- lnst/Recipes/ENRT/Ip6GreNetnsTunnelRecipe.py | 19 +++++- lnst/Recipes/ENRT/Ip6GreTunnelRecipe.py | 17 ++++- lnst/Recipes/ENRT/Ip6TnlTunnelRecipe.py | 20 ++++-- lnst/Recipes/ENRT/IpIpTunnelRecipe.py | 14 +++- lnst/Recipes/ENRT/L2TPTunnelRecipe.py | 68 +++++++++++++++----- lnst/Recipes/ENRT/SitTunnelRecipe.py | 14 +++- 9 files changed, 164 insertions(+), 38 deletions(-)
Signed-off-by: Jan Tluka jtluka@redhat.com --- lnst/Recipes/ENRT/L2TPTunnelRecipe.py | 3 +++ 1 file changed, 3 insertions(+)
diff --git a/lnst/Recipes/ENRT/L2TPTunnelRecipe.py b/lnst/Recipes/ENRT/L2TPTunnelRecipe.py index 0a78929d..89a94b29 100755 --- a/lnst/Recipes/ENRT/L2TPTunnelRecipe.py +++ b/lnst/Recipes/ENRT/L2TPTunnelRecipe.py @@ -82,6 +82,9 @@ class L2TPTunnelRecipe(CommonHWSubConfigMixin, BaseTunnelRecipe): endpoint1_ip = endpoint1.ips_filter(**ip_filter)[0] endpoint2_ip = endpoint2.ips_filter(**ip_filter)[0]
+ for host in [host1, host2]: + host.run("modprobe l2tp_eth") + host1.l2tp = host1.init_class(L2TPManager) host2.l2tp = host2.init_class(L2TPManager)
This enables user to specify whether IPv4 or IPv6 should be used for underlying network.
Signed-off-by: Jan Tluka jtluka@redhat.com --- lnst/Recipes/ENRT/L2TPTunnelRecipe.py | 55 ++++++++++++++++++++------- 1 file changed, 41 insertions(+), 14 deletions(-)
diff --git a/lnst/Recipes/ENRT/L2TPTunnelRecipe.py b/lnst/Recipes/ENRT/L2TPTunnelRecipe.py index 89a94b29..044af949 100755 --- a/lnst/Recipes/ENRT/L2TPTunnelRecipe.py +++ b/lnst/Recipes/ENRT/L2TPTunnelRecipe.py @@ -1,5 +1,5 @@ from lnst.Controller import HostReq, DeviceReq, RecipeParam -from lnst.Common.IpAddress import AF_INET +from lnst.Common.IpAddress import AF_INET, AF_INET6 from lnst.Common.Parameters import ChoiceParam, StrParam from lnst.RecipeCommon.L2TPManager import L2TPManager from lnst.Devices import L2TPSessionDevice @@ -39,9 +39,16 @@ class L2TPTunnelRecipe(CommonHWSubConfigMixin, BaseTunnelRecipe): The test wide configuration is implemented in the :any:`BaseTunnelRecipe` class.
- :param l2tp_encapsulation: - (mandatory test parameter) the encapsulation mode for the L2TP tunnel, - can be either **udp** or **ip** + The recipe provides additional parameter: + + :param carrier_ipversion: + This parameter specifies whether IPv4 or IPv6 addresses are + used for the underlying (carrier) network. The value is either + **ipv4** or **ipv6** + + :param l2tp_encapsulation: + (mandatory test parameter) the encapsulation mode for the L2TP tunnel, + can be either **udp** or **ip** """
host1 = HostReq() @@ -50,6 +57,7 @@ class L2TPTunnelRecipe(CommonHWSubConfigMixin, BaseTunnelRecipe): host2 = HostReq() host2.eth0 = DeviceReq(label="net1", driver=RecipeParam("driver"))
+ carrier_ipversion = ChoiceParam(type=StrParam, choices=set(["ipv4", "ipv6"])) l2tp_encapsulation = ChoiceParam( type=StrParam, choices=set(["udp", "ip"]), mandatory=True ) @@ -63,10 +71,15 @@ class L2TPTunnelRecipe(CommonHWSubConfigMixin, BaseTunnelRecipe): host2 = self.matched.host2
for i, device in enumerate([host1.eth0, host2.eth0]): - device.ip_add("192.168.200." + str(i + 1) + "/24") + if self.params.carrier_ipversion == "ipv4": + device.ip_add("192.168.200." + str(i + 1) + "/24") + else: + device.ip_add("fc00::" + str(i + 1) + "/64") + device.up() configuration.test_wide_devices.append(device)
+ self.wait_tentative_ips(configuration.test_wide_devices) configuration.tunnel_endpoints = (host1.eth0, host2.eth0)
def create_tunnel(self, configuration): @@ -78,7 +91,11 @@ class L2TPTunnelRecipe(CommonHWSubConfigMixin, BaseTunnelRecipe): endpoint1, endpoint2 = configuration.tunnel_endpoints host1 = endpoint1.netns host2 = endpoint2.netns - ip_filter = {"family": AF_INET} + if self.params.carrier_ipversion == "ipv4": + ip_filter = {"family": AF_INET} + else: + ip_filter = {"family": AF_INET6, "is_link_local": False} + endpoint1_ip = endpoint1.ips_filter(**ip_filter)[0] endpoint2_ip = endpoint2.ips_filter(**ip_filter)[0]
@@ -150,7 +167,11 @@ class L2TPTunnelRecipe(CommonHWSubConfigMixin, BaseTunnelRecipe): def get_packet_assert_config(self, ping_config): pa_kwargs = {}
- ip_filter = {"family": AF_INET} + if self.params.carrier_ipversion == "ipv4": + ip_filter = {"family": AF_INET} + else: + ip_filter = {"family": AF_INET6, "is_link_local": False} + m1_carrier = self.matched.host1.eth0 m2_carrier = self.matched.host2.eth0 m1_carrier_ip = m1_carrier.ips_filter(**ip_filter)[0] @@ -161,15 +182,21 @@ class L2TPTunnelRecipe(CommonHWSubConfigMixin, BaseTunnelRecipe): encap ip: 192.168.200.1 > 192.168.200.2: ip-proto-115 106 """
- if self.params.l2tp_encapsulation == 'ip': - pa_kwargs["p_filter"] = "ip proto 115" - grep_pattern = "IP {} > {}:[ ]*ip-proto-115".format( - m1_carrier_ip, m2_carrier_ip + if self.params.l2tp_encapsulation == "ip": + pa_kwargs["p_filter"] = "{} proto 115".format( + "ip" if self.params.carrier_ipversion == "ipv4" else "ip6", + ) + grep_pattern = "{} {} > {}:[ ]*ip-proto-115".format( + "IP" if self.params.carrier_ipversion == "ipv4" else "IP6", + m1_carrier_ip, + m2_carrier_ip, ) - elif self.params.l2tp_encapsulation == 'udp': + elif self.params.l2tp_encapsulation == "udp": pa_kwargs["p_filter"] = "udp" - grep_pattern = "IP {}.[0-9]+ > {}.[0-9]+:[ ]*UDP".format( - m1_carrier_ip, m2_carrier_ip + grep_pattern = "{} {}.[0-9]+ > {}.[0-9]+:[ ]*UDP".format( + "IP" if self.params.carrier_ipversion == "ipv4" else "IP6", + m1_carrier_ip, + m2_carrier_ip, )
pa_kwargs["grep_for"] = [grep_pattern]
Signed-off-by: Jan Tluka jtluka@redhat.com --- lnst/Recipes/ENRT/L2TPTunnelRecipe.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/lnst/Recipes/ENRT/L2TPTunnelRecipe.py b/lnst/Recipes/ENRT/L2TPTunnelRecipe.py index 044af949..874da7ce 100755 --- a/lnst/Recipes/ENRT/L2TPTunnelRecipe.py +++ b/lnst/Recipes/ENRT/L2TPTunnelRecipe.py @@ -6,12 +6,12 @@ from lnst.Devices import L2TPSessionDevice from lnst.RecipeCommon.Ping.PingEndpoints import PingEndpoints from lnst.RecipeCommon.PacketAssert import PacketAssertConf from lnst.Recipes.ENRT.BaseTunnelRecipe import BaseTunnelRecipe -from lnst.Recipes.ENRT.ConfigMixins.CommonHWSubConfigMixin import ( - CommonHWSubConfigMixin, +from lnst.Recipes.ENRT.ConfigMixins.PauseFramesHWConfigMixin import ( + PauseFramesHWConfigMixin, )
-class L2TPTunnelRecipe(CommonHWSubConfigMixin, BaseTunnelRecipe): +class L2TPTunnelRecipe(PauseFramesHWConfigMixin, BaseTunnelRecipe): """ This class implements a recipe that configures a simple L2TP tunnel with one tunnel session between two hosts. @@ -206,3 +206,7 @@ class L2TPTunnelRecipe(CommonHWSubConfigMixin, BaseTunnelRecipe): pa_config = PacketAssertConf(m2, m2_carrier, **pa_kwargs)
return pa_config + + @property + def pause_frames_dev_list(self): + return [self.matched.host1.eth0, self.matched.host2.eth0]
This also fixes the previous patch that added offload_combinations parameter that is useless unless the recipe inherits from OffloadSubConfigMixin.
Signed-off-by: Jan Tluka jtluka@redhat.com --- lnst/Recipes/ENRT/GeneveTunnelRecipe.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/lnst/Recipes/ENRT/GeneveTunnelRecipe.py b/lnst/Recipes/ENRT/GeneveTunnelRecipe.py index 43aaa954..1d79e093 100644 --- a/lnst/Recipes/ENRT/GeneveTunnelRecipe.py +++ b/lnst/Recipes/ENRT/GeneveTunnelRecipe.py @@ -11,9 +11,17 @@ from lnst.RecipeCommon.Ping.PingEndpoints import PingEndpoints from lnst.RecipeCommon.PacketAssert import PacketAssertConf from lnst.Common.Parameters import Param, StrParam, ChoiceParam from lnst.Recipes.ENRT.BaseTunnelRecipe import BaseTunnelRecipe +from lnst.Recipes.ENRT.ConfigMixins.OffloadSubConfigMixin import ( + OffloadSubConfigMixin, +) +from lnst.Recipes.ENRT.ConfigMixins.PauseFramesHWConfigMixin import ( + PauseFramesHWConfigMixin, +)
-class GeneveTunnelRecipe(BaseTunnelRecipe): +class GeneveTunnelRecipe( + PauseFramesHWConfigMixin, OffloadSubConfigMixin, BaseTunnelRecipe +): """ This class implements a recipe that configures a simple Geneve tunnel between two hosts. @@ -182,3 +190,7 @@ class GeneveTunnelRecipe(BaseTunnelRecipe): @property def offload_nics(self): return [self.matched.host1.eth0, self.matched.host2.eth0] + + @property + def pause_frames_dev_list(self): + return [self.matched.host1.eth0, self.matched.host2.eth0]
Signed-off-by: Jan Tluka jtluka@redhat.com --- lnst/Recipes/ENRT/SitTunnelRecipe.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/lnst/Recipes/ENRT/SitTunnelRecipe.py b/lnst/Recipes/ENRT/SitTunnelRecipe.py index 01de5767..c1bded58 100644 --- a/lnst/Recipes/ENRT/SitTunnelRecipe.py +++ b/lnst/Recipes/ENRT/SitTunnelRecipe.py @@ -10,9 +10,13 @@ from lnst.RecipeCommon.Ping.PingEndpoints import PingEndpoints from lnst.RecipeCommon.PacketAssert import PacketAssertConf from lnst.Common.Parameters import StrParam, ChoiceParam from lnst.Recipes.ENRT.BaseTunnelRecipe import BaseTunnelRecipe +from lnst.Recipes.ENRT.ConfigMixins.MTUHWConfigMixin import MTUHWConfigMixin +from lnst.Recipes.ENRT.ConfigMixins.PauseFramesHWConfigMixin import ( + PauseFramesHWConfigMixin, +)
-class SitTunnelRecipe(BaseTunnelRecipe): +class SitTunnelRecipe(MTUHWConfigMixin, PauseFramesHWConfigMixin, BaseTunnelRecipe): """ This class implements a recipe that configures a simple SIT tunnel between two hosts. @@ -169,3 +173,11 @@ class SitTunnelRecipe(BaseTunnelRecipe): pa_config = PacketAssertConf(m2, m2_carrier, **pa_kwargs)
return pa_config + + @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.sit_tunnel, self.matched.host2.sit_tunnel]
Signed-off-by: Jan Tluka jtluka@redhat.com --- lnst/Recipes/ENRT/Ip6TnlTunnelRecipe.py | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-)
diff --git a/lnst/Recipes/ENRT/Ip6TnlTunnelRecipe.py b/lnst/Recipes/ENRT/Ip6TnlTunnelRecipe.py index eaa9cba4..87bd6cba 100644 --- a/lnst/Recipes/ENRT/Ip6TnlTunnelRecipe.py +++ b/lnst/Recipes/ENRT/Ip6TnlTunnelRecipe.py @@ -8,9 +8,13 @@ from lnst.RecipeCommon.Ping.PingEndpoints import PingEndpoints from lnst.RecipeCommon.PacketAssert import PacketAssertConf from lnst.Common.Parameters import StrParam, ChoiceParam from lnst.Recipes.ENRT.BaseTunnelRecipe import BaseTunnelRecipe +from lnst.Recipes.ENRT.ConfigMixins.MTUHWConfigMixin import MTUHWConfigMixin +from lnst.Recipes.ENRT.ConfigMixins.PauseFramesHWConfigMixin import ( + PauseFramesHWConfigMixin, +)
-class Ip6TnlTunnelRecipe(BaseTunnelRecipe): +class Ip6TnlTunnelRecipe(MTUHWConfigMixin, PauseFramesHWConfigMixin, BaseTunnelRecipe): """ This class implements a recipe that configures a simple Ip6Tnl tunnel between two hosts. @@ -114,11 +118,7 @@ class Ip6TnlTunnelRecipe(BaseTunnelRecipe):
[PingEndpoints(self.matched.host1.ip6tnl, self.matched.host2.ip6tnl)] """ - return [ - PingEndpoints( - self.matched.host1.ip6tnl, self.matched.host2.ip6tnl - ) - ] + return [PingEndpoints(self.matched.host1.ip6tnl, self.matched.host2.ip6tnl)]
def get_packet_assert_config(self, ping_config): """ @@ -152,3 +152,11 @@ class Ip6TnlTunnelRecipe(BaseTunnelRecipe): pa_config = PacketAssertConf(m2, m2_carrier, **pa_kwargs)
return pa_config + + @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.ip6tnl, self.matched.host2.ip6tnl]
Signed-off-by: Jan Tluka jtluka@redhat.com --- lnst/Recipes/ENRT/IpIpTunnelRecipe.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/lnst/Recipes/ENRT/IpIpTunnelRecipe.py b/lnst/Recipes/ENRT/IpIpTunnelRecipe.py index db1694d3..fd4cc6f7 100644 --- a/lnst/Recipes/ENRT/IpIpTunnelRecipe.py +++ b/lnst/Recipes/ENRT/IpIpTunnelRecipe.py @@ -8,9 +8,13 @@ from lnst.RecipeCommon.Ping.PingEndpoints import PingEndpoints from lnst.RecipeCommon.PacketAssert import PacketAssertConf from lnst.Common.Parameters import StrParam, ChoiceParam from lnst.Recipes.ENRT.BaseTunnelRecipe import BaseTunnelRecipe +from lnst.Recipes.ENRT.ConfigMixins.MTUHWConfigMixin import MTUHWConfigMixin +from lnst.Recipes.ENRT.ConfigMixins.PauseFramesHWConfigMixin import ( + PauseFramesHWConfigMixin, +)
-class IpIpTunnelRecipe(BaseTunnelRecipe): +class IpIpTunnelRecipe(MTUHWConfigMixin, PauseFramesHWConfigMixin, BaseTunnelRecipe): """ This class implements a recipe that configures a simple IpIp tunnel between two hosts. @@ -152,3 +156,11 @@ class IpIpTunnelRecipe(BaseTunnelRecipe): pa_config = PacketAssertConf(m2, m2_carrier, **pa_kwargs)
return pa_config + + @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.ipip_tunnel, self.matched.host2.ipip_tunnel]
This replaces the CommonHWConfigMixin with specific mixins.
Signed-off-by: Jan Tluka jtluka@redhat.com --- lnst/Recipes/ENRT/GreTunnelRecipe.py | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-)
diff --git a/lnst/Recipes/ENRT/GreTunnelRecipe.py b/lnst/Recipes/ENRT/GreTunnelRecipe.py index 150f8371..572cb993 100644 --- a/lnst/Recipes/ENRT/GreTunnelRecipe.py +++ b/lnst/Recipes/ENRT/GreTunnelRecipe.py @@ -11,15 +11,20 @@ from lnst.Devices import GreDevice from lnst.RecipeCommon.Ping.PingEndpoints import PingEndpoints from lnst.RecipeCommon.PacketAssert import PacketAssertConf from lnst.Recipes.ENRT.BaseTunnelRecipe import BaseTunnelRecipe +from lnst.Recipes.ENRT.ConfigMixins.MTUHWConfigMixin import ( + MTUHWConfigMixin, +) from lnst.Recipes.ENRT.ConfigMixins.OffloadSubConfigMixin import ( OffloadSubConfigMixin, ) -from lnst.Recipes.ENRT.ConfigMixins.CommonHWSubConfigMixin import ( - CommonHWSubConfigMixin, +from lnst.Recipes.ENRT.ConfigMixins.PauseFramesHWConfigMixin import ( + PauseFramesHWConfigMixin, )
-class GreTunnelRecipe(CommonHWSubConfigMixin, OffloadSubConfigMixin, BaseTunnelRecipe): +class GreTunnelRecipe( + MTUHWConfigMixin, PauseFramesHWConfigMixin, OffloadSubConfigMixin, BaseTunnelRecipe +): """ This class implements a recipe that configures a simple GRE tunnel between two hosts. @@ -179,3 +184,11 @@ class GreTunnelRecipe(CommonHWSubConfigMixin, OffloadSubConfigMixin, BaseTunnelR @property def offload_nics(self): return [self.matched.host1.eth0, self.matched.host2.eth0] + + @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.gre_tunnel, self.matched.host2.gre_tunnel]
This replaces the CommonHWConfigMixin with specific mixins.
Signed-off-by: Jan Tluka jtluka@redhat.com --- lnst/Recipes/ENRT/GreTunnelOverBondRecipe.py | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-)
diff --git a/lnst/Recipes/ENRT/GreTunnelOverBondRecipe.py b/lnst/Recipes/ENRT/GreTunnelOverBondRecipe.py index 3aa00b87..ec6af8e5 100644 --- a/lnst/Recipes/ENRT/GreTunnelOverBondRecipe.py +++ b/lnst/Recipes/ENRT/GreTunnelOverBondRecipe.py @@ -10,16 +10,19 @@ from lnst.Devices import GreDevice, BondDevice from lnst.RecipeCommon.Ping.PingEndpoints import PingEndpoints from lnst.RecipeCommon.PacketAssert import PacketAssertConf from lnst.Recipes.ENRT.BaseTunnelRecipe import BaseTunnelRecipe +from lnst.Recipes.ENRT.ConfigMixins.MTUHWConfigMixin import ( + MTUHWConfigMixin, +) from lnst.Recipes.ENRT.ConfigMixins.OffloadSubConfigMixin import ( OffloadSubConfigMixin, ) -from lnst.Recipes.ENRT.ConfigMixins.CommonHWSubConfigMixin import ( - CommonHWSubConfigMixin, +from lnst.Recipes.ENRT.ConfigMixins.PauseFramesHWConfigMixin import ( + PauseFramesHWConfigMixin, )
class GreTunnelOverBondRecipe( - CommonHWSubConfigMixin, OffloadSubConfigMixin, BaseTunnelRecipe + MTUHWConfigMixin, PauseFramesHWConfigMixin, OffloadSubConfigMixin, BaseTunnelRecipe ): """ This class implements a recipe that configures a GRE tunnel between @@ -225,3 +228,11 @@ class GreTunnelOverBondRecipe( @property def offload_nics(self): return [self.matched.host1.bond, self.matched.host2.bond] + + @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.gre_tunnel, self.matched.host2.gre_tunnel]
This replaces the CommonHWConfigMixin with specific mixins.
Signed-off-by: Jan Tluka jtluka@redhat.com --- lnst/Recipes/ENRT/Ip6GreNetnsTunnelRecipe.py | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-)
diff --git a/lnst/Recipes/ENRT/Ip6GreNetnsTunnelRecipe.py b/lnst/Recipes/ENRT/Ip6GreNetnsTunnelRecipe.py index 05e847a3..12bb22ed 100644 --- a/lnst/Recipes/ENRT/Ip6GreNetnsTunnelRecipe.py +++ b/lnst/Recipes/ENRT/Ip6GreNetnsTunnelRecipe.py @@ -11,16 +11,19 @@ from lnst.Devices import Ip6GreDevice, VethPair, BridgeDevice from lnst.RecipeCommon.Ping.PingEndpoints import PingEndpoints from lnst.RecipeCommon.PacketAssert import PacketAssertConf from lnst.Recipes.ENRT.BaseTunnelRecipe import BaseTunnelRecipe +from lnst.Recipes.ENRT.ConfigMixins.MTUHWConfigMixin import ( + MTUHWConfigMixin, +) from lnst.Recipes.ENRT.ConfigMixins.OffloadSubConfigMixin import ( OffloadSubConfigMixin, ) -from lnst.Recipes.ENRT.ConfigMixins.CommonHWSubConfigMixin import ( - CommonHWSubConfigMixin, +from lnst.Recipes.ENRT.ConfigMixins.PauseFramesHWConfigMixin import ( + PauseFramesHWConfigMixin, )
class Ip6GreNetnsTunnelRecipe( - CommonHWSubConfigMixin, OffloadSubConfigMixin, BaseTunnelRecipe + MTUHWConfigMixin, PauseFramesHWConfigMixin, OffloadSubConfigMixin, BaseTunnelRecipe ): """ This class implements a recipe that configures a IP6GRE tunnel between @@ -246,3 +249,13 @@ class Ip6GreNetnsTunnelRecipe( @property def offload_nics(self): return [self.matched.host1.eth0, self.matched.host2.eth0] + + @property + def pause_frames_dev_list(self): + return [self.matched.host1.eth0, self.matched.host2.eth0] + + @property + def mtu_hw_config_dev_list(self): + host1, host2 = self.matched.host1, self.matched.host2 + + return [host1.newns.gre6_tunnel, host2.newns.gre6_tunnel]
This replaces the CommonHWConfigMixin with specific mixins.
Signed-off-by: Jan Tluka jtluka@redhat.com --- lnst/Recipes/ENRT/Ip6GreTunnelRecipe.py | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-)
diff --git a/lnst/Recipes/ENRT/Ip6GreTunnelRecipe.py b/lnst/Recipes/ENRT/Ip6GreTunnelRecipe.py index 67fc8fc4..5e3ea1b7 100644 --- a/lnst/Recipes/ENRT/Ip6GreTunnelRecipe.py +++ b/lnst/Recipes/ENRT/Ip6GreTunnelRecipe.py @@ -10,16 +10,19 @@ from lnst.Devices import Ip6GreDevice from lnst.RecipeCommon.Ping.PingEndpoints import PingEndpoints from lnst.RecipeCommon.PacketAssert import PacketAssertConf from lnst.Recipes.ENRT.BaseTunnelRecipe import BaseTunnelRecipe +from lnst.Recipes.ENRT.ConfigMixins.MTUHWConfigMixin import ( + MTUHWConfigMixin, +) from lnst.Recipes.ENRT.ConfigMixins.OffloadSubConfigMixin import ( OffloadSubConfigMixin, ) -from lnst.Recipes.ENRT.ConfigMixins.CommonHWSubConfigMixin import ( - CommonHWSubConfigMixin, +from lnst.Recipes.ENRT.ConfigMixins.PauseFramesHWConfigMixin import ( + PauseFramesHWConfigMixin, )
class Ip6GreTunnelRecipe( - CommonHWSubConfigMixin, OffloadSubConfigMixin, BaseTunnelRecipe + MTUHWConfigMixin, PauseFramesHWConfigMixin, OffloadSubConfigMixin, BaseTunnelRecipe ): """ This class implements a recipe that configures a simple IP6GRE tunnel between @@ -185,3 +188,11 @@ class Ip6GreTunnelRecipe( @property def offload_nics(self): return [self.matched.host1.eth0, self.matched.host2.eth0] + + @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.gre6_tunnel, self.matched.host2.gre6_tunnel]
Thu, May 27, 2021 at 02:21:39PM CEST, jtluka@redhat.com wrote:
This includes several enhancements for the recently added tunnel recipes.
The L2TPTunnelRecipe is updated to automatically load the l2tp_eth kernel module that is required by the L2TPTunnelManager to function properly. A new parameter carrier_ipversion is added to this recipe.
Rest of the patches adds specific HWConfigMixins to the recipes, to allow mtu, pause frames and offload settings configuration.
Jan Tluka (11): Recipes.ENRT.L2TPTunnelRecipe: load l2tp_eth module before creating the tunnel Recipes.ENRT.L2TPTunnelRecipe: add carrier_ipversion parameter Recipes.ENRT.L2TPTunnelRecipe: add PauseFramesHWConfigMixin Recipes.ENRT.GeneveTunnelRecipe: add OffloadSubConfigMixin and PauseFramesHWConfigMixin Recipes.ENRT.SitTunnelRecipe: add {MTU,PauseFrames}HWConfigMixins Recipes.ENRT.Ip6TnlTunnelRecipe: add {MTU,PauseFrames}HWConfigMixins Recipes.ENRT.IpIpTunnelRecipe: add {MTU,PauseFrames}HWConfigMixins Recipes.ENRT.GreTunnelRecipe: add {MTU,PauseFrames}HWConfigMixins Recipes.ENRT.GreTunnelOverBondRecipe: add {MTU,PauseFrames}HWConfigMixins Recipes.ENRT.Ip6GreNetnsTunnelRecipe.py: add {MTU,PauseFrames}HWConfigMixins Recipes.ENRT.Ip6GreTunnelRecipe.py: add {MTU,PauseFrames}HWConfigMixins
lnst/Recipes/ENRT/GeneveTunnelRecipe.py | 14 +++- lnst/Recipes/ENRT/GreTunnelOverBondRecipe.py | 17 ++++- lnst/Recipes/ENRT/GreTunnelRecipe.py | 19 +++++- lnst/Recipes/ENRT/Ip6GreNetnsTunnelRecipe.py | 19 +++++- lnst/Recipes/ENRT/Ip6GreTunnelRecipe.py | 17 ++++- lnst/Recipes/ENRT/Ip6TnlTunnelRecipe.py | 20 ++++-- lnst/Recipes/ENRT/IpIpTunnelRecipe.py | 14 +++- lnst/Recipes/ENRT/L2TPTunnelRecipe.py | 68 +++++++++++++++----- lnst/Recipes/ENRT/SitTunnelRecipe.py | 14 +++- 9 files changed, 164 insertions(+), 38 deletions(-)
-- 2.26.3
I've accidentally included a patch that I already sent: Recipes.ENRT.L2TPTunnelRecipe: add carrier_ipversion parameter
Will resend v2.
-Jan
Thu, May 27, 2021 at 02:30:50PM CEST, jtluka@redhat.com wrote:
Thu, May 27, 2021 at 02:21:39PM CEST, jtluka@redhat.com wrote:
This includes several enhancements for the recently added tunnel recipes.
The L2TPTunnelRecipe is updated to automatically load the l2tp_eth kernel module that is required by the L2TPTunnelManager to function properly. A new parameter carrier_ipversion is added to this recipe.
Rest of the patches adds specific HWConfigMixins to the recipes, to allow mtu, pause frames and offload settings configuration.
Jan Tluka (11): Recipes.ENRT.L2TPTunnelRecipe: load l2tp_eth module before creating the tunnel Recipes.ENRT.L2TPTunnelRecipe: add carrier_ipversion parameter Recipes.ENRT.L2TPTunnelRecipe: add PauseFramesHWConfigMixin Recipes.ENRT.GeneveTunnelRecipe: add OffloadSubConfigMixin and PauseFramesHWConfigMixin Recipes.ENRT.SitTunnelRecipe: add {MTU,PauseFrames}HWConfigMixins Recipes.ENRT.Ip6TnlTunnelRecipe: add {MTU,PauseFrames}HWConfigMixins Recipes.ENRT.IpIpTunnelRecipe: add {MTU,PauseFrames}HWConfigMixins Recipes.ENRT.GreTunnelRecipe: add {MTU,PauseFrames}HWConfigMixins Recipes.ENRT.GreTunnelOverBondRecipe: add {MTU,PauseFrames}HWConfigMixins Recipes.ENRT.Ip6GreNetnsTunnelRecipe.py: add {MTU,PauseFrames}HWConfigMixins Recipes.ENRT.Ip6GreTunnelRecipe.py: add {MTU,PauseFrames}HWConfigMixins
lnst/Recipes/ENRT/GeneveTunnelRecipe.py | 14 +++- lnst/Recipes/ENRT/GreTunnelOverBondRecipe.py | 17 ++++- lnst/Recipes/ENRT/GreTunnelRecipe.py | 19 +++++- lnst/Recipes/ENRT/Ip6GreNetnsTunnelRecipe.py | 19 +++++- lnst/Recipes/ENRT/Ip6GreTunnelRecipe.py | 17 ++++- lnst/Recipes/ENRT/Ip6TnlTunnelRecipe.py | 20 ++++-- lnst/Recipes/ENRT/IpIpTunnelRecipe.py | 14 +++- lnst/Recipes/ENRT/L2TPTunnelRecipe.py | 68 +++++++++++++++----- lnst/Recipes/ENRT/SitTunnelRecipe.py | 14 +++- 9 files changed, 164 insertions(+), 38 deletions(-)
-- 2.26.3
I've accidentally included a patch that I already sent: Recipes.ENRT.L2TPTunnelRecipe: add carrier_ipversion parameter
Will resend v2.
-Jan
Sorry for noise. I would be more easier to skip the already sent patch email. So please apply this patchset in full extent.
I'll reply to the previously sent patch to skip it.
-Jan
lnst-developers@lists.fedorahosted.org