sriovdp_config: Improvements and fixes 37/2237/1
authorAlexandru Avadanii <Alexandru.Avadanii@enea.com>
Thu, 13 Feb 2020 12:00:37 +0000 (13:00 +0100)
committerAlexandru Avadanii <Alexandru.Avadanii@enea.com>
Thu, 13 Feb 2020 13:52:42 +0000 (14:52 +0100)
- do not fail sriovdp_config role if no PCI devices are matched by
  grep (e.g. for the old pattern, no PCI devices in PCI domain 0);
- allow network interface names that don't start with 'en', e.g. em1,
  p1p127;
- allow PCI devices on other domains than hardcoded '0000';
- Use full PCI address in /etc/pcidp/config.json for the newly allowed
  PCI domains (this is also supported, see [1], but for covenience they
  were left on default '0000');

[1] https://bugzilla.redhat.com/show_bug.cgi?id=1770642

Change-Id: I117966a5530d4b1003154bf7cf8182986db112e8
Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
infra-ansible.spec
roles/sriovdp_config/tasks/main.yaml

index 6661a11..488b4ed 100644 (file)
@@ -15,7 +15,7 @@
 
 Name:           infra-ansible
 Version:        %{_version}
-Release:        8%{?dist}
+Release:        9%{?dist}
 Summary:        Contains ansible playbook and roles for Akraino rec blueprint
 License:        %{_platform_licence}
 Source0:        %{name}-%{version}.tar.gz
index 3440c82..54e76df 100644 (file)
@@ -15,7 +15,7 @@
 # limitations under the License.
 
 - name: collect network device PCI addresses
-  shell: dpdk-devbind --status-dev net | grep "^0000.*if=en"
+  shell: dpdk-devbind --status-dev net | egrep "^[0-9a-fA-F]{4}\b.*if=" || true
   register: devbind
 
 - set_fact:
@@ -23,7 +23,7 @@
     iface: []
 
 - set_fact:
-    pci: "{{ pci }} + {{ [ item.split()[0][5:12] ] }}"
+    pci: "{{ pci }} + {{ [ item.split()[0][:12] ] }}"
     iface: "{{ iface }} + {{ [ item.split(' if=')[1].split()[0] ] }}"
   with_items: "{{ devbind.stdout_lines }}"