From a598d011dcc5f1f5d3d5f610d91be40fd157c842 Mon Sep 17 00:00:00 2001 From: vcandappa Date: Thu, 3 Nov 2022 11:39:43 +0530 Subject: [PATCH] Mellanox NICs' ifcfg-scripts should not be removed when no CONFIG change exists os-net-config is triggering reconfiguration/flapping of mellanox nics even when there are no changes in the NIC configs. Added check to NOT remove ifcfg-* scripts for Mellonox NICs when DPDK/Bond is enabled Resolves: rhbz#2131248 Change-Id: Ida0c78ba7784d452165999af4dd955b0129cfdaf (cherry picked from commit e752fbac782f357f1445a609ff90e1dee6c3492d) --- os_net_config/impl_ifcfg.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/os_net_config/impl_ifcfg.py b/os_net_config/impl_ifcfg.py index 403cfdf5..3031abc6 100644 --- a/os_net_config/impl_ifcfg.py +++ b/os_net_config/impl_ifcfg.py @@ -51,6 +51,7 @@ def remove_ifcfg_config(ifname): if re.match('[\w-]+$', ifname): ifcfg_file = ifcfg_config_path(ifname) if os.path.exists(ifcfg_file): + logger.info('removing existing ifcfg script for intf: %s' % ifname) os.remove(ifcfg_file) @@ -951,7 +952,7 @@ class IfcfgNetConfig(os_net_config.NetConfig): # Bind the dpdk interface utils.bind_dpdk_interfaces(ifname, ovs_dpdk_port.driver, self.noop) - if not self.noop: + if not self.noop and (not utils.is_mellanox_interface(ifname)): remove_ifcfg_config(ifname) data = self._add_common(ovs_dpdk_port) @@ -981,7 +982,7 @@ class IfcfgNetConfig(os_net_config.NetConfig): # checks are added at the object creation stage. ifname = dpdk_port.members[0].name utils.bind_dpdk_interfaces(ifname, dpdk_port.driver, self.noop) - if not self.noop: + if not self.noop and (not utils.is_mellanox_interface(ifname)): remove_ifcfg_config(ifname) data = self._add_common(ovs_dpdk_bond)