Description of problem: os-net-config is failing when trying to configure ovs ports with mellanox VFs Getting this error Jun 18 05:42:25 computeovsdpdksriov-0 os-collect-config: [2020/06/18 05:31:20 AM] [INFO] Driver (mlx5_core) is already bound to the device (p6p2_3) Jun 18 05:42:25 computeovsdpdksriov-0 os-collect-config: [2020/06/18 05:31:20 AM] [INFO] Driver (mlx5_core) is already bound to the device (p6p1_3) Jun 18 05:42:25 computeovsdpdksriov-0 os-collect-config: [2020/06/18 05:31:20 AM] [INFO] Getting devargs for Mellanox cards Jun 18 05:42:25 computeovsdpdksriov-0 os-collect-config: Traceback (most recent call last): Jun 18 05:42:25 computeovsdpdksriov-0 os-collect-config: File "/usr/bin/os-net-config", line 10, in <module> Jun 18 05:42:25 computeovsdpdksriov-0 os-collect-config: sys.exit(main()) Jun 18 05:42:25 computeovsdpdksriov-0 os-collect-config: File "/usr/lib/python2.7/site-packages/os_net_config/cli.py", line 337, in main Jun 18 05:42:25 computeovsdpdksriov-0 os-collect-config: provider.add_object(obj) Jun 18 05:42:25 computeovsdpdksriov-0 os-collect-config: File "/usr/lib/python2.7/site-packages/os_net_config/__init__.py", line 70, in add_object Jun 18 05:42:25 computeovsdpdksriov-0 os-collect-config: self.add_object(member) Jun 18 05:42:25 computeovsdpdksriov-0 os-collect-config: File "/usr/lib/python2.7/site-packages/os_net_config/__init__.py", line 104, in add_object Jun 18 05:42:25 computeovsdpdksriov-0 os-collect-config: self.add_ovs_dpdk_bond(obj) Jun 18 05:42:25 computeovsdpdksriov-0 os-collect-config: File "/usr/lib/python2.7/site-packages/os_net_config/impl_ifcfg.py", line 926, in add_ovs_dpdk_bond Jun 18 05:42:25 computeovsdpdksriov-0 os-collect-config: data = self._add_common(ovs_dpdk_bond) Jun 18 05:42:25 computeovsdpdksriov-0 os-collect-config: File "/usr/lib/python2.7/site-packages/os_net_config/impl_ifcfg.py", line 543, in _add_common Jun 18 05:42:25 computeovsdpdksriov-0 os-collect-config: bond_member.members[0].name, self.noop) Jun 18 05:42:25 computeovsdpdksriov-0 os-collect-config: File "/usr/lib/python2.7/site-packages/os_net_config/utils.py", line 404, in get_dpdk_devargs Jun 18 05:42:25 computeovsdpdksriov-0 os-collect-config: logger.debug("Devargs found: %s" % (dpdk_devargs)) Jun 18 05:42:25 computeovsdpdksriov-0 os-collect-config: UnboundLocalError: local variable 'dpdk_devargs' referenced before assignment Using this configuration: - type: ovs_user_bridge name: br-link0 use_dhcp: false ovs_extra: - str_replace: template: set port br-link0 tag=_VLAN_TAG_ params: _VLAN_TAG_: get_param: TenantNetworkVlanID addresses: - ip_netmask: get_param: TenantIpSubnet members: - type: ovs_dpdk_bond name: dpdkbond0 mtu: 9000 rx_queue: 2 members: - type: ovs_dpdk_port driver: mlx5_core name: dpdk0 members: - type: sriov_vf device: nic12 vfid: 3 - type: ovs_dpdk_port driver: mlx5_core name: dpdk1 members: - type: sriov_vf device: nic11 vfid: 3 Nic used: [root@computeovsdpdksriov-0 log]# ethtool -i p6p1 driver: mlx5_core version: 5.0-0 firmware-version: 16.27.2008 (MT_0000000008) expansion-rom-version: bus-info: 0000:04:00.0 supports-statistics: yes supports-test: yes supports-eeprom-access: no supports-register-dump: no supports-priv-flags: yes [root@computeovsdpdksriov-0 log]# ethtool -i p6p2 driver: mlx5_core version: 5.0-0 firmware-version: 16.27.2008 (MT_0000000008) expansion-rom-version: bus-info: 0000:04:00.1 supports-statistics: yes supports-test: yes supports-eeprom-access: no supports-register-dump: no supports-priv-flags: yes Vfs: 11: p6p1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT group default qlen 1000 link/ether 98:03:9b:9c:50:58 brd ff:ff:ff:ff:ff:ff vf 0 MAC 00:00:00:00:00:00, spoof checking off, link-state auto, trust off, query_rss off vf 1 MAC 00:00:00:00:00:00, spoof checking off, link-state auto, trust off, query_rss off vf 2 MAC 00:00:00:00:00:00, spoof checking off, link-state auto, trust off, query_rss off vf 3 MAC 00:00:00:00:00:00, spoof checking off, link-state auto, trust off, query_rss off vf 4 MAC 00:00:00:00:00:00, spoof checking off, link-state auto, trust off, query_rss off vf 5 MAC 00:00:00:00:00:00, spoof checking off, link-state auto, trust off, query_rss off vf 6 MAC 00:00:00:00:00:00, spoof checking off, link-state auto, trust off, query_rss off vf 7 MAC 00:00:00:00:00:00, spoof checking off, link-state auto, trust off, query_rss off vf 8 MAC 00:00:00:00:00:00, spoof checking off, link-state auto, trust off, query_rss off vf 9 MAC 00:00:00:00:00:00, spoof checking off, link-state auto, trust off, query_rss off vf 10 MAC 00:00:00:00:00:00, spoof checking off, link-state auto, trust off, query_rss off vf 11 MAC 00:00:00:00:00:00, spoof checking off, link-state auto, trust off, query_rss off vf 12 MAC 00:00:00:00:00:00, spoof checking off, link-state auto, trust off, query_rss off vf 13 MAC 00:00:00:00:00:00, spoof checking off, link-state auto, trust off, query_rss off 13: p6p2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT group default qlen 1000 link/ether 98:03:9b:9c:50:59 brd ff:ff:ff:ff:ff:ff vf 0 MAC 00:00:00:00:00:00, spoof checking off, link-state auto, trust off, query_rss off vf 1 MAC 00:00:00:00:00:00, spoof checking off, link-state auto, trust off, query_rss off vf 2 MAC 00:00:00:00:00:00, spoof checking off, link-state auto, trust off, query_rss off vf 3 MAC 00:00:00:00:00:00, spoof checking off, link-state auto, trust off, query_rss off vf 4 MAC 00:00:00:00:00:00, spoof checking off, link-state auto, trust off, query_rss off vf 5 MAC 00:00:00:00:00:00, spoof checking off, link-state auto, trust off, query_rss off vf 6 MAC 00:00:00:00:00:00, spoof checking off, link-state auto, trust off, query_rss off vf 7 MAC 00:00:00:00:00:00, spoof checking off, link-state auto, trust off, query_rss off vf 8 MAC 00:00:00:00:00:00, spoof checking off, link-state auto, trust off, query_rss off vf 9 MAC 00:00:00:00:00:00, spoof checking off, link-state auto, trust off, query_rss off vf 10 MAC 00:00:00:00:00:00, spoof checking off, link-state auto, trust off, query_rss off vf 11 MAC 00:00:00:00:00:00, spoof checking off, link-state auto, trust off, query_rss off vf 12 MAC 00:00:00:00:00:00, spoof checking off, link-state auto, trust off, query_rss off Version-Release number of selected component (if applicable): Version: osp13 2020-06-09.2 os-net-config-8.5.1-5.el7ost.noarch How reproducible: Deploy nic partitioning over ovs using mellanox nics Actual results: Deployment fails Expected results: Deployment should be executed sucessfully Additional info: I will upload sosreports
get_dpdk_devargs() function in utils.py of os-net-config is trying to get the pci address (from stored file for intel nics and from active nic for mellanox nics). In case of Mellanox VF, it will not be considerd as active nic, because of which it is failing. Handle the mellanox VF case too in this function to provide correct pci address of the VF. It has to be patched in os-net-config.
Created attachment 1700726 [details] utils.py fix for os-net-config
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory (Red Hat OpenStack Platform 13.0 director bug fix advisory), and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2020:4388