2 ## Copyright (c) 2020 Intel Corporation.
4 ## Licensed under the Apache License, Version 2.0 (the "License");
5 ## you may not use this file except in compliance with the License.
6 ## You may obtain a copy of the License at
8 ## http://www.apache.org/licenses/LICENSE-2.0
10 ## Unless required by applicable law or agreed to in writing, software
11 ## distributed under the License is distributed on an "AS IS" BASIS,
12 ## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 ## See the License for the specific language governing permissions and
14 ## limitations under the License.
17 - name: install dependencies
19 name: install_dependencies
28 register: dpdk_download
30 - name: set local dpdk directory path
32 dpdk_dir: "{{ dpdk_download.dest }}/{{ dpdk_download.files[0] }}"
34 - name: run make config
36 chdir: "{{ dpdk_dir }}"
39 T: "{{ dpdk_target }}"
41 - name: update ansible_kernel fact
43 filter: 'ansible_kernel'
45 - name: patch DPDK (kni)
47 path: "{{ dpdk_dir }}/kernel/linux/kni/kni_net.c"
48 regexp: '^\s*kni_net_tx_timeout'
49 line: 'kni_net_tx_timeout(struct net_device *dev, unsigned int txqueue)'
51 - ansible_distribution == "CentOS"
52 - ansible_distribution_major_version == '8'
53 - ansible_kernel is version('4.18.0-240','>=')
55 - name: enable virtio-user support
57 path: "{{ dpdk_dir }}/build/.config"
58 regexp: '^CONFIG_RTE_VIRTIO_USER'
59 line: 'CONFIG_RTE_VIRTIO_USER=y'
62 - name: enable PCAP PMD support
64 path: "{{ dpdk_dir }}/build/.config"
65 regexp: '^CONFIG_RTE_LIBRTE_PMD_PCAP'
66 line: 'CONFIG_RTE_LIBRTE_PMD_PCAP=y'
72 chdir: "{{ dpdk_dir }}"
74 T: "{{ dpdk_target }}"
78 - name: find dpdk tools
80 path: "{{ dpdk_dir }}"
81 patterns: "dpdk-devbind.py"
83 register: dpdk_tools_dir
85 - name: set path to dpdk usertools directory
87 dpdk_tools: "{{ dpdk_tools_dir.files[0].path }}"
89 - name: load userspace modules
97 - name: install dpdk-devbind.py in /usr/local/bin
100 src: "{{ dpdk_tools }}"
101 dest: "/usr/local/bin/dpdk-devbind.py"
107 - name: load intel module
108 command: "insmod {{ dpdk_dir }}/{{ dpdk_target }}/kmod/igb_uio.ko"
110 failed_when: "'No such file or directory' in result.stderr"
111 changed_when: "'already bound' not in result.stderr"