From 3d21f634f2dbc33750326c2607e68a328407dcfe Mon Sep 17 00:00:00 2001 From: Jan Tluka Date: Fri, 22 Mar 2024 11:39:52 +0100 Subject: [PATCH 1/3] ENRT/ConfigMixins: replace CoalescingHWConfigMixin with MultiCoalescingHWConfigMixin The CoalescingHWConfigMixin is only capable of disabling adaptive TX/RX setting. Typically the user disables adaptive coalescing and configures specific values of rx/tx-usecs and others. Not setting these would result in non-deterministic behaviour of the setup. The MultiCoalescingHWConfigMixin is capable of setting any coalescing options, so using it instead of CoalescingHWConfigMixin makes sense. Signed-off-by: Jan Tluka --- .../ConfigMixins/CoalescingHWConfigMixin.py | 108 ++++++++++++------ .../MultiCoalescingHWConfigMixin.py | 101 ---------------- .../ENRT/SimpleNetworkTunableRecipe.py | 8 +- 3 files changed, 78 insertions(+), 139 deletions(-) delete mode 100644 lnst/Recipes/ENRT/ConfigMixins/MultiCoalescingHWConfigMixin.py diff --git a/lnst/Recipes/ENRT/ConfigMixins/CoalescingHWConfigMixin.py b/lnst/Recipes/ENRT/ConfigMixins/CoalescingHWConfigMixin.py index 0c259b13d..100cfdde0 100644 --- a/lnst/Recipes/ENRT/ConfigMixins/CoalescingHWConfigMixin.py +++ b/lnst/Recipes/ENRT/ConfigMixins/CoalescingHWConfigMixin.py @@ -1,61 +1,101 @@ -from lnst.Common.Parameters import BoolParam +from copy import copy +from lnst.Common.Parameters import DictParam from lnst.Recipes.ENRT.ConfigMixins.BaseHWConfigMixin import BaseHWConfigMixin class CoalescingHWConfigMixin(BaseHWConfigMixin): """ This class is an extension to the :any:`BaseEnrtRecipe` class that enables - adaptive coalescing configuration on the devices defined by + interrupt coalescing configuration on the devices defined by :attr:`coalescing_hw_config_dev_list` property. - :param adaptive_tx_coalescing: - (optional test parameter) boolean to enable/disable TX adaptive - coalescing on the devices - :param adaptive_rx_coalescing: - (optional test parameter) boolean to enable/disable RX adaptive - coalescing on the devices - """ - - adaptive_rx_coalescing = BoolParam(mandatory=False) - adaptive_tx_coalescing = BoolParam(mandatory=False) + This mixin is a "multi device" variant of the :any:`CoalescingHWConfigMixin` + and allows configuration of individual devices instead of sharing the same + configuration. This may be required when different interrupt coalescing is + required by a flow generator and receiver host. - @property - def coalescing_hw_config_dev_list(self): - """ - The value of this property is a list of devices for which the - adaptive coalescing features should be configured. It has to be - defined by a derived class. - """ - return [] + :param coalescing_settings: + (optional test parameter) dictionary to specify coalescing settings + for individual devices, in 'ethtool -C ...' format + """ + coalescing_settings = DictParam(mandatory=False, default={}) def hw_config(self, config): super().hw_config(config) - for param in ["adaptive_rx_coalescing", "adaptive_tx_coalescing"]: - param_value = getattr(self.params, param, None) - if param_value is not None: + device_settings = self._parse_device_settings(self.params.coalescing_settings) + for device, device_setting in device_settings.items(): + device_setting_copy = copy(device_setting) + # first, fetch adaptive setting as it needs to be turned off before + # configuring individual coalescing settings + for param in ["adaptive-tx", "adaptive-rx"]: + if param_value := device_setting_copy.pop(param, None): + self._configure_dev_attribute( + config, + [device], + coalescing_param_to_device_attribute(param), + param_value == "on", + ) + + for param, param_value in device_setting_copy.items(): self._configure_dev_attribute( config, - self.coalescing_hw_config_dev_list, - param, - param_value + [device], + coalescing_param_to_device_attribute(param), + param_value, ) def hw_deconfig(self, config): - for feature in ['adaptive_rx_coalescing', 'adaptive_tx_coalescing']: - self._deconfigure_dev_attribute( - config, - self.coalescing_hw_config_dev_list, - feature, - ) + device_settings = self._parse_device_settings(self.params.coalescing_settings) + for device, device_setting in device_settings.items(): + device_setting_copy = copy(device_setting) + for param in device_setting: + if param in ["adaptive-tx", "adaptive-rx"]: + continue + device_setting_copy.pop(param) + self._deconfigure_dev_attribute( + config, + [device], + coalescing_param_to_device_attribute(param), + ) + + for param in device_setting_copy: + self._deconfigure_dev_attribute( + config, + [device], + coalescing_param_to_device_attribute(param), + ) super().hw_deconfig(config) def describe_hw_config(self, config): desc = super().describe_hw_config(config) - for param in ["adaptive_rx_coalescing", "adaptive_tx_coalescing"]: + + device_settings = self._parse_device_settings(self.params.coalescing_settings) + coalescing_attrs = { + coalescing_param_to_device_attribute(key) + for setting in device_settings.values() + for key in setting.keys() + } + for attr in sorted(coalescing_attrs): desc.extend( - self._describe_dev_attribute(config, param) + self._describe_dev_attribute( + config, + attr, + ) ) + return desc + + +def coalescing_param_to_device_attribute(param): + """ + This mixin accepts the coalesce_settings keys in 'ethtool -C' format + The Device class uses more descriptive property names along with + underscores, so we need to translate the keys to property names + """ + if param in ["adaptive-tx", "adaptive-rx"]: + return param.replace("-", "_") + "_coalescing" + + return "coalescing_" + param.replace("-", "_") diff --git a/lnst/Recipes/ENRT/ConfigMixins/MultiCoalescingHWConfigMixin.py b/lnst/Recipes/ENRT/ConfigMixins/MultiCoalescingHWConfigMixin.py deleted file mode 100644 index 4dca3dc61..000000000 --- a/lnst/Recipes/ENRT/ConfigMixins/MultiCoalescingHWConfigMixin.py +++ /dev/null @@ -1,101 +0,0 @@ -from copy import copy - -from lnst.Common.Parameters import DictParam -from lnst.Recipes.ENRT.ConfigMixins.BaseHWConfigMixin import BaseHWConfigMixin - - -class MultiCoalescingHWConfigMixin(BaseHWConfigMixin): - """ - This class is an extension to the :any:`BaseEnrtRecipe` class that enables - interrupt coalescing configuration on the devices defined by - :attr:`coalescing_hw_config_dev_list` property. - - This mixin is a "multi device" variant of the :any:`CoalescingHWConfigMixin` - and allows configuration of individual devices instead of sharing the same - configuration. This may be required when different interrupt coalescing is - required by a flow generator and receiver host. - - :param coalescing_settings: - (optional test parameter) dictionary to specify coalescing settings - for individual devices, in 'ethtool -C ...' format - """ - coalescing_settings = DictParam(mandatory=False, default={}) - - def hw_config(self, config): - super().hw_config(config) - - device_settings = self._parse_device_settings(self.params.coalescing_settings) - for device, device_setting in device_settings.items(): - device_setting_copy = copy(device_setting) - # first, fetch adaptive setting as it needs to be turned off before - # configuring individual coalescing settings - for param in ["adaptive-tx", "adaptive-rx"]: - if param_value := device_setting_copy.pop(param, None): - self._configure_dev_attribute( - config, - [device], - coalescing_param_to_device_attribute(param), - param_value == "on", - ) - - for param, param_value in device_setting_copy.items(): - self._configure_dev_attribute( - config, - [device], - coalescing_param_to_device_attribute(param), - param_value, - ) - - def hw_deconfig(self, config): - device_settings = self._parse_device_settings(self.params.coalescing_settings) - for device, device_setting in device_settings.items(): - device_setting_copy = copy(device_setting) - for param in device_setting: - if param in ["adaptive-tx", "adaptive-rx"]: - continue - device_setting_copy.pop(param) - self._deconfigure_dev_attribute( - config, - [device], - coalescing_param_to_device_attribute(param), - ) - - for param in device_setting_copy: - self._deconfigure_dev_attribute( - config, - [device], - coalescing_param_to_device_attribute(param), - ) - - super().hw_deconfig(config) - - def describe_hw_config(self, config): - desc = super().describe_hw_config(config) - - device_settings = self._parse_device_settings(self.params.coalescing_settings) - coalescing_attrs = { - coalescing_param_to_device_attribute(key) - for setting in device_settings.values() - for key in setting.keys() - } - for attr in sorted(coalescing_attrs): - desc.extend( - self._describe_dev_attribute( - config, - attr, - ) - ) - - return desc - - -def coalescing_param_to_device_attribute(param): - """ - This mixin accepts the coalesce_settings keys in 'ethtool -C' format - The Device class uses more descriptive property names along with - underscores, so we need to translate the keys to property names - """ - if param in ["adaptive-tx", "adaptive-rx"]: - return param.replace("-", "_") + "_coalescing" - - return "coalescing_" + param.replace("-", "_") diff --git a/lnst/Recipes/ENRT/SimpleNetworkTunableRecipe.py b/lnst/Recipes/ENRT/SimpleNetworkTunableRecipe.py index f0f4d577e..79bf84cd6 100644 --- a/lnst/Recipes/ENRT/SimpleNetworkTunableRecipe.py +++ b/lnst/Recipes/ENRT/SimpleNetworkTunableRecipe.py @@ -13,8 +13,8 @@ LinuxPerfMeasurementGenerator, ) -from lnst.Recipes.ENRT.ConfigMixins.MultiCoalescingHWConfigMixin import ( - MultiCoalescingHWConfigMixin, +from lnst.Recipes.ENRT.ConfigMixins.CoalescingHWConfigMixin import ( + CoalescingHWConfigMixin, ) from lnst.Recipes.ENRT.ConfigMixins.MultiDevInterruptHWConfigMixin import ( MultiDevInterruptHWConfigMixin, @@ -42,7 +42,7 @@ class SimpleNetworkTunableRecipe( DevNfcRxFlowHashConfigMixin, DevQueuesConfigMixin, PauseFramesHWConfigMixin, - MultiCoalescingHWConfigMixin, + CoalescingHWConfigMixin, MultiDevInterruptHWConfigMixin, MTUHWConfigMixin, OffloadSubConfigMixin, @@ -74,7 +74,7 @@ class SimpleNetworkTunableRecipe( * nfc rx flow hash - :any:`DevNfcRxFlowHashConfigMixin` * rx hash function - :any:`DevRxHashFunctionConfigMixin` * per-device IRQ pinning - :any:`MultiDevInterruptHWConfigMixin` - * per-device coalescing setting through :any:`MultiCoalescingHWConfigMixin` + * per-device coalescing setting through :any:`CoalescingHWConfigMixin` Also the recipe uses :any:`FlowMeasurementMultiCpupinGenerator`, that allows per-host CPU pinning strategies. From 25e497877230dead0d8c9b5bfaf3aa85b556bc97 Mon Sep 17 00:00:00 2001 From: Jan Tluka Date: Wed, 20 Mar 2024 11:23:18 +0100 Subject: [PATCH 2/3] Recipes/ENRT: remove deprecated coalescing_hw_config_dev_list property Signed-off-by: Jan Tluka --- lnst/Recipes/ENRT/BaseSRIOVNetnsTcRecipe.py | 4 ---- lnst/Recipes/ENRT/BondRecipe.py | 18 +----------------- lnst/Recipes/ENRT/DoubleBondRecipe.py | 5 ----- lnst/Recipes/ENRT/DoubleTeamRecipe.py | 5 ----- lnst/Recipes/ENRT/GeneveTunnelRecipe.py | 4 ---- lnst/Recipes/ENRT/GreTunnelRecipe.py | 4 ---- lnst/Recipes/ENRT/LinuxBridgeOverBondRecipe.py | 5 ----- lnst/Recipes/ENRT/LinuxBridgeRecipe.py | 4 ---- lnst/Recipes/ENRT/MPTCPRecipe.py | 5 ----- lnst/Recipes/ENRT/SRIOVNetnsGeneveTcRecipe.py | 4 ---- lnst/Recipes/ENRT/SRIOVNetnsOvSRecipe.py | 4 ---- lnst/Recipes/ENRT/SRIOVNetnsTcRecipe.py | 4 ---- lnst/Recipes/ENRT/SRIOVNetnsVxlanTcRecipe.py | 4 ---- lnst/Recipes/ENRT/SimpleNetworkRecipe.py | 4 ---- .../Recipes/ENRT/SimpleNetworkTunableRecipe.py | 4 ---- lnst/Recipes/ENRT/TeamRecipe.py | 16 ---------------- lnst/Recipes/ENRT/TeamVsBondRecipe.py | 5 ----- lnst/Recipes/ENRT/VlansOverBondRecipe.py | 15 --------------- lnst/Recipes/ENRT/VlansOverTeamRecipe.py | 5 ----- lnst/Recipes/ENRT/VlansRecipe.py | 14 -------------- 20 files changed, 1 insertion(+), 132 deletions(-) diff --git a/lnst/Recipes/ENRT/BaseSRIOVNetnsTcRecipe.py b/lnst/Recipes/ENRT/BaseSRIOVNetnsTcRecipe.py index 450742de8..ecb643cea 100644 --- a/lnst/Recipes/ENRT/BaseSRIOVNetnsTcRecipe.py +++ b/lnst/Recipes/ENRT/BaseSRIOVNetnsTcRecipe.py @@ -294,10 +294,6 @@ def offload_nics(self): def mtu_hw_config_dev_list(self): raise NotImplementedError() - @property - def coalescing_hw_config_dev_list(self): - raise NotImplementedError() - @property def dev_interrupt_hw_config_dev_list(self): raise NotImplementedError() diff --git a/lnst/Recipes/ENRT/BondRecipe.py b/lnst/Recipes/ENRT/BondRecipe.py index 800b86b33..b6e12fc27 100644 --- a/lnst/Recipes/ENRT/BondRecipe.py +++ b/lnst/Recipes/ENRT/BondRecipe.py @@ -194,22 +194,6 @@ class and :any:`MTUHWConfigMixin.mtu_hw_config_dev_list`. """ return [self.matched.host1.bond0, self.matched.host2.eth0] - @property - def coalescing_hw_config_dev_list(self): - """ - The `coalescing_hw_config_dev_list` property value for this scenario is a - list containing the matched physical devices used to create the bonding - device on host1 and the matched ethernet device on host2. - - | host1.eth0, host.eth1 - | host2.eth0 - - For detailed explanation of this property see :any:`CoalescingHWConfigMixin` - class and :any:`CoalescingHWConfigMixin.coalescing_hw_config_dev_list`. - """ - return [self.matched.host1.eth0, self.matched.host1.eth1, - self.matched.host2.eth0] - @property def dev_interrupt_hw_config_dev_list(self): """ @@ -222,7 +206,7 @@ def dev_interrupt_hw_config_dev_list(self): For detailed explanation of this property see :any:`DevInterruptHWConfigMixin` class and - :any:`CoalescingHWConfigMixin.coalescing_hw_config_dev_list`. + :any:`DevInterruptHWConfigMixin.dev_interrupt_hw_config_dev_list`. """ return [self.matched.host1.eth0, self.matched.host1.eth1, self.matched.host2.eth0] diff --git a/lnst/Recipes/ENRT/DoubleBondRecipe.py b/lnst/Recipes/ENRT/DoubleBondRecipe.py index c58145ca9..3a74a7408 100644 --- a/lnst/Recipes/ENRT/DoubleBondRecipe.py +++ b/lnst/Recipes/ENRT/DoubleBondRecipe.py @@ -109,11 +109,6 @@ def offload_nics(self): 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 diff --git a/lnst/Recipes/ENRT/DoubleTeamRecipe.py b/lnst/Recipes/ENRT/DoubleTeamRecipe.py index 12d2b71cc..998d9c3ac 100644 --- a/lnst/Recipes/ENRT/DoubleTeamRecipe.py +++ b/lnst/Recipes/ENRT/DoubleTeamRecipe.py @@ -105,11 +105,6 @@ def offload_nics(self): def mtu_hw_config_dev_list(self): return [self.matched.host1.team0, self.matched.host2.team0] - @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 diff --git a/lnst/Recipes/ENRT/GeneveTunnelRecipe.py b/lnst/Recipes/ENRT/GeneveTunnelRecipe.py index ca29b7c09..92d7b456e 100644 --- a/lnst/Recipes/ENRT/GeneveTunnelRecipe.py +++ b/lnst/Recipes/ENRT/GeneveTunnelRecipe.py @@ -205,10 +205,6 @@ def pause_frames_dev_list(self): 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] diff --git a/lnst/Recipes/ENRT/GreTunnelRecipe.py b/lnst/Recipes/ENRT/GreTunnelRecipe.py index 0a9671f69..b8ed1ba66 100644 --- a/lnst/Recipes/ENRT/GreTunnelRecipe.py +++ b/lnst/Recipes/ENRT/GreTunnelRecipe.py @@ -194,10 +194,6 @@ def pause_frames_dev_list(self): 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] diff --git a/lnst/Recipes/ENRT/LinuxBridgeOverBondRecipe.py b/lnst/Recipes/ENRT/LinuxBridgeOverBondRecipe.py index 9d8ed444d..c3be6bef7 100644 --- a/lnst/Recipes/ENRT/LinuxBridgeOverBondRecipe.py +++ b/lnst/Recipes/ENRT/LinuxBridgeOverBondRecipe.py @@ -184,11 +184,6 @@ def offload_nics(self): 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 diff --git a/lnst/Recipes/ENRT/LinuxBridgeRecipe.py b/lnst/Recipes/ENRT/LinuxBridgeRecipe.py index 6c9287f2d..4449d2da5 100644 --- a/lnst/Recipes/ENRT/LinuxBridgeRecipe.py +++ b/lnst/Recipes/ENRT/LinuxBridgeRecipe.py @@ -150,10 +150,6 @@ def offload_nics(self): 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] diff --git a/lnst/Recipes/ENRT/MPTCPRecipe.py b/lnst/Recipes/ENRT/MPTCPRecipe.py index e8c29f442..b456052c3 100644 --- a/lnst/Recipes/ENRT/MPTCPRecipe.py +++ b/lnst/Recipes/ENRT/MPTCPRecipe.py @@ -193,11 +193,6 @@ def mtu_hw_config_dev_list(self): return [self.matched.host1.eth0, self.matched.host1.eth1, self.matched.host2.eth0, self.matched.host2.eth1] - @property - def coalescing_hw_config_dev_list(self): - return [self.matched.host1.eth0, self.matched.host1.eth1, - self.matched.host2.eth0, self.matched.host2.eth1] - @property def dev_interrupt_hw_config_dev_list(self): return [self.matched.host1.eth0, self.matched.host1.eth1, diff --git a/lnst/Recipes/ENRT/SRIOVNetnsGeneveTcRecipe.py b/lnst/Recipes/ENRT/SRIOVNetnsGeneveTcRecipe.py index f7ab55ac8..406f39857 100644 --- a/lnst/Recipes/ENRT/SRIOVNetnsGeneveTcRecipe.py +++ b/lnst/Recipes/ENRT/SRIOVNetnsGeneveTcRecipe.py @@ -206,10 +206,6 @@ def offload_nics(self): def mtu_hw_config_dev_list(self): return [self.matched.host1.sriov_devices.vfs[0], self.matched.host2.sriov_devices.vfs[0]] - @property - def coalescing_hw_config_dev_list(self): - return [self.matched.host1.sriov_devices.vfs[0], self.matched.host2.sriov_devices.vfs[0]] - @property def dev_interrupt_hw_config_dev_list(self): return [self.matched.host1.sriov_devices.vfs[0], self.matched.host2.sriov_devices.vfs[0]] diff --git a/lnst/Recipes/ENRT/SRIOVNetnsOvSRecipe.py b/lnst/Recipes/ENRT/SRIOVNetnsOvSRecipe.py index e5d41662d..e655a51c4 100644 --- a/lnst/Recipes/ENRT/SRIOVNetnsOvSRecipe.py +++ b/lnst/Recipes/ENRT/SRIOVNetnsOvSRecipe.py @@ -207,10 +207,6 @@ def offload_nics(self): def mtu_hw_config_dev_list(self): return [self.matched.host1.newns.vf_eth0, self.matched.host2.newns.vf_eth0] - @property - def coalescing_hw_config_dev_list(self): - return [self.matched.host1.newns.vf_eth0, self.matched.host2.newns.vf_eth0] - @property def dev_interrupt_hw_config_dev_list(self): return [self.matched.host1.newns.vf_eth0, self.matched.host2.newns.vf_eth0] diff --git a/lnst/Recipes/ENRT/SRIOVNetnsTcRecipe.py b/lnst/Recipes/ENRT/SRIOVNetnsTcRecipe.py index efc14dea1..b40daa4bc 100644 --- a/lnst/Recipes/ENRT/SRIOVNetnsTcRecipe.py +++ b/lnst/Recipes/ENRT/SRIOVNetnsTcRecipe.py @@ -128,10 +128,6 @@ def offload_nics(self): def mtu_hw_config_dev_list(self): return [self.matched.host1.sriov_devices.vfs[0], self.matched.host2.sriov_devices.vfs[0]] - @property - def coalescing_hw_config_dev_list(self): - return [self.matched.host1.sriov_devices.vfs[0], self.matched.host2.sriov_devices.vfs[0]] - @property def dev_interrupt_hw_config_dev_list(self): return [self.matched.host1.sriov_devices.vfs[0], self.matched.host2.sriov_devices.vfs[0]] diff --git a/lnst/Recipes/ENRT/SRIOVNetnsVxlanTcRecipe.py b/lnst/Recipes/ENRT/SRIOVNetnsVxlanTcRecipe.py index ec6161999..f56599305 100644 --- a/lnst/Recipes/ENRT/SRIOVNetnsVxlanTcRecipe.py +++ b/lnst/Recipes/ENRT/SRIOVNetnsVxlanTcRecipe.py @@ -206,10 +206,6 @@ def offload_nics(self): def mtu_hw_config_dev_list(self): return [self.matched.host1.sriov_devices.vfs[0], self.matched.host2.sriov_devices.vfs[0]] - @property - def coalescing_hw_config_dev_list(self): - return [self.matched.host1.sriov_devices.vfs[0], self.matched.host2.sriov_devices.vfs[0]] - @property def dev_interrupt_hw_config_dev_list(self): return [self.matched.host1.sriov_devices.vfs[0], self.matched.host2.sriov_devices.vfs[0]] diff --git a/lnst/Recipes/ENRT/SimpleNetworkRecipe.py b/lnst/Recipes/ENRT/SimpleNetworkRecipe.py index 737a3fac9..e827c9f1b 100644 --- a/lnst/Recipes/ENRT/SimpleNetworkRecipe.py +++ b/lnst/Recipes/ENRT/SimpleNetworkRecipe.py @@ -123,10 +123,6 @@ def offload_nics(self): 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] diff --git a/lnst/Recipes/ENRT/SimpleNetworkTunableRecipe.py b/lnst/Recipes/ENRT/SimpleNetworkTunableRecipe.py index 79bf84cd6..86d925277 100644 --- a/lnst/Recipes/ENRT/SimpleNetworkTunableRecipe.py +++ b/lnst/Recipes/ENRT/SimpleNetworkTunableRecipe.py @@ -101,7 +101,3 @@ def pause_frames_dev_list(self): @property def offload_nics(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] diff --git a/lnst/Recipes/ENRT/TeamRecipe.py b/lnst/Recipes/ENRT/TeamRecipe.py index b04c34933..6669cdcce 100644 --- a/lnst/Recipes/ENRT/TeamRecipe.py +++ b/lnst/Recipes/ENRT/TeamRecipe.py @@ -190,22 +190,6 @@ class and :any:`MTUHWConfigMixin.mtu_hw_config_dev_list`. """ return [self.matched.host1.team0, self.matched.host2.eth0] - @property - def coalescing_hw_config_dev_list(self): - """ - The `coalescing_hw_config_dev_list` property value for this scenario is a - list containing the matched physical devices used to create the teaming - device on host1 and the matched ethernet device on host2. - - | host1.eth0, host.eth1 - | host2.eth0 - - For detailed explanation of this property see :any:`CoalescingHWConfigMixin` - class and :any:`CoalescingHWConfigMixin.coalescing_hw_config_dev_list`. - """ - host1, host2 = self.matched.host1, self.matched.host2 - return [host1.eth0, host1.eth1, host2.eth0] - @property def dev_interrupt_hw_config_dev_list(self): """ diff --git a/lnst/Recipes/ENRT/TeamVsBondRecipe.py b/lnst/Recipes/ENRT/TeamVsBondRecipe.py index 281a443be..99d816041 100644 --- a/lnst/Recipes/ENRT/TeamVsBondRecipe.py +++ b/lnst/Recipes/ENRT/TeamVsBondRecipe.py @@ -124,11 +124,6 @@ def offload_nics(self): def mtu_hw_config_dev_list(self): return [self.matched.host1.team0, 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 diff --git a/lnst/Recipes/ENRT/VlansOverBondRecipe.py b/lnst/Recipes/ENRT/VlansOverBondRecipe.py index b8354b68e..7d1efa098 100644 --- a/lnst/Recipes/ENRT/VlansOverBondRecipe.py +++ b/lnst/Recipes/ENRT/VlansOverBondRecipe.py @@ -264,21 +264,6 @@ class and :any:`MTUHWConfigMixin.mtu_hw_config_dev_list`. result.extend([host1.bond0, host2.eth0]) return result - @property - def coalescing_hw_config_dev_list(self): - """ - The `coalescing_hw_config_dev_list` property value for this scenario - is a list of the physical devices carrying data of the configured - VLAN tunnels: - - host1.eth0, host1.eth1 and host2.eth0 - - For detailed explanation of this property see :any:`CoalescingHWConfigMixin` - class and :any:`CoalescingHWConfigMixin.coalescing_hw_config_dev_list`. - """ - host1, host2 = self.matched.host1, self.matched.host2 - return [host1.eth0, host1.eth1, host2.eth0] - @property def dev_interrupt_hw_config_dev_list(self): """ diff --git a/lnst/Recipes/ENRT/VlansOverTeamRecipe.py b/lnst/Recipes/ENRT/VlansOverTeamRecipe.py index 1ccbbb7b9..4cda08491 100644 --- a/lnst/Recipes/ENRT/VlansOverTeamRecipe.py +++ b/lnst/Recipes/ENRT/VlansOverTeamRecipe.py @@ -161,11 +161,6 @@ def mtu_hw_config_dev_list(self): result.extend([host1.team0, host2.eth0]) return result - @property - def coalescing_hw_config_dev_list(self): - host1, host2 = self.matched.host1, self.matched.host2 - return [host1.eth0, host1.eth1, host2.eth0] - @property def dev_interrupt_hw_config_dev_list(self): host1, host2 = self.matched.host1, self.matched.host2 diff --git a/lnst/Recipes/ENRT/VlansRecipe.py b/lnst/Recipes/ENRT/VlansRecipe.py index 2cf4aa45a..38517d917 100644 --- a/lnst/Recipes/ENRT/VlansRecipe.py +++ b/lnst/Recipes/ENRT/VlansRecipe.py @@ -206,20 +206,6 @@ class and :any:`MTUHWConfigMixin.mtu_hw_config_dev_list`. result.append(dev) return result - @property - def coalescing_hw_config_dev_list(self): - """ - The `coalescing_hw_config_dev_list` property value for this scenario - is a list of the physical devices carrying data of the configured - VLAN tunnels: - - host1.eth0 and host2.eth0 - - For detailed explanation of this property see :any:`CoalescingHWConfigMixin` - class and :any:`CoalescingHWConfigMixin.coalescing_hw_config_dev_list`. - """ - return [self.matched.host1.eth0, self.matched.host2.eth0] - @property def dev_interrupt_hw_config_dev_list(self): """ From b0622f926ca084fcd1070a1e5b0c2501e8f38473 Mon Sep 17 00:00:00 2001 From: Jan Tluka Date: Fri, 22 Mar 2024 12:01:06 +0100 Subject: [PATCH 3/3] ENRT/ConfigMixins/CoalescingHWConfigMixin: update documentation Signed-off-by: Jan Tluka --- .../ConfigMixins/CoalescingHWConfigMixin.py | 36 +++++++++++++++---- 1 file changed, 30 insertions(+), 6 deletions(-) diff --git a/lnst/Recipes/ENRT/ConfigMixins/CoalescingHWConfigMixin.py b/lnst/Recipes/ENRT/ConfigMixins/CoalescingHWConfigMixin.py index 100cfdde0..8ade0d1ce 100644 --- a/lnst/Recipes/ENRT/ConfigMixins/CoalescingHWConfigMixin.py +++ b/lnst/Recipes/ENRT/ConfigMixins/CoalescingHWConfigMixin.py @@ -7,13 +7,37 @@ class CoalescingHWConfigMixin(BaseHWConfigMixin): """ This class is an extension to the :any:`BaseEnrtRecipe` class that enables - interrupt coalescing configuration on the devices defined by - :attr:`coalescing_hw_config_dev_list` property. + interrupt coalescing configuration on any device defined in recipe's + device requirements. + + Typically the user would disable adaptive interrupt coalescing and configure + specific values. + + For example the SimpleNetworkRecipe defines `host1.eth0` and `host2.eth0` + device requirements, so to configure the interrupt coalescing you can do: + + ```python + recipe = SimpleNetworkRecipe( + coalescing_settings={ + "host1": { + "eth0": { + "adaptive-rx": "off", "adaptive-tx": "off", + "rx-usecs": 16, "rx-frames": 32, + "tx-usecs": 128, "tx-frames": 128 + } + }, + "host2": { + "eth0": { + "adaptive-rx": "off", "adaptive-tx": "off", + "rx-usecs": 16, "rx-frames": 32, + "tx-usecs": 128, "tx-frames": 128 + } + } + } + ) + ``` - This mixin is a "multi device" variant of the :any:`CoalescingHWConfigMixin` - and allows configuration of individual devices instead of sharing the same - configuration. This may be required when different interrupt coalescing is - required by a flow generator and receiver host. + The keys in the coalescing settings match the `ethtool -C` command syntax. :param coalescing_settings: (optional test parameter) dictionary to specify coalescing settings