1 # Copyright (c) 2017 Intel Corporation.
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
7 # http://www.apache.org/licenses/LICENSE-2.0
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
15 #- patch: src="{{ item }}" basedir="{{ dpdk_path }}" strip=0
17 # - "{{ local_nsb_path }}/patches/dpdk_custom_patch/rte_pipeline.patch"
19 #- patch: src="{{ item }}" basedir="{{ dpdk_path }}" strip=1
21 # - "{{ local_nsb_path }}/patches/dpdk_custom_patch/0*.patch"
27 - name: find kernel for image, (including chroot)
29 kernel: "{{ ansible_kernel }}"
30 register: found_kernel
32 # Do this before installing kernel headers
33 - name: Set dpdk_kernel to be the kernel we found
35 dpdk_kernel: "{{ found_kernel.kernel }}"
37 - include: "{{ ansible_os_family }}.yml"
39 - name: set RTE_KERNELDIR to point to found kernel
41 RTE_KERNELDIR: "/lib/modules/{{ dpdk_kernel }}/build"
43 - command: make -j {{ ansible_processor_vcpus }} config T={{ dpdk_make_arch }} O={{ dpdk_make_arch }}
45 chdir: "{{ dpdk_path }}"
47 RTE_KERNELDIR: "{{ RTE_KERNELDIR }}"
49 - name: enable RTE_PORT_STATS_COLLECT
51 dest: "{{ dpdk_path }}/{{ dpdk_make_arch }}/.config"
52 regexp: '^CONFIG_RTE_PORT_STATS_COLLECT=n'
53 line: 'CONFIG_RTE_PORT_STATS_COLLECT=y'
55 - name: enable DPDK RTE_PORT_PCAP
57 dest: "{{ dpdk_path }}/{{ dpdk_make_arch }}/.config"
58 regexp: '^CONFIG_RTE_PORT_PCAP=n'
59 line: 'CONFIG_RTE_PORT_PCAP=y'
61 - name: enable DPDK RTE_TABLE_STATS_COLLECT
63 dest: "{{ dpdk_path }}/{{ dpdk_make_arch }}/.config"
64 regexp: '^CONFIG_RTE_TABLE_STATS_COLLECT=n'
65 line: 'CONFIG_RTE_TABLE_STATS_COLLECT=y'
67 - name: enable DPDK RTE_PIPELINE_STATS_COLLECT
69 dest: "{{ dpdk_path }}/{{ dpdk_make_arch }}/.config"
70 regexp: '^CONFIG_RTE_PIPELINE_STATS_COLLECT=n'
71 line: 'CONFIG_RTE_PIPELINE_STATS_COLLECT=y'
73 # This is requied for collectd? but it breaks PROX?
74 #- name: enable CONFIG_RTE_BUILD_SHARED_LIB
76 # dest: "{{ dpdk_path }}/{{ dpdk_make_arch }}/.config"
77 # regexp: '^CONFIG_RTE_BUILD_SHARED_LIB=n'
78 # line: 'CONFIG_RTE_BUILD_SHARED_LIB=y'
80 #- name: enable DPDK CONFIG_RTE_EAL_PMD_PATH
82 # dest: "{{ dpdk_path }}/{{ dpdk_make_arch }}/.config"
83 # regexp: '^CONFIG_RTE_EAL_PMD_PATH=""'
84 # line: 'CONFIG_RTE_EAL_PMD_PATH="{{ dpdk_pmd_path }}"'
89 command: make -j {{ ansible_processor_vcpus }}
91 chdir: "{{ dpdk_path }}/{{ dpdk_make_arch}}"
93 RTE_KERNELDIR: "{{ RTE_KERNELDIR }}"
95 #- name: make install DPDK into /usr for collectd and other programs
97 # chdir: "{{ dpdk_path }}/{{ dpdk_make_arch}}"
99 # params: "T={{ RTE_TARGET }}"
100 ## params: "prefix={{ usr_prefix }}"
102 # RTE_KERNELDIR: "{{ RTE_KERNELDIR }}"
106 path: "{{ dpdk_module_dir}}"
110 src: "{{ dpdk_path }}/{{ dpdk_make_arch }}/kmod/igb_uio.ko"
111 dest: "{{ dpdk_module_dir }}/igb_uio.ko"
113 when: dpdk_version is version(dpdk_version_for_PROX, '>=')
115 - name: run depmod for dpdk_kernel
116 command: depmod "{{ dpdk_kernel }}"
119 path: "{{ INSTALL_BIN_PATH }}"
122 - name: copy dpdk-devbind.py to correct location
124 src: "{{ dpdk_devbind_usertools if dpdk_version is version('17.02', '>=') else dpdk_devbind_tools }}"
125 dest: "{{ INSTALL_BIN_PATH }}/dpdk-devbind.py"
129 when: dpdk_version is version(dpdk_version_for_PROX, '>=')
131 - name: make vPE binary
132 command: make -j {{ ansible_processor_vcpus }}
134 chdir: "{{ dpdk_path }}/examples/ip_pipeline"
136 RTE_SDK: "{{ dpdk_path }}"
137 when: dpdk_version is version(dpdk_version_for_PROX, '!=')
139 - name: Copy vPE to correct location
141 src: "{{ dpdk_path }}/examples/ip_pipeline/build/app/ip_pipeline"
142 dest: "{{ INSTALL_BIN_PATH }}/vPE_vnf"
146 when: dpdk_version is version(dpdk_version_for_PROX, '!=')