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"
23 - name: set DPDK shared dir
25 dpdk_shared_path: "{{ dpdk_path }}-shared"
27 - command: "cp -a {{ dpdk_path }} {{ dpdk_shared_path }}"
29 - name: find kernel for image, (including chroot)
31 kernel: "{{ ansible_kernel }}"
32 register: found_kernel
34 # Do this before installing kernel headers
35 - name: Set dpdk_kernel to be the kernel we found
37 dpdk_kernel: "{{ found_kernel.kernel }}"
39 - include: "{{ ansible_os_family }}.yml"
41 - name: set RTE_KERNELDIR to point to found kernel
43 RTE_KERNELDIR: "/lib/modules/{{ dpdk_kernel }}/build"
45 - command: make -j {{ ansible_processor_vcpus }} config T={{ dpdk_make_arch }} O={{ dpdk_make_arch }}
47 chdir: "{{ dpdk_shared_path }}"
49 RTE_KERNELDIR: "{{ RTE_KERNELDIR }}"
51 - name: enable RTE_PORT_STATS_COLLECT
53 dest: "{{ dpdk_shared_path }}/{{ dpdk_make_arch }}/.config"
54 regexp: '^CONFIG_RTE_PORT_STATS_COLLECT=n'
55 line: 'CONFIG_RTE_PORT_STATS_COLLECT=y'
57 - name: enable DPDK RTE_PORT_PCAP
59 dest: "{{ dpdk_shared_path }}/{{ dpdk_make_arch }}/.config"
60 regexp: '^CONFIG_RTE_PORT_PCAP=n'
61 line: 'CONFIG_RTE_PORT_PCAP=y'
63 - name: enable DPDK RTE_TABLE_STATS_COLLECT
65 dest: "{{ dpdk_shared_path }}/{{ dpdk_make_arch }}/.config"
66 regexp: '^CONFIG_RTE_TABLE_STATS_COLLECT=n'
67 line: 'CONFIG_RTE_TABLE_STATS_COLLECT=y'
69 - name: enable DPDK RTE_PIPELINE_STATS_COLLECT
71 dest: "{{ dpdk_shared_path }}/{{ dpdk_make_arch }}/.config"
72 regexp: '^CONFIG_RTE_PIPELINE_STATS_COLLECT=n'
73 line: 'CONFIG_RTE_PIPELINE_STATS_COLLECT=y'
75 # This is requied for collectd but VNFs can't use shared DPDK
76 - name: enable CONFIG_RTE_BUILD_SHARED_LIB
78 dest: "{{ dpdk_shared_path }}/{{ dpdk_make_arch }}/.config"
79 regexp: '^CONFIG_RTE_BUILD_SHARED_LIB=n'
80 line: 'CONFIG_RTE_BUILD_SHARED_LIB=y'
82 - name: enable DPDK CONFIG_RTE_EAL_PMD_PATH
84 dest: "{{ dpdk_shared_path }}/{{ dpdk_make_arch }}/.config"
85 regexp: '^CONFIG_RTE_EAL_PMD_PATH=""'
86 line: 'CONFIG_RTE_EAL_PMD_PATH="{{ dpdk_pmd_path }}"'
88 # no T= target for clean
89 - command: make -j {{ ansible_processor_vcpus }} clean O={{ dpdk_make_arch }}
91 chdir: "{{ dpdk_shared_path }}"
93 RTE_KERNELDIR: "{{ RTE_KERNELDIR }}"
97 - command: make -j {{ ansible_processor_vcpus }}
99 chdir: "{{ dpdk_shared_path }}/{{ dpdk_make_arch}}"
101 RTE_KERNELDIR: "{{ RTE_KERNELDIR }}"
103 #- name: make install DPDK into /usr for collectd and other programs
105 # chdir: "{{ dpdk_shared_path }}/{{ dpdk_make_arch}}"
107 # params: "T={{ RTE_TARGET }}"
108 ## params: "prefix={{ usr_prefix }}"
110 # RTE_KERNELDIR: "{{ RTE_KERNELDIR }}"
113 # don't install module or copy dpdk-devbind