Bug 1918979 - os-net-config maps DPDK NICs twice if they are already active
Summary: os-net-config maps DPDK NICs twice if they are already active
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat OpenStack
Classification: Red Hat
Component: os-net-config
Version: 16.2 (Train)
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: beta
: 16.2 (Train on RHEL 8.4)
Assignee: Dan Sneddon
QA Contact: Paras Babbar
URL:
Whiteboard:
Depends On: 1918036
Blocks: 1945118
TreeView+ depends on / blocked
 
Reported: 2021-01-21 20:21 UTC by Dan Sneddon
Modified: 2021-09-15 07:11 UTC (History)
8 users (show)

Fixed In Version: os-net-config-11.3.2-2.20210202005818.310a30e.el8
Doc Type: If docs needed, set a value
Doc Text:
Clone Of: 1918036
: 1945118 (view as bug list)
Environment:
Last Closed: 2021-09-15 07:11:11 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
OpenStack gerrit 771849 0 None MERGED Check to ensure active DPDK NICs only mapped once 2021-02-10 11:17:54 UTC
Red Hat Product Errata RHEA-2021:3483 0 None None None 2021-09-15 07:11:33 UTC

Internal Links: 1915299

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


Note You need to log in before you can comment on or make changes to this bug.