summaryrefslogtreecommitdiffstats
path: root/sw_config/bmra
diff options
context:
space:
mode:
authorMichael S. Pedersen <michaelx.pedersen@intel.com>2021-01-21 14:18:53 +0000
committerRihab Banday <rihab.banday@ericsson.com>2021-03-03 15:22:47 +0000
commite6d9e75675c91f5a69a0c968e3df33f63a22bb36 (patch)
tree006822ba720e67c70d334ae4567e827a33fbbaaf /sw_config/bmra
parentc3e3fe23c80d386a23a4344933bdc0c942dc5ba8 (diff)
Support Ubuntu 18.04 and 20.04 LTS as target OS
Fixes: [KUB-42] Add support for Ubuntu 18.04 and 20.04 LTS as host OS on target nodes Also includes patch for using vfio-pci module on Ubuntu 18.04 LTS Signed-off-by: Michael S. Pedersen <michaelx.pedersen@intel.com> Change-Id: Id6150ff30040addfdd7d860bec48583e33a25c59 Reviewed-on: https://gerrit.opnfv.org/gerrit/c/kuberef/+/71788 Tested-by: jenkins-ci <jenkins-opnfv-ci@opnfv.org> Reviewed-by: Rihab Banday <rihab.banday@ericsson.com>
Diffstat (limited to 'sw_config/bmra')
-rw-r--r--sw_config/bmra/patched_vfio.yml52
1 files changed, 52 insertions, 0 deletions
diff --git a/sw_config/bmra/patched_vfio.yml b/sw_config/bmra/patched_vfio.yml
new file mode 100644
index 0000000..c0a6e25
--- /dev/null
+++ b/sw_config/bmra/patched_vfio.yml
@@ -0,0 +1,52 @@
+##
+## Copyright (c) 2020 Intel Corporation.
+##
+## Licensed under the Apache License, Version 2.0 (the "License");
+## you may not use this file except in compliance with the License.
+## You may obtain a copy of the License at
+##
+## http://www.apache.org/licenses/LICENSE-2.0
+##
+## Unless required by applicable law or agreed to in writing, software
+## distributed under the License is distributed on an "AS IS" BASIS,
+## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+## See the License for the specific language governing permissions and
+## limitations under the License.
+##
+---
+# check if the selected driver module is available on host
+- name: Check that selected driver module is available
+ # if modinfo fails, lookup loaded modules as modinfo might return error
+ # for igb_uio and potentially other modules not included with the kernel
+ shell: "modinfo {{ vf_driver }} || grep {{ vf_driver }} /proc/modules || grep {{ vf_driver }} /lib/modules/$(uname -r)/modules.builtin"
+ register: shell_result
+ ignore_errors: yes
+ failed_when: no
+ changed_when: no
+
+# get a list of VFs PCI addresses and save the configuration
+- name: attach VFs driver
+ block:
+ - name: fetch VFs pci addresses for a PF
+ shell: "for vf in /sys/class/net/{{ pfname }}/device/virtfn*;do basename $(readlink -f $vf);done"
+ register: vf_pciids
+ args:
+ executable: /bin/bash
+ changed_when: false
+
+ - name: save VF driver binding
+ lineinfile:
+ path: "{{ sriov_config_path }}/bmra_interfaces"
+ line: "{{ this_item }} {{ vf_driver }}"
+ regexp: "^{{ this_item }}"
+ create: yes
+ owner: root
+ group: root
+ mode: '0600'
+ loop: "{{ vf_pciids.stdout_lines }}"
+ loop_control:
+ loop_var: this_item
+ when:
+ - vf_pciids.stderr|length == 0
+ - vf_pciids.stdout_lines|length > 0
+ when: shell_result.rc == 0