Bug 1918979

Summary: os-net-config maps DPDK NICs twice if they are already active
Product: Red Hat OpenStack Reporter: Dan Sneddon <dsneddon>
Component: os-net-configAssignee: Dan Sneddon <dsneddon>
Status: CLOSED ERRATA QA Contact: Paras Babbar <pbabbar>
Severity: high Docs Contact:
Priority: high    
Version: 16.2 (Train)CC: bfournie, hbrock, jslagle, mburns, nlevinki, pbabbar, pgodwin, sbaker
Target Milestone: betaKeywords: Triaged
Target Release: 16.2 (Train on RHEL 8.4)   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: os-net-config-11.3.2-2.20210202005818.310a30e.el8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1918036
: 1945118 (view as bug list) Environment:
Last Closed: 2021-09-15 07:11:11 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1918036    
Bug Blocks: 1945118    

Description Dan Sneddon 2021-01-21 20:21:32 UTC
+++ This bug was initially created as a clone of Bug #1918036 +++

Description of problem:
When os-net-config runs for the first time there is no entry in /sys/class/net for the DPDK NICs, so we look in /var/lib/os-net-config/dpdk_mapping.yaml for the list of DPDK NICs and add them to the NIC mapping list.

If os-net-config has been run before and the DPDK NICs are already active, there is an entry in /sys/class/net and also an entry in /var/lib/os-net-config/dpdk_mapping.yaml for the NIC. This results in the same NIC being added to the list of active NICs twice.

For example, in the following log you can see that p2p1, p2p2, p3p1, and p3p2 are each added to the list of active NICs twice:

Jan 11 12:03:14 hostname os-collect-config: [2021/01/11 11:58:07 AM] [INFO] Active nics are ['em1', 'em2', 'p1p1', 'p1p2', 'p2p1', 'p2p1', 'p2p2', 'p2p2', 'p3p1', 'p3p1', 'p3p2',
'p3p2']
Jan 11 12:03:14 cpt0-dpdk-dell-tovb os-collect-config: [2021/01/11 11:58:07 AM] [INFO] nic2 mapped to: em2
Jan 11 12:03:14 cpt0-dpdk-dell-tovb os-collect-config: [2021/01/11 11:58:07 AM] [INFO] nic3 mapped to: p1p1
Jan 11 12:03:14 cpt0-dpdk-dell-tovb os-collect-config: [2021/01/11 11:58:07 AM] [INFO] nic4 mapped to: p1p2
Jan 11 12:03:14 cpt0-dpdk-dell-tovb os-collect-config: [2021/01/11 11:58:07 AM] [INFO] nic7 mapped to: p2p2
Jan 11 12:03:14 cpt0-dpdk-dell-tovb os-collect-config: [2021/01/11 11:58:07 AM] [INFO] nic5 mapped to: p2p1
Jan 11 12:03:14 cpt0-dpdk-dell-tovb os-collect-config: [2021/01/11 11:58:07 AM] [INFO] nic1 mapped to: em1
Jan 11 12:03:14 cpt0-dpdk-dell-tovb os-collect-config: [2021/01/11 11:58:07 AM] [INFO] nic11 mapped to: p3p2
Jan 11 12:03:14 cpt0-dpdk-dell-tovb os-collect-config: [2021/01/11 11:58:07 AM] [INFO] nic9 mapped to: p3p1


Version-Release number of selected component (if applicable):
All versions

How reproducible:
100%

Steps to Reproduce:
1. Run deployment with ComputeDPDK role
2. Set NetworkDeploymentActions: ["CREATE","UPDATE"]
3. Update stack

Actual results:
The active DPDK NICs are added to the list of active NICs twice.

Expected results:
The list of active NICs should be correct whether or not they are DPDK NICs.

Additional info:
In order to fix this problem, we should check to see if a NIC name exists in the list of active NICs before adding it in utils._ordered_nics():

241 # Adding nics which are bound to DPDK as it will not be found in '/sys'
242 # after it is bound to DPDK driver.
243 contents = get_file_data(_DPDK_MAPPING_FILE)
244 if contents:
245 dpdk_map = yaml.safe_load(contents)
246 for item in dpdk_map:
247 # If the DPDK drivers are bound to a VF, the same needs
248 # to be skipped for the NIC ordering
249 nic = item['name']
250 if _is_vf(item['pci_address']):
251 logger.info("%s is a VF, skipping it for NIC ordering" % nic)
252 elif _is_embedded_nic(nic):
253 logger.info("%s is an embedded DPDK bound nic" % nic)
254 embedded_nics.append(nic) # <-- Check needed here
255 else:
256 logger.info("%s is an DPDK bound nic" % nic)
257 nics.append(nic) # <-- Check needed here

Comment 9 errata-xmlrpc 2021-09-15 07:11:11 UTC
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 (RHOSP) 16.2 enhancement 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/RHEA-2021:3483