Skip to content

Commit e3e6f21

Browse files
mnietojiJenkins
authored andcommitted
Improve perf image and performance playbooks
* Generate a new image with latest rhel and drivers * Use dpdk packages instead of compiling dpdk (update playbooks and images) * Do not use old commands like dpdk-devbind.py, use driverctl instead * Do not use io mode in testpmd, use mac mode instead. According to OSPRH-13653, it provides non realistic results. * Vms configuration is permantent, so they can be rebooted and configuration will persist and performance can be run with any other configuration needed
1 parent a040964 commit e3e6f21

File tree

14 files changed

+94
-211
lines changed

14 files changed

+94
-211
lines changed
Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,16 @@
11
# Image Variables
2-
guest_image: 'http://download.eng.tlv.redhat.com/rhel-9/rel-eng/RHEL-9/latest-RHEL-9.2.0/compose/BaseOS/x86_64/images/rhel-guest-image-9.2-20230414.17.x86_64.qcow2'
2+
guest_image: 'http://download.hosts.prod.upshift.rdu2.redhat.com/rhel-9/rel-eng/RHEL-9/latest-RHEL-9.5.0/compose/BaseOS/x86_64/images/rhel-guest-image-9.5-20241009.2.x86_64.qcow2'
33
guest_image_output: '/tmp/'
44
guest_debug: False
55

66
# Repo Variables
77
repo_urls:
8-
- http://download.eng.tlv.redhat.com/rhel-9/rel-eng/RHEL-9/latest-RHEL-9.2.0/repofile.repo
8+
- http://download.hosts.prod.upshift.rdu2.redhat.com/rhel-9/rel-eng/RHEL-9/latest-RHEL-9.5.0/repofile.repo
99
repo_dir: '/tmp/guest_repos'
1010
guest_repos: []
1111

12-
# DPDK Variables
13-
dpdk_dir: '/root/dpdk'
14-
dpdk_customization_log: "{{ dpdk_dir }}/customization.log"
15-
dpdk_git: 'git://dpdk.org/dpdk'
16-
dpdk_branch: 'tags/v22.11'
17-
dpdk_compile_packages:
18-
- pyelftools
19-
2012
# Trex Variables
21-
trex_version: 'v3.02'
13+
trex_version: 'v3.06'
2214
trex_url: 'https://trex-tgn.cisco.com/trex/release'
2315
trex_dir: '/opt/trex/'
2416

@@ -41,7 +33,3 @@ fio_git: 'git://git.kernel.dk/fio.git'
4133
fio_dir: '/root/fio'
4234
fio_branch: 'fio-3.9'
4335
fio_customization_log: "{{ fio_dir }}/customization.log"
44-
45-
# mellanox drivers
46-
# mlx_iso: http://file.mad.redhat.com/~mnietoji/MLNX_OFED_LINUX-5.9-0.5.6.0-rhel9.1-x86_64.iso
47-
mlx_iso: ''

roles/images/performance/tasks/generic_customizations.yml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,14 @@
22
command: virt-customize -a {{ fetched_image }} --run-command "yum install {{ item }} -y"
33
loop:
44
- git
5-
- gcc
6-
- make
7-
- cmake
8-
- gcc-c++
9-
- pciutils
10-
- glibc-devel
11-
- glibc-headers
12-
- numactl-devel
135
- vim
146
- tmux
157
- python3
168
- cloud-init
17-
- meson
189
- pip
1910
- iperf3
2011
- mstflint
2112
- tuned-profiles-cpu-partitioning
22-
- perl
2313
- net-tools
2414

2515
- name: create custom users
Lines changed: 7 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,12 @@
1-
- name: install dpdk compile dependency
2-
command: virt-customize -a {{ fetched_image }} --run-command "pip3 install {{ item }}"
3-
loop: "{{ dpdk_compile_packages }}"
4-
5-
- name: configure mellanox drivers
6-
block:
7-
- name: create mellanox installation script
8-
lineinfile:
9-
dest: /tmp/mlx_script.sh
10-
line: '{{ item }}'
11-
create: true
12-
mode: 0744
13-
with_items:
14-
- 'curl -o /tmp/{{ mlx_iso | basename }} {{ mlx_iso }}'
15-
- 'mount -o ro,loop /tmp/{{ mlx_iso | basename }} /mnt'
16-
- 'cat <<EOF >> /etc/yum.repos.d/mlnx_ofed.repo'
17-
- '[mlnx_ofed]'
18-
- 'name=MLNX_OFED Repository'
19-
- 'baseurl=file:///mnt/RPMS'
20-
- 'enabled=1'
21-
- 'gpgcheck=0'
22-
- 'EOF'
23-
- 'yum install mlnx-ofed-all -y'
24-
- 'rm /etc/yum.repos.d/mlnx_ofed.repo'
25-
26-
- name: install mellanox drivers
27-
command: virt-customize -v -x -a {{ fetched_image }} --run /tmp/mlx_script.sh
28-
when: mlx_iso | length > 0
1+
- name: Install dpdk
2+
command: virt-customize -a {{ fetched_image }} --run-command "yum install {{ item }} -y"
3+
loop:
4+
- dpdk
5+
- driverctl
6+
- pciutils
297

30-
- name: compile dpdk and install trafficgen
8+
- name: install trafficgen
319
command: virt-customize -a {{ fetched_image }} --run-command "{{ item }}"
3210
loop:
33-
- "if [ ! -d {{ dpdk_dir }} ];then git clone {{ dpdk_git }} {{ dpdk_dir }};cd {{ dpdk_dir }};git checkout {{ dpdk_branch }};fi"
3411
- "if [ ! -d {{ trafficgen_dir }} ];then git clone {{ trafficgen_git }} {{ trafficgen_dir }};cd {{ trafficgen_dir }};git checkout {{ trafficgen_branch }};fi"
3512
- "sed -i 's/enforcing/{{ selinux_config }}/g' /etc/selinux/config /etc/selinux/config"
36-
- "cd {{ dpdk_dir }} ; meson setup build; ninja -C build"
37-
- "echo 'DPDK Version: {{ dpdk_branch }}' | tee {{ dpdk_customization_log }}"

roles/packet_gen/trex/README.md

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,6 @@ binary_search: True
116116
States if config variables should be parsed during run time, if `False`, a user must pass the required trex configuration variables.
117117

118118
`True` by default.
119-
```
120-
gather_trex_conf_live: True
121-
```
122119

123120
Destination out trex config file which will be created on trex instance.
124121

@@ -203,25 +200,6 @@ trafficgen_branch: 'master'
203200
```
204201

205202
### DPDK Variables
206-
207-
DPDK root directory on instances(cloned from: 'git://dpdk.org/dpdk').
208-
209-
`/root/dpdk` by default.
210-
```
211-
dpdk_root_dir: '/root/dpdk'
212-
```
213-
214-
Compiled DPDK binaries directory on instances(compiled as part of NFV perf guest image).
215-
216-
Info about what we compile can be found in `prepare_performance_images` [role documentation](/roles/images/performance/README.md#description).
217-
218-
Compilation steps can be found inside `Prepare DPDK binaries inside guest image` [task](/roles/images/performance/tasks/prepare_dpdk.yml).
219-
220-
`{{ dpdk_root_dir }}/build/app` by default.
221-
```
222-
dpdk_compiled_dir: '/root/dpdk/build/app'
223-
```
224-
225203
Binding drivers used by dpdk (vfio-pci, mlx5_core)
226204
'vfio-pci' by default
227205

roles/packet_gen/trex/binary_search/defaults/main.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,17 @@
22
binary_perf_log: '/tmp/performance.log'
33

44
# Trafficgen repo directory on host
5-
trafficgen_dir: '/opt/trafficgen'
5+
trafficgen_dir: '/opt/bench-trafficgen/trafficgen'
66

77
# binary-search binary
88
binary_search_bin: "{{ trafficgen_dir }}/binary-search.py"
99

1010
# Frame size in bytes that Trex will generate
1111
trex_frame_size: 64
1212

13+
# Destination ports, one per device
14+
dst_ports: 53000,54000
15+
1316
# Max packet lost % acceptable
1417
trex_max_lost_pct: 0.00
1518

@@ -68,4 +71,4 @@ binary_search_status_delay: 10
6871

6972
# What to do when negative packet loss is encountered
7073
# fail,quit,retry-to-fail,retry-to-quit
71-
negative_packet_loss: retry-to-fail
74+
negative_packet_loss: retry-to-fail

roles/packet_gen/trex/binary_search/tasks/main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
--max-loss-pct {{ trex_max_lost_pct }}
3535
--send-teaching-warmup
3636
--dst-macs {{ dut_macs }}
37+
--dst-ports {{ dst_ports }}
3738
--num-flows {{ trex_flows }}
3839
{% if trex_set_vlan %}
3940
--vlan-ids {{ trex_vlans }}

roles/packet_gen/trex/bind_dpdk_nics/defaults/main.yml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
# DPDK directory on host
2-
dpdk_root_dir: '/root/dpdk'
3-
4-
# Compiled DPDK binaries directory
5-
dpdk_compiled_dir: '{{ dpdk_root_dir }}/build/app'
6-
71
hugepages_count: 4
82

93
# dpdk drivers to use: vfio-pci, mlx5_core

roles/packet_gen/trex/bind_dpdk_nics/tasks/main.yml

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,3 @@
1-
- name: Check if DPDK Compiled Binaries Directory Exists
2-
stat:
3-
path: "{{ dpdk_compiled_dir }}"
4-
register: dpdk_dir
5-
failed_when: not dpdk_dir['stat']['exists']
6-
become: True
7-
81
- name: Retrieve default NIC
92
set_fact:
103
nic_def: "{{hostvars[inventory_hostname]['ansible_default_ipv4']['alias']}}"
@@ -22,8 +15,11 @@
2215
loop: "{{nic_down}}"
2316
become: True
2417

25-
- name: Retrieve Non Active NICs' PCI Slots
26-
shell: "python {{ dpdk_root_dir }}/usertools/dpdk-devbind.py --status | grep -A 5 'Network devices using kernel driver' | grep -v Active | grep 0000 | cut -d ' ' -f 1 | paste -sd ' '"
18+
- name: Retrieve pci slots for nics
19+
shell: |
20+
for nic in {{ nic_down | join(' ') }}; do
21+
ethtool -i $nic | awk '{if ($1 == "bus-info:") print $2}'
22+
done
2723
register: instance_nics_pci_slots
2824
become: True
2925

@@ -54,21 +50,21 @@
5450
name: "{{ item['name'] }}"
5551
state: present
5652
params: "{{ item['params'] | default(omit) }}"
53+
persistent: "present"
5754
loop:
58-
- {'name': 'vfio'}
55+
- {'name': 'vfio', 'params': 'enable_unsafe_noiommu_mode=1'}
5956
- {'name': 'vfio-pci'}
6057

61-
- name: Ensure enable_unsafe_noiommu_mode
62-
shell: "echo 1 | sudo tee /sys/module/vfio/parameters/enable_unsafe_noiommu_mode"
63-
6458
- name: Load Mellanox Kernel Modules when configured
6559
modprobe:
6660
name: mlx5_core
6761
state: present
62+
persistent: "present"
6863
when: dpdk_binding_driver == "mlx5_core"
6964

7065
- name: Bind DPDK NICs
71-
command: "{{ dpdk_root_dir }}/usertools/dpdk-devbind.py -b {{dpdk_binding_driver}} {{ instance_nics_pci_slots['stdout'] }}"
66+
command: "driverctl set-override {{ item }} {{dpdk_binding_driver}}"
67+
loop: "{{ instance_nics_pci_slots.stdout_lines }}"
7268

7369
become: True
7470

roles/packet_gen/trex/launch_testpmd/defaults/main.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# testpmd binary
2-
testpmd_bin: "{{ dpdk_compiled_dir }}/testpmd"
2+
testpmd_bin: "/usr/bin/dpdk-testpmd"
33

44
# Map list of cores to physical cpu set
55
testpmd_lcores: '3,4,7'
@@ -26,10 +26,13 @@ testpmd_rxq: 1
2626
testpmd_txq: 1
2727

2828
# TestPMD forwarding mode
29-
forward_mode: io
29+
forward_mode: mac
3030

3131
# TestPMD verbose
3232
testpmd_verbose: 0
3333

3434
# TestPMD log file
35-
testpmd_log: "/tmp/testpmd.log"
35+
testpmd_log: "/tmp/testpmd.log"
36+
37+
# Enable IP forwarding in case L3 needed
38+
packet_gen_ip_forwarding: false
Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,6 @@
1-
# Parse trex configuration during run time from trex instance
2-
gather_trex_conf_live: True
3-
41
# Destination of trex config file
52
trex_conf_file: '/etc/trex_cfg.yaml'
63

7-
# Clone trafficgen repo https://github.com/atheurer/trafficgen
8-
clone_traffic_gen_repo: True
9-
10-
# Trafficgen repo URI
11-
trafficgen_repo: 'https://github.com/atheurer/trafficgen'
12-
13-
# Trafficgen branch
14-
trafficgen_branch: 'master'
15-
16-
# Derecitory where trafficgen repo will be cloned to
17-
trafficgen_dir: '/opt/trafficgen/'
18-
194
# Platform sepcific Trex configuration
205
trex_platform:
216
master_thread_id: 2
@@ -24,8 +9,5 @@ trex_platform:
249
- socket: 0
2510
threads: [4, 5, 6, 7, 8, 9, 10, 11]
2611

27-
# DPDK root dir
28-
dpdk_root_dir: '/root/dpdk'
29-
3012
# Workaround - can't define this variable inside playbook
3113
trex_full_nic_info: []

0 commit comments

Comments
 (0)