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
This commit is contained in:
vcandappa 2022-11-03 11:39:43 +05:30
parent 84f11c7468
commit e752fbac78
1 changed files with 3 additions and 2 deletions

View File

@ -52,6 +52,7 @@ def remove_ifcfg_config(ifname):
if re.match(r'[\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)
@ -995,7 +996,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 common.is_mellanox_interface(ifname)):
remove_ifcfg_config(ifname)
data = self._add_common(ovs_dpdk_port)
@ -1025,7 +1026,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 common.is_mellanox_interface(ifname)):
remove_ifcfg_config(ifname)
data = self._add_common(ovs_dpdk_bond)