From d8894a8c996772f02c27f6b03ac438f42c96cbed Mon Sep 17 00:00:00 2001 From: Alexandru Avadanii Date: Thu, 13 Feb 2020 13:00:37 +0100 Subject: [PATCH] sriovdp_config: Improvements and fixes - 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 --- infra-ansible.spec | 2 +- roles/sriovdp_config/tasks/main.yaml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/infra-ansible.spec b/infra-ansible.spec index 6661a11..488b4ed 100644 --- a/infra-ansible.spec +++ b/infra-ansible.spec @@ -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 diff --git a/roles/sriovdp_config/tasks/main.yaml b/roles/sriovdp_config/tasks/main.yaml index 3440c82..54e76df 100644 --- a/roles/sriovdp_config/tasks/main.yaml +++ b/roles/sriovdp_config/tasks/main.yaml @@ -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 }}" -- 2.16.6