add yardstick iruya 9.0.0 release notes
[yardstick.git] / ansible / roles / install_dpdk_shared / tasks / main.yml
1 # Copyright (c) 2017 Intel Corporation.
2 #
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
6 #
7 #      http://www.apache.org/licenses/LICENSE-2.0
8 #
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.
14 ---
15 #- patch: src="{{ item }}" basedir="{{ dpdk_path }}" strip=0
16 #  with_fileglob:
17 #    - "{{ local_nsb_path }}/patches/dpdk_custom_patch/rte_pipeline.patch"
18 #
19 #- patch: src="{{ item }}" basedir="{{ dpdk_path }}" strip=1
20 #  with_fileglob:
21 #    - "{{ local_nsb_path }}/patches/dpdk_custom_patch/0*.patch"
22
23 - name: set DPDK shared dir
24   set_fact:
25     dpdk_shared_path: "{{ dpdk_path }}-shared"
26
27 - command: "cp -a {{ dpdk_path }} {{ dpdk_shared_path }}"
28
29 - name: find kernel for image, (including chroot)
30   find_kernel:
31     kernel: "{{ ansible_kernel }}"
32   register: found_kernel
33
34 # Do this before installing kernel headers
35 - name: Set dpdk_kernel to be the kernel we found
36   set_fact:
37     dpdk_kernel: "{{ found_kernel.kernel }}"
38
39 - include: "{{ ansible_os_family }}.yml"
40
41 - name: set RTE_KERNELDIR to point to found kernel
42   set_fact:
43     RTE_KERNELDIR: "/lib/modules/{{ dpdk_kernel }}/build"
44
45 # make clean must be run here as DPDK-shared is a copy of the DPDK directory
46 # which has already run the make command
47 # no T= target for clean
48 - command: make -j {{ ansible_processor_vcpus }} clean O={{ dpdk_make_arch }}
49   args:
50     chdir: "{{ dpdk_shared_path }}"
51   environment:
52     RTE_KERNELDIR: "{{ RTE_KERNELDIR }}"
53
54 - command: make -j {{ ansible_processor_vcpus }} config  T={{ dpdk_make_arch }} O={{ dpdk_make_arch }}
55   args:
56     chdir: "{{ dpdk_shared_path }}"
57   environment:
58     RTE_KERNELDIR: "{{ RTE_KERNELDIR }}"
59
60 - name: enable RTE_PORT_STATS_COLLECT
61   lineinfile:
62     dest: "{{ dpdk_shared_path }}/{{ dpdk_make_arch }}/.config"
63     regexp: '^CONFIG_RTE_PORT_STATS_COLLECT=n'
64     line: 'CONFIG_RTE_PORT_STATS_COLLECT=y'
65
66 - name: enable DPDK RTE_PORT_PCAP
67   lineinfile:
68     dest: "{{ dpdk_shared_path }}/{{ dpdk_make_arch }}/.config"
69     regexp: '^CONFIG_RTE_PORT_PCAP=n'
70     line: 'CONFIG_RTE_PORT_PCAP=y'
71
72 - name: enable DPDK RTE_TABLE_STATS_COLLECT
73   lineinfile:
74     dest: "{{ dpdk_shared_path }}/{{ dpdk_make_arch }}/.config"
75     regexp: '^CONFIG_RTE_TABLE_STATS_COLLECT=n'
76     line: 'CONFIG_RTE_TABLE_STATS_COLLECT=y'
77
78 - name: enable DPDK RTE_PIPELINE_STATS_COLLECT
79   lineinfile:
80     dest: "{{ dpdk_shared_path }}/{{ dpdk_make_arch }}/.config"
81     regexp: '^CONFIG_RTE_PIPELINE_STATS_COLLECT=n'
82     line: 'CONFIG_RTE_PIPELINE_STATS_COLLECT=y'
83
84 # This is requied for collectd but VNFs can't use shared DPDK
85 - name: enable CONFIG_RTE_BUILD_SHARED_LIB
86   lineinfile:
87     dest: "{{ dpdk_shared_path }}/{{ dpdk_make_arch }}/.config"
88     regexp: '^CONFIG_RTE_BUILD_SHARED_LIB=n'
89     line: 'CONFIG_RTE_BUILD_SHARED_LIB=y'
90
91 - name: enable DPDK CONFIG_RTE_EAL_PMD_PATH
92   lineinfile:
93     dest: "{{ dpdk_shared_path }}/{{ dpdk_make_arch }}/.config"
94     regexp: '^CONFIG_RTE_EAL_PMD_PATH=""'
95     line: 'CONFIG_RTE_EAL_PMD_PATH="{{ dpdk_pmd_path }}"'
96
97 # TODO: disable ASLR
98
99 - command: make -j {{ ansible_processor_vcpus }}
100   args:
101     chdir: "{{ dpdk_shared_path }}/{{ dpdk_make_arch}}"
102   environment:
103     RTE_KERNELDIR: "{{ RTE_KERNELDIR }}"
104
105 #- name: make install DPDK into /usr for collectd and other programs
106 #  make:
107 #    chdir: "{{ dpdk_shared_path }}/{{ dpdk_make_arch}}"
108 #    target: install
109 #    params: "T={{ RTE_TARGET }}"
110 ##    params: "prefix={{ usr_prefix }}"
111 #  environment:
112 #    RTE_KERNELDIR: "{{ RTE_KERNELDIR }}"
113 #  become: yes
114
115 # don't install module or copy dpdk-devbind
116