yardstick setup ansible, including load_images
[yardstick.git] / ansible / roles / install_dpdk / 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 - include: "{{ ansible_os_family }}.yml"
24
25 - my_make:
26     chdir: "{{ dpdk_path }}"
27     target: config
28     params:
29       T: "{{ dpdk_make_arch }}"
30       O: "{{ dpdk_make_arch }}"
31     extra_args: "-j {{ ansible_processor_vcpus }}"
32
33 - name: enable RTE_PORT_STATS_COLLECT
34   lineinfile:
35     dest: "{{ dpdk_path }}/{{ dpdk_make_arch }}/.config"
36     regexp: '^CONFIG_RTE_PORT_STATS_COLLECT=n'
37     line: 'CONFIG_RTE_PORT_STATS_COLLECT=y'
38
39 - name: enable DPDK RTE_PORT_PCAP
40   lineinfile:
41     dest: "{{ dpdk_path }}/{{ dpdk_make_arch }}/.config"
42     regexp: '^CONFIG_RTE_PORT_PCAP=n'
43     line: 'CONFIG_RTE_PORT_PCAP=y'
44
45 - name: enable DPDK RTE_TABLE_STATS_COLLECT
46   lineinfile:
47     dest: "{{ dpdk_path }}/{{ dpdk_make_arch }}/.config"
48     regexp: '^CONFIG_RTE_TABLE_STATS_COLLECT=n'
49     line: 'CONFIG_RTE_TABLE_STATS_COLLECT=y'
50
51 - name: enable DPDK RTE_PIPELINE_STATS_COLLECT
52   lineinfile:
53     dest: "{{ dpdk_path }}/{{ dpdk_make_arch }}/.config"
54     regexp: '^CONFIG_RTE_PIPELINE_STATS_COLLECT=n'
55     line: 'CONFIG_RTE_PIPELINE_STATS_COLLECT=y'
56
57 - my_make:
58     chdir: "{{ dpdk_path }}/{{ dpdk_make_arch}}"
59     extra_args: "-j {{ ansible_processor_vcpus }}"
60
61 - file:
62     path: "{{ dpdk_module_dir}}"
63     state: directory
64
65 - copy:
66     src: "{{ dpdk_path }}/{{ dpdk_make_arch }}/kmod/igb_uio.ko"
67     dest: "{{ dpdk_module_dir }}/igb_uio.ko"
68     remote_src: yes
69
70 - command: depmod -a
71
72 - file:
73     path: "{{ INSTALL_BIN_PATH }}"
74     state:  directory
75
76 - name: copy dpdk-devbind.py to correct location
77   copy:
78     src: "{{ dpdk_devbind[dpdk_version] }}"
79     dest: "{{ INSTALL_BIN_PATH }}/dpdk-devbind.py"
80     remote_src: yes
81     force: yes
82     mode: 0755
83
84 - name: make dpdk_nic_bind.py for backwards compatibility
85   copy:
86     src: "{{ dpdk_devbind[dpdk_version] }}"
87     dest: "{{ INSTALL_BIN_PATH }}/dpdk_nic_bind.py"
88     remote_src: yes
89     force: yes
90     mode: 0755