summaryrefslogtreecommitdiffstats
path: root/sw_config/bmra/dpdk_patch.yml
diff options
context:
space:
mode:
authorMichael S. Pedersen <michaelx.pedersen@intel.com>2021-01-15 09:59:13 +0000
committerMichael Pedersen <michaelx.pedersen@intel.com>2021-01-20 14:02:00 +0000
commit7eae11323bd3dfc857a66e8fd1049c103a4eac22 (patch)
treee66849bc56157c8005006ab0a18af9bfb420d2fa /sw_config/bmra/dpdk_patch.yml
parenteeb718b8b545d7afc52f9a2e9e18c9af5f7299b8 (diff)
Fix a set of issues with K8s deployment
[KUB-37] BMRA v2.0 fails to install on Centos 8.3 [KUB-38] [BMRA] Helm repo is unreachable [KUB-39] [BMRA] CMK binary doesn't run on Centos 8 [KUB-40] [BMRA] CMK isn't installed on host [KUB-41] [Equinix Metal] Unexpected GRUB settings on CentOS Signed-off-by: Michael S. Pedersen <michaelx.pedersen@intel.com> Change-Id: Ie7deb0517cda02352936420a9d36348238caa467 Reviewed-on: https://gerrit.opnfv.org/gerrit/c/kuberef/+/71784 Tested-by: jenkins-ci <jenkins-opnfv-ci@opnfv.org> Reviewed-by: Rihab Banday <rihab.banday@ericsson.com>
Diffstat (limited to 'sw_config/bmra/dpdk_patch.yml')
-rw-r--r--sw_config/bmra/dpdk_patch.yml111
1 files changed, 111 insertions, 0 deletions
diff --git a/sw_config/bmra/dpdk_patch.yml b/sw_config/bmra/dpdk_patch.yml
new file mode 100644
index 0000000..ec77b39
--- /dev/null
+++ b/sw_config/bmra/dpdk_patch.yml
@@ -0,0 +1,111 @@
+##
+## 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.
+##
+---
+- name: install dependencies
+ include_role:
+ name: install_dependencies
+
+- name: download DPDK
+ unarchive:
+ src: "{{ dpdk_url }}"
+ dest: "/usr/src"
+ remote_src: yes
+ list_files: yes
+ mode: 0755
+ register: dpdk_download
+
+- name: set local dpdk directory path
+ set_fact:
+ dpdk_dir: "{{ dpdk_download.dest }}/{{ dpdk_download.files[0] }}"
+
+- name: run make config
+ make:
+ chdir: "{{ dpdk_dir }}"
+ target: config
+ params:
+ T: "{{ dpdk_target }}"
+
+- name: update ansible_kernel fact
+ setup:
+ filter: 'ansible_kernel'
+
+- name: patch DPDK (kni)
+ lineinfile:
+ path: "{{ dpdk_dir }}/kernel/linux/kni/kni_net.c"
+ regexp: '^\s*kni_net_tx_timeout'
+ line: 'kni_net_tx_timeout(struct net_device *dev, unsigned int txqueue)'
+ when:
+ - ansible_distribution == "CentOS"
+ - ansible_distribution_major_version == '8'
+ - ansible_kernel is version('4.18.0-240','>=')
+
+- name: enable virtio-user support
+ lineinfile:
+ path: "{{ dpdk_dir }}/build/.config"
+ regexp: '^CONFIG_RTE_VIRTIO_USER'
+ line: 'CONFIG_RTE_VIRTIO_USER=y'
+ mode: 0600
+
+- name: enable PCAP PMD support
+ lineinfile:
+ path: "{{ dpdk_dir }}/build/.config"
+ regexp: '^CONFIG_RTE_LIBRTE_PMD_PCAP'
+ line: 'CONFIG_RTE_LIBRTE_PMD_PCAP=y'
+ mode: 0600
+
+- name: build DPDK
+ make:
+ target: install
+ chdir: "{{ dpdk_dir }}"
+ params:
+ T: "{{ dpdk_target }}"
+ DESTDIR: install
+ prefix: "/usr"
+
+- name: find dpdk tools
+ find:
+ path: "{{ dpdk_dir }}"
+ patterns: "dpdk-devbind.py"
+ recurse: yes
+ register: dpdk_tools_dir
+
+- name: set path to dpdk usertools directory
+ set_fact:
+ dpdk_tools: "{{ dpdk_tools_dir.files[0].path }}"
+
+- name: load userspace modules
+ modprobe:
+ name: "{{ item }}"
+ state: present
+ with_items:
+ - vfio-pci
+ - uio
+
+- name: install dpdk-devbind.py in /usr/local/bin
+ copy:
+ remote_src: yes
+ src: "{{ dpdk_tools }}"
+ dest: "/usr/local/bin/dpdk-devbind.py"
+ mode: 0700
+ owner: root
+ group: root
+ become: yes
+
+- name: load intel module
+ command: "insmod {{ dpdk_dir }}/{{ dpdk_target }}/kmod/igb_uio.ko"
+ register: result
+ failed_when: "'No such file or directory' in result.stderr"
+ changed_when: "'already bound' not in result.stderr"