Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions os_net_config/impl_ifcfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -1272,6 +1272,12 @@ def del_ovs_dpdk_port(self, ovs_dpdk_port):
pci_address = self._get_dpdk_pci_addresses(ifcfg_dpdk)
self.del_device["dpdk_port"].extend(pci_address)

ifname = ovs_dpdk_port.members[0].name
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add check "if common.is_mellanox_interface()" ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it is not required. If the interface exists, it will be removed, if not it will proceed. Let us check in non mellanox cards as well

if common.is_vf_by_name(ifname):
self.del_device["sriov_vf"].append(ifname)
else:
self.del_device["iface"].append(ifname)

def add_ovs_dpdk_bond(self, ovs_dpdk_bond):
"""Add an OvsDPDKBond object to the net config object.

Expand Down Expand Up @@ -1319,6 +1325,14 @@ def del_ovs_dpdk_bond(self, ovs_dpdk_bond):
pci_address = self._get_dpdk_pci_addresses(ifcfg_dpdk)
self.del_device["dpdk_port"].extend(pci_address)

for dpdk_port in ovs_dpdk_bond.members:
if len(dpdk_port.members) > 0:
ifname = dpdk_port.members[0].name
if common.is_vf_by_name(ifname):
self.del_device["sriov_vf"].append(ifname)
else:
self.del_device["iface"].append(ifname)

def add_sriov_pf(self, sriov_pf):
"""Add a SriovPF object to the net config object

Expand Down
Loading