diff options
17 files changed, 246 insertions, 53 deletions
diff --git a/ansible/install.yaml b/ansible/install.yaml index 0c7ad7e92..f4f57bdc0 100644 --- a/ansible/install.yaml +++ b/ansible/install.yaml @@ -56,6 +56,8 @@ - name: Prepare baremetal and standalone servers hosts: yardstick-baremetal,yardstick-standalone become: yes + vars_files: + - roles/download_dpdk/defaults/main.yml environment: "{{ proxy_env }}" roles: @@ -69,15 +71,18 @@ - increase_open_file_limits - install_image_dependencies - role: download_dpdk - # dpdk_version: "17.02" + dpdk_version: "{{ dpdk_version_for_PROX }}" + - role: install_dpdk + dpdk_version: "{{ dpdk_version_for_PROX }}" + - download_samplevnfs + - role: install_samplevnf + vnf_name: PROX + - download_dpdk - install_dpdk - download_trex - install_trex - download_civetweb - install_civetweb - - download_samplevnfs - - role: install_samplevnf - vnf_name: PROX - role: install_samplevnf vnf_name: UDP_Replay - role: install_samplevnf diff --git a/ansible/roles/build_yardstick_image/tasks/cloudimg_modify_nsb.yml b/ansible/roles/build_yardstick_image/tasks/cloudimg_modify_nsb.yml index 9a70ff39a..c2f72cada 100644 --- a/ansible/roles/build_yardstick_image/tasks/cloudimg_modify_nsb.yml +++ b/ansible/roles/build_yardstick_image/tasks/cloudimg_modify_nsb.yml @@ -52,19 +52,43 @@ - install_image_dependencies - enable_hugepages_on_boot # can't update grub in chroot/docker - increase_open_file_limits # needed for collectd plugins - - download_dpdk - - install_dpdk - download_trex - install_trex - - download_pktgen - - install_pktgen - download_civetweb - install_civetweb + loop_control: + loop_var: role_item + environment: "{{ proxy_env }}" + +- include_role: + name: "{{ role_item }}" + vars: + dpdk_version: "{{ dpdk_version_for_PROX }}" + with_items: + - download_dpdk + - install_dpdk - download_samplevnfs loop_control: loop_var: role_item environment: "{{ proxy_env }}" +- name: Install PROX + include_role: + name: install_samplevnf + vars: + vnf_name: PROX + +- include_role: + name: "{{ role_item }}" + with_items: + - download_dpdk + - install_dpdk + - download_pktgen + - install_pktgen + loop_control: + loop_var: role_item + environment: "{{ proxy_env }}" + - include_vars: roles/install_dpdk/defaults/main.yml when: INSTALL_BIN_PATH is undefined @@ -75,7 +99,6 @@ - include_role: name: install_samplevnf with_items: - - PROX - UDP_Replay - ACL - FW diff --git a/ansible/roles/download_dpdk/defaults/main.yml b/ansible/roles/download_dpdk/defaults/main.yml index 83711881b..b2d959eed 100644 --- a/ansible/roles/download_dpdk/defaults/main.yml +++ b/ansible/roles/download_dpdk/defaults/main.yml @@ -1,11 +1,11 @@ --- dpdk_version: "17.05" +dpdk_version_for_PROX: "18.11" dpdk_url: "http://fast.dpdk.org/rel/dpdk-{{ dpdk_version }}.tar.xz" dpdk_file: "{{ dpdk_url|basename }}" dpdk_unarchive: "{{ dpdk_file|regex_replace('[.]tar[.]xz$', '') }}" dpdk_dest: "{{ clone_dest }}/" -#NOTE(ralonsoh): DPDK > 17.02 are currently unsupported due to prox build issues dpdk_md5: "16.07.2": "md5:4922ea2ec935b64ff5c191fec53344a6" "16.11.7": "md5:c081d113dfd57633e3bc3ebc802691be" @@ -16,3 +16,4 @@ dpdk_md5: "17.11.3": "md5:68ca84ac878011acf44e75d33b46f55b" #unsupported "18.02.2": "md5:75ad6d39b513649744e49c9fcbbb9ca5" #unsupported "18.05": "md5:9fc86367cd9407ff6a8dfea56c4eddc4" #unsupported + "18.11": "md5:04b86f4a77f4f81a7fbd26467dd2ea9f" # Not supported by SampleVNFs except PROX diff --git a/ansible/roles/download_samplevnfs/defaults/main.yml b/ansible/roles/download_samplevnfs/defaults/main.yml index 104f594f5..5ddc9f0f9 100644 --- a/ansible/roles/download_samplevnfs/defaults/main.yml +++ b/ansible/roles/download_samplevnfs/defaults/main.yml @@ -13,4 +13,4 @@ samplevnf_url: "https://git.opnfv.org/samplevnf" samplevnf_dest: "{{ clone_dest }}/samplevnf" -samplevnf_version: "3afd384b7e68a3cd29f4d2cdf39785f8441d0b6f" +samplevnf_version: "47123bfc1b3c0d0b01884aebbce1a3e09ad7ddb0" diff --git a/ansible/roles/install_dpdk/tasks/main.yml b/ansible/roles/install_dpdk/tasks/main.yml index d1dc2900b..a1a377eb1 100644 --- a/ansible/roles/install_dpdk/tasks/main.yml +++ b/ansible/roles/install_dpdk/tasks/main.yml @@ -20,6 +20,10 @@ # with_fileglob: # - "{{ local_nsb_path }}/patches/dpdk_custom_patch/0*.patch" +- debug: + var: dpdk_version + verbosity: 2 + - name: find kernel for image, (including chroot) find_kernel: kernel: "{{ ansible_kernel }}" @@ -106,6 +110,7 @@ src: "{{ dpdk_path }}/{{ dpdk_make_arch }}/kmod/igb_uio.ko" dest: "{{ dpdk_module_dir }}/igb_uio.ko" remote_src: yes + when: dpdk_version is version(dpdk_version_for_PROX, '>=') - name: run depmod for dpdk_kernel command: depmod "{{ dpdk_kernel }}" @@ -114,20 +119,14 @@ path: "{{ INSTALL_BIN_PATH }}" state: directory -- set_fact: - major: "{{ dpdk_version.split('.')[0] }}" - minor: "{{ dpdk_version.split('.')[1] }}" - -- set_fact: - major_minor_version: "{{ major }}.{{ minor }}" - - name: copy dpdk-devbind.py to correct location copy: - src: "{{ dpdk_devbind_usertools if major_minor_version|float >= 17.02 else dpdk_devbind_tools }}" + src: "{{ dpdk_devbind_usertools if dpdk_version is version('17.02', '>=') else dpdk_devbind_tools }}" dest: "{{ INSTALL_BIN_PATH }}/dpdk-devbind.py" remote_src: yes force: yes mode: 0755 + when: dpdk_version is version(dpdk_version_for_PROX, '>=') - name: make vPE binary command: make -j {{ ansible_processor_vcpus }} @@ -135,6 +134,7 @@ chdir: "{{ dpdk_path }}/examples/ip_pipeline" environment: RTE_SDK: "{{ dpdk_path }}" + when: dpdk_version is version(dpdk_version_for_PROX, '!=') - name: Copy vPE to correct location copy: @@ -143,3 +143,4 @@ remote_src: yes force: yes mode: 0755 + when: dpdk_version is version(dpdk_version_for_PROX, '!=') diff --git a/ansible/ubuntu_server_baremetal_deploy_samplevnfs.yml b/ansible/ubuntu_server_baremetal_deploy_samplevnfs.yml index 84e1f9adf..4f4d7d075 100644 --- a/ansible/ubuntu_server_baremetal_deploy_samplevnfs.yml +++ b/ansible/ubuntu_server_baremetal_deploy_samplevnfs.yml @@ -15,6 +15,8 @@ - hosts: yardstick-standalone:jumphost vars: clone_dir: /tmp/yardstick-clone + vars_files: + - roles/download_dpdk/defaults/main.yml environment: "{{ proxy_env }}" @@ -28,16 +30,19 @@ # needed for collectd plugins - increase_open_file_limits - install_image_dependencies - - role: download_dpdk -# dpdk_version: "17.02" - - install_dpdk - download_trex - install_trex - download_civetweb - install_civetweb + - role: download_dpdk + dpdk_version: "{{ dpdk_version_for_PROX }}" + - role: install_dpdk + dpdk_version: "{{ dpdk_version_for_PROX }}" - download_samplevnfs - role: install_samplevnf vnf_name: PROX + - download_dpdk + - install_dpdk - role: install_samplevnf vnf_name: UDP_Replay - role: install_samplevnf diff --git a/ansible/ubuntu_server_cloudimg_modify_samplevnfs.yml b/ansible/ubuntu_server_cloudimg_modify_samplevnfs.yml index b27933bd1..d894c3dc4 100644 --- a/ansible/ubuntu_server_cloudimg_modify_samplevnfs.yml +++ b/ansible/ubuntu_server_cloudimg_modify_samplevnfs.yml @@ -16,6 +16,8 @@ connection: chroot vars: clone_dir: /tmp/yardstick-clone + vars_files: + - roles/download_dpdk/defaults/main.yml pre_tasks: - debug: @@ -35,18 +37,21 @@ - increase_open_file_limits - modify_cloud_config - install_image_dependencies - - role: download_dpdk -# dpdk_version: "17.02" - - install_dpdk - download_trex - install_trex - - download_pktgen - - install_pktgen - download_civetweb - install_civetweb + - role: download_dpdk + dpdk_version: "{{ dpdk_version_for_PROX }}" + - role: install_dpdk + dpdk_version: "{{ dpdk_version_for_PROX }}" - download_samplevnfs - role: install_samplevnf vnf_name: PROX + - download_dpdk + - install_dpdk + - download_pktgen + - install_pktgen - role: install_samplevnf vnf_name: UDP_Replay - role: install_samplevnf diff --git a/samples/vnf_samples/nsut/prox/configs/gen_all-2.cfg b/samples/vnf_samples/nsut/prox/configs/gen_all-2.cfg index 1ca3f7791..8708d562e 100644 --- a/samples/vnf_samples/nsut/prox/configs/gen_all-2.cfg +++ b/samples/vnf_samples/nsut/prox/configs/gen_all-2.cfg @@ -20,11 +20,11 @@ no-output=no ; disable DPDK debug output [port 0] name=p0 mac=hardware + [port 1] name=p1 mac=hardware - [defaults] mempool size=4K @@ -46,7 +46,8 @@ mode=gen tx port=p0 bps=1250000000 ; Ethernet + IP + UDP -pkt inline=${sut_mac0} 70 00 00 00 00 01 08 00 45 00 00 1c 00 01 00 00 40 11 f7 7d 00 00 00 01 00 00 00 02 13 88 13 88 00 08 55 7b +pkt inline=${sut_mac0} 70 00 00 00 00 01 08 00 45 00 00 20 00 01 00 00 40 11 f7 7d 00 00 00 01 00 00 00 02 13 88 13 88 00 0c 55 7b 42 43 44 45 +lat pos=42 [core 2] name=gen 1 @@ -55,7 +56,8 @@ mode=gen tx port=p1 bps=1250000000 ; Ethernet + IP + UDP -pkt inline=${sut_mac1} 70 00 00 00 00 02 08 00 45 00 00 1c 00 01 00 00 40 11 f7 7d 00 00 00 01 00 00 00 03 13 88 13 88 00 08 55 7b +pkt inline=${sut_mac1} 70 00 00 00 00 02 08 00 45 00 00 20 00 01 00 00 40 11 f7 7d 00 00 00 01 00 00 00 03 13 88 13 88 00 0c 55 7b 42 43 44 45 +lat pos=42 [core 3] task=0 diff --git a/samples/vnf_samples/nsut/prox/configs/gen_buffering-1.cfg b/samples/vnf_samples/nsut/prox/configs/gen_buffering-1.cfg index 6deefa82f..925ff0fb4 100644 --- a/samples/vnf_samples/nsut/prox/configs/gen_buffering-1.cfg +++ b/samples/vnf_samples/nsut/prox/configs/gen_buffering-1.cfg @@ -42,7 +42,8 @@ mode=gen tx port=p0 bps=1250000000 ; Ethernet + IP + UDP -pkt inline=${sut_mac0} 70 00 00 00 00 01 08 00 45 00 00 1c 00 01 00 00 40 11 f7 7d c0 a8 01 01 c0 a8 01 01 13 88 13 88 00 08 55 7b +pkt inline=${sut_mac0} 70 00 00 00 00 01 08 00 45 00 00 20 00 01 00 00 40 11 f7 7d c0 a8 01 01 c0 a8 01 01 13 88 13 88 00 0c 55 7b 42 43 44 45 +lat pos=42 [core 2] name=P1 diff --git a/samples/vnf_samples/nsut/prox/configs/gen_l2fwd_multiflow-2.cfg b/samples/vnf_samples/nsut/prox/configs/gen_l2fwd_multiflow-2.cfg index fb2584e91..d344d3a48 100644 --- a/samples/vnf_samples/nsut/prox/configs/gen_l2fwd_multiflow-2.cfg +++ b/samples/vnf_samples/nsut/prox/configs/gen_l2fwd_multiflow-2.cfg @@ -104,4 +104,4 @@ mode=lat rx port=p1 lat pos=42 signature pos=46 -signature=0xcafedeca
\ No newline at end of file +signature=0xcafedeca diff --git a/samples/vnf_samples/nsut/prox/configs/gen_l2fwd_pktTouch-2.cfg b/samples/vnf_samples/nsut/prox/configs/gen_l2fwd_pktTouch-2.cfg index 016a6b29c..e20edc199 100644 --- a/samples/vnf_samples/nsut/prox/configs/gen_l2fwd_pktTouch-2.cfg +++ b/samples/vnf_samples/nsut/prox/configs/gen_l2fwd_pktTouch-2.cfg @@ -21,6 +21,7 @@ no-output=no ; disable DPDK debug output [port 0] name=p0 mac=hardware + [port 1] name=p1 mac=hardware @@ -46,7 +47,8 @@ mode=gen tx port=p0 bps=1250000000 ; Ethernet + IP + UDP -pkt inline=${sut_mac0} 70 00 00 00 00 01 08 00 45 00 00 1c 00 01 00 00 40 11 f7 7d c0 a8 01 01 c0 a8 01 01 13 88 13 88 00 08 55 7b +pkt inline=${sut_mac0} 70 00 00 00 00 01 08 00 45 00 00 20 00 01 00 00 40 11 f7 7d c0 a8 01 01 c0 a8 01 01 13 88 13 88 00 0c 55 7b 42 43 44 45 +lat pos=42 [core 2] name=p1 @@ -55,7 +57,8 @@ mode=gen tx port=p1 bps=1250000000 ; Ethernet + IP + UDP -pkt inline=${sut_mac1} 70 00 00 00 00 02 08 00 45 00 00 1c 00 01 00 00 40 11 f7 7d c0 a8 01 01 c0 a8 01 01 13 88 13 88 00 08 55 7b +pkt inline=${sut_mac1} 70 00 00 00 00 02 08 00 45 00 00 20 00 01 00 00 40 11 f7 7d c0 a8 01 01 c0 a8 01 01 13 88 13 88 00 0c 55 7b 42 43 44 45 +lat pos=42 [core 3] task=0 diff --git a/samples/vnf_samples/nsut/prox/configs/gen_l2fwd_pktTouch-4.cfg b/samples/vnf_samples/nsut/prox/configs/gen_l2fwd_pktTouch-4.cfg index cb52d6c87..8dc4716bc 100644 --- a/samples/vnf_samples/nsut/prox/configs/gen_l2fwd_pktTouch-4.cfg +++ b/samples/vnf_samples/nsut/prox/configs/gen_l2fwd_pktTouch-4.cfg @@ -21,12 +21,15 @@ no-output=no ; disable DPDK debug output [port 0] name=p0 mac=hardware + [port 1] name=p1 mac=hardware + [port 2] name=p2 mac=hardware + [port 3] name=p3 mac=hardware @@ -54,7 +57,8 @@ mode=gen tx port=p0 bps=1250000000 ; Ethernet + IP + UDP -pkt inline=${sut_mac0} 70 00 00 00 00 01 08 00 45 00 00 1c 00 01 00 00 40 11 f7 7d c0 a8 01 01 c0 a8 01 01 13 88 13 88 00 08 55 7b +pkt inline=${sut_mac0} 70 00 00 00 00 01 08 00 45 00 00 20 00 01 00 00 40 11 f7 7d c0 a8 01 01 c0 a8 01 01 13 88 13 88 00 0c 55 7b 42 43 44 45 +lat pos=42 [core 2] name=p1 @@ -63,7 +67,8 @@ mode=gen tx port=p1 bps=1250000000 ; Ethernet + IP + UDP -pkt inline=${sut_mac1} 70 00 00 00 00 02 08 00 45 00 00 1c 00 01 00 00 40 11 f7 7d c0 a8 01 01 c0 a8 01 01 13 88 13 88 00 08 55 7b +pkt inline=${sut_mac1} 70 00 00 00 00 02 08 00 45 00 00 20 00 01 00 00 40 11 f7 7d c0 a8 01 01 c0 a8 01 01 13 88 13 88 00 0c 55 7b 42 43 44 45 +lat pos=42 [core 3] name=p2 @@ -72,7 +77,8 @@ mode=gen tx port=p2 bps=1250000000 ; Ethernet + IP + UDP -pkt inline=${sut_mac2} 70 00 00 00 00 03 08 00 45 00 00 1c 00 01 00 00 40 11 f7 7d c0 a8 01 01 c0 a8 01 01 13 88 13 88 00 08 55 7b +pkt inline=${sut_mac2} 70 00 00 00 00 03 08 00 45 00 00 20 00 01 00 00 40 11 f7 7d c0 a8 01 01 c0 a8 01 01 13 88 13 88 00 0c 55 7b 42 43 44 45 +lat pos=42 [core 4] name=p3 @@ -81,7 +87,8 @@ mode=gen tx port=p3 bps=1250000000 ; Ethernet + IP + UDP -pkt inline=${sut_mac3} 70 00 00 00 00 04 08 00 45 00 00 1c 00 01 00 00 40 11 f7 7d c0 a8 01 01 c0 a8 01 01 13 88 13 88 00 08 55 7b +pkt inline=${sut_mac3} 70 00 00 00 00 04 08 00 45 00 00 20 00 01 00 00 40 11 f7 7d c0 a8 01 01 c0 a8 01 01 13 88 13 88 00 0c 55 7b 42 43 44 45 +lat pos=42 [core 5] task=0 diff --git a/samples/vnf_samples/nsut/prox/configs/gen_lw_aftr-4.cfg b/samples/vnf_samples/nsut/prox/configs/gen_lw_aftr-4.cfg index dba589590..085c41b9c 100644 --- a/samples/vnf_samples/nsut/prox/configs/gen_lw_aftr-4.cfg +++ b/samples/vnf_samples/nsut/prox/configs/gen_lw_aftr-4.cfg @@ -60,7 +60,7 @@ mode=gen tx port=lwB4_0 bps=1250000000 ; Ethernet + IPv6 + IPv4 + UDP -pkt inline=${sut_mac1} 90 e2 ba c6 84 d1 86 dd 60 00 00 00 00 1c 04 04 fe 80 00 00 00 00 00 00 02 00 00 ff 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 45 00 00 1c 34 85 00 00 20 11 00 00 ab cd 01 01 ab cd 02 01 00 00 66 66 00 08 00 00 +pkt inline=${sut_mac1} 90 e2 ba c6 84 d1 86 dd 60 00 00 00 00 20 04 04 fe 80 00 00 00 00 00 00 02 00 00 ff 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 45 00 00 20 34 85 00 00 20 11 00 00 ab cd 01 01 ab cd 02 01 00 00 66 66 00 0c 00 00 82 83 84 85 ; src_ipv6: fe80::200:ff:0:[0000..ffff] random=XXXXXXXXXXXXXXXX rand_offset=36 @@ -70,6 +70,7 @@ rand_offset=68 ; src_port: 64*[0..63] random=0000XXXXXX000000 rand_offset=74 +lat pos=82 [core 2] name=tun_0b @@ -78,16 +79,17 @@ mode=gen tx port=lwB4_0 bps=1250000000 ; Ethernet + IPv6 + IPv4 + UDP -pkt inline=${sut_mac1} 90 e2 ba c6 84 d1 86 dd 60 00 00 00 00 1c 04 04 fe 80 00 00 00 00 00 00 02 00 00 ff 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 45 00 00 1c 34 85 00 00 20 11 00 00 ab cd 01 02 ab cd 02 02 00 00 66 66 00 08 00 00 +pkt inline=${sut_mac1} 90 e2 ba c6 84 d1 86 dd 60 00 00 00 00 20 04 04 fe 80 00 00 00 00 00 00 02 00 00 ff 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 45 00 00 20 34 85 00 00 20 11 00 00 ab cd 01 02 ab cd 02 02 00 00 66 66 00 0c 00 00 82 83 84 85 ; src_ipv6: fe80::200:ff:0:[0000..ffff] random=XXXXXXXXXXXXXXXX rand_offset=36 ; src_ipv4: 171.205.[0..3].[0..255] random=000000XXXXXXXXXX rand_offset=68 -; src_port: 64*[0..63] +; src_port: 64*[0..63] random=0000XXXXXX000000 rand_offset=74 +lat pos=82 [core 3] name=inet_0a @@ -96,13 +98,14 @@ mode=gen tx port=inet_0 bps=1250000000 ; Ethernet + IPv4 + UDP -pkt inline=${sut_mac0} 70 00 00 00 00 01 08 00 45 00 00 1c 00 01 00 00 40 11 f7 7d ab cd 02 01 ab cd 01 03 13 88 13 88 00 08 55 7b +pkt inline=${sut_mac0} 70 00 00 00 00 01 08 00 45 00 00 20 00 01 00 00 40 11 f7 7d ab cd 02 01 ab cd 01 03 13 88 13 88 00 0c 55 7b 42 43 44 45 ; dst_ipv4: 171.205.[0..3].[0..255] random=000000XXXXXXXXXX rand_offset=32 ; dst_port: 64*[0..63] random=0000XXXXXX000000 rand_offset=36 +lat pos=42 [core 4] name=inet_0b @@ -111,13 +114,14 @@ mode=gen tx port=inet_0 bps=1250000000 ; Ethernet + IPv4 + UDP -pkt inline=${sut_mac0} 70 00 00 00 00 01 08 00 45 00 00 1c 00 01 00 00 40 11 f7 7d ab cd 02 01 ab cd 01 03 13 88 13 88 00 08 55 7b +pkt inline=${sut_mac0} 70 00 00 00 00 01 08 00 45 00 00 20 00 01 00 00 40 11 f7 7d ab cd 02 01 ab cd 01 03 13 88 13 88 00 0c 55 7b 42 43 44 45 ; dst_ipv4: 171.205.[0..3].[0..255] random=000000XXXXXXXXXX rand_offset=32 ; dst_port: 64*[0..63] random=0000XXXXXX000000 rand_offset=36 +lat pos=42 [core 5] name=tun_1a @@ -125,7 +129,8 @@ task=0 mode=gen tx port=lwB4_1 bps=1250000000 -pkt inline=${sut_mac3} 90 e2 ba c6 84 d1 86 dd 60 00 00 00 00 1c 04 04 fe 80 00 00 00 00 00 00 02 00 00 ff 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 45 00 00 1c 34 85 00 00 20 11 00 00 ab cd 00 00 ab cd 03 02 00 00 66 66 00 08 00 00 +; Ethernet + IPv6 + IPv4 + UDP +pkt inline=${sut_mac3} 90 e2 ba c6 84 d1 86 dd 60 00 00 00 00 20 04 04 fe 80 00 00 00 00 00 00 02 00 00 ff 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 45 00 00 20 34 85 00 00 20 11 00 00 ab cd 00 00 ab cd 03 02 00 00 66 66 00 0c 00 00 82 83 84 85 ; src_ipv6: fe80::200:ff:0:[0000..ffff] random=XXXXXXXXXXXXXXXX rand_offset=36 @@ -135,6 +140,7 @@ rand_offset=68 ; src_port: 64*[0..63] random=0000XXXXXX000000 rand_offset=74 +lat pos=82 [core 10] name=tun_1b @@ -142,7 +148,8 @@ task=0 mode=gen tx port=lwB4_1 bps=1250000000 -pkt inline=${sut_mac3} 90 e2 ba c6 84 d1 86 dd 60 00 00 00 00 1c 04 04 fe 80 00 00 00 00 00 00 02 00 00 ff 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 45 00 00 1c 34 85 00 00 20 11 00 00 ab cd 00 00 ab cd 03 01 00 00 66 66 00 08 00 00 +; Ethernet + IPv6 + IPv4 + UDP +pkt inline=${sut_mac3} 90 e2 ba c6 84 d1 86 dd 60 00 00 00 00 20 04 04 fe 80 00 00 00 00 00 00 02 00 00 ff 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 45 00 00 20 34 85 00 00 20 11 00 00 ab cd 00 00 ab cd 03 01 00 00 66 66 00 0c 00 00 82 83 84 85 ; src_ipv6: fe80::200:ff:0:[0000..ffff] random=XXXXXXXXXXXXXXXX rand_offset=36 @@ -152,6 +159,7 @@ rand_offset=68 ; src_port: 64*[0..63] random=0000XXXXXX000000 rand_offset=74 +lat pos=82 [core 11] name=inet_2a @@ -159,13 +167,15 @@ task=0 mode=gen tx port=inet_1 bps=1250000000 -pkt inline=${sut_mac2} 70 00 00 00 00 01 08 00 45 00 00 1c 00 01 00 00 40 11 f7 7d ab cd 02 01 ab cd 01 03 13 88 13 88 00 08 55 7b +; Ethernet + IPv4 + UDP +pkt inline=${sut_mac2} 70 00 00 00 00 01 08 00 45 00 00 20 00 01 00 00 40 11 f7 7d ab cd 02 01 ab cd 01 03 13 88 13 88 00 0c 55 7b 42 43 44 45 ; dst_ipv4: 171.205.[0..3].[0..255] random=000000XXXXXXXXXX rand_offset=32 ; dst_port: 64*[0..63] random=0000XXXXXX000000 rand_offset=36 +lat pos=42 [core 16] name=inet_2b @@ -173,34 +183,40 @@ task=0 mode=gen tx port=inet_1 bps=1250000000 -pkt inline=${sut_mac2} 70 00 00 00 00 01 08 00 45 00 00 1c 00 01 00 00 40 11 f7 7d ab cd 02 01 ab cd 01 03 13 88 13 88 00 08 55 7b +; Ethernet + IPv4 + UDP +pkt inline=${sut_mac2} 70 00 00 00 00 01 08 00 45 00 00 20 00 01 00 00 40 11 f7 7d ab cd 02 01 ab cd 01 03 13 88 13 88 00 0c 55 7b 42 43 44 45 ; dst_ipv4: 171.205.[0..3].[0..255] random=000000XXXXXXXXXX rand_offset=32 ; dst_port: 64*[0..63] random=0000XXXXXX000000 rand_offset=36 +lat pos=42 [core 17] name=lat_in0 task=0 mode=lat rx port=inet_0 +lat pos=42 [core 18] name=lat_tun0 task=0 mode=lat rx port=lwB4_0 +lat pos=82 [core 19] name=lat_in1 task=0 mode=lat rx port=inet_1 +lat pos=42 [core 20] name=lat_tun1 task=0 mode=lat rx port=lwB4_1 +lat pos=82 diff --git a/samples/vnf_samples/nsut/prox/configs/gen_mpls_tag_untag-2.cfg b/samples/vnf_samples/nsut/prox/configs/gen_mpls_tag_untag-2.cfg index d9c742983..9fcbbacc9 100644 --- a/samples/vnf_samples/nsut/prox/configs/gen_mpls_tag_untag-2.cfg +++ b/samples/vnf_samples/nsut/prox/configs/gen_mpls_tag_untag-2.cfg @@ -21,6 +21,7 @@ no-output=no ; disable DPDK debug output [port 0] name=taggd1 mac=hardware + [port 1] name=plain1 mac=hardware @@ -47,7 +48,8 @@ mode=gen tx port=taggd1 bps=1250000000 ; Ethernet + MPLS + IP + UDP -pkt inline=${sut_mac0} 70 00 00 00 00 01 88 47 00 00 31 00 45 00 00 1c 00 01 00 00 40 11 f7 7d c0 a8 01 01 c0 a8 01 01 00 35 00 35 00 08 7c 21 FFFFFFFF +pkt inline=${sut_mac0} 70 00 00 00 00 01 88 47 00 00 31 00 45 00 00 20 00 01 00 00 40 11 f7 7d c0 a8 01 01 c0 a8 01 01 00 35 00 35 00 0c 7c 21 46 47 48 49 +lat pos=46 [core 2] name=udp1 @@ -56,7 +58,8 @@ mode=gen tx port=plain1 bps=1250000000 ; Ethernet + IP + UDP -pkt inline=${sut_mac1} 70 00 00 00 00 02 08 00 45 00 00 1c 00 01 00 00 40 11 f7 7d c0 a8 01 01 c0 a8 01 01 00 35 00 35 00 08 7c 21 FFFFFFFF +pkt inline=${sut_mac1} 70 00 00 00 00 02 08 00 45 00 00 20 00 01 00 00 40 11 f7 7d c0 a8 01 01 c0 a8 01 01 00 35 00 35 00 0c 7c 21 42 43 44 45 +lat pos=42 [core 3] task=0 diff --git a/samples/vnf_samples/nsut/prox/configs/gen_mpls_tag_untag-4.cfg b/samples/vnf_samples/nsut/prox/configs/gen_mpls_tag_untag-4.cfg index 20b373882..1e89d9dd7 100644 --- a/samples/vnf_samples/nsut/prox/configs/gen_mpls_tag_untag-4.cfg +++ b/samples/vnf_samples/nsut/prox/configs/gen_mpls_tag_untag-4.cfg @@ -21,12 +21,15 @@ no-output=no ; disable DPDK debug output [port 0] name=taggd1 mac=hardware + [port 1] name=plain1 mac=hardware + [port 2] name=plain2 mac=hardware + [port 3] name=taggd2 mac=hardware @@ -55,7 +58,8 @@ mode=gen tx port=taggd1 bps=1250000000 ; Ethernet + MPLS + IP + UDP -pkt inline=${sut_mac0} 70 00 00 00 00 01 88 47 00 00 31 00 45 00 00 1c 00 01 00 00 40 11 f7 7d c0 a8 01 01 c0 a8 01 01 00 35 00 35 00 08 7c 21 FFFFFFFF +pkt inline=${sut_mac0} 70 00 00 00 00 01 88 47 00 00 31 00 45 00 00 20 00 01 00 00 40 11 f7 7d c0 a8 01 01 c0 a8 01 01 00 35 00 35 00 0c 7c 21 46 47 48 49 +lat pos=46 [core 2] name=udp1 @@ -64,7 +68,8 @@ mode=gen tx port=plain1 bps=1250000000 ; Ethernet + IP + UDP -pkt inline=${sut_mac1} 70 00 00 00 00 02 08 00 45 00 00 1c 00 01 00 00 40 11 f7 7d c0 a8 01 01 c0 a8 01 01 00 35 00 35 00 08 7c 21 FFFFFFFF +pkt inline=${sut_mac1} 70 00 00 00 00 02 08 00 45 00 00 20 00 01 00 00 40 11 f7 7d c0 a8 01 01 c0 a8 01 01 00 35 00 35 00 0c 7c 21 42 43 44 45 +lat pos=42 [core 3] name=udp2 @@ -73,7 +78,8 @@ mode=gen tx port=plain2 bps=1250000000 ; Ethernet + IP + UDP -pkt inline=${sut_mac2} 70 00 00 00 00 03 08 00 45 00 00 1c 00 01 00 00 40 11 f7 7d c0 a8 01 01 c0 a8 01 01 00 35 00 35 00 08 7c 21 FFFFFFFF +pkt inline=${sut_mac2} 70 00 00 00 00 03 08 00 45 00 00 20 00 01 00 00 40 11 f7 7d c0 a8 01 01 c0 a8 01 01 00 35 00 35 00 0c 7c 21 42 43 44 45 +lat pos=42 [core 4] name=tag2 @@ -82,7 +88,8 @@ mode=gen tx port=taggd2 bps=1250000000 ; Ethernet + MPLS + IP + UDP -pkt inline=${sut_mac3} 70 00 00 00 00 04 88 47 00 00 31 00 45 00 00 1c 00 01 00 00 40 11 f7 7d c0 a8 01 01 c0 a8 01 01 00 35 00 35 00 08 7c 21 FFFFFFFF +pkt inline=${sut_mac3} 70 00 00 00 00 04 88 47 00 00 31 00 45 00 00 20 00 01 00 00 40 11 f7 7d c0 a8 01 01 c0 a8 01 01 00 35 00 35 00 0c 7c 21 46 47 48 49 +lat pos=46 [core 5] task=0 diff --git a/yardstick/network_services/vnf_generic/vnf/prox_helpers.py b/yardstick/network_services/vnf_generic/vnf/prox_helpers.py index 5d980037a..cd3035ef8 100644 --- a/yardstick/network_services/vnf_generic/vnf/prox_helpers.py +++ b/yardstick/network_services/vnf_generic/vnf/prox_helpers.py @@ -870,6 +870,30 @@ class ProxDpdkVnfSetupEnvHelper(DpdkVnfSetupEnvHelper): file_str[1] = self.additional_files[base_name] return '"'.join(file_str) + def _make_core_list(self, inputStr): + + my_input = inputStr.split("core ", 1)[1] + ok_list = set() + + substrs = [x.strip() for x in my_input.split(',')] + for i in substrs: + try: + ok_list.add(int(i)) + + except ValueError: + try: + substr = [int(k.strip()) for k in i.split('-')] + if len(substr) > 1: + startstr = substr[0] + endstr = substr[len(substr) - 1] + for z in range(startstr, endstr + 1): + ok_list.add(z) + except ValueError: + LOG.error("Error in cores list ... resuming ") + return ok_list + + return ok_list + def generate_prox_config_file(self, config_path): sections = [] prox_config = ConfigParser(config_path, sections) @@ -889,6 +913,18 @@ class ProxDpdkVnfSetupEnvHelper(DpdkVnfSetupEnvHelper): if section_data[0] == "mac": section_data[1] = "hardware" + # adjust for range of cores + new_sections = [] + for section_name, section in sections: + if section_name.startswith('core') and section_name.find('$') == -1: + core_list = self._make_core_list(section_name) + for core in core_list: + new_sections.append(["core " + str(core), section]) + else: + new_sections.append([section_name, section]) + + sections = new_sections + # search for dst mac for _, section in sections: for section_data in section: diff --git a/yardstick/tests/unit/network_services/vnf_generic/vnf/test_prox_helpers.py b/yardstick/tests/unit/network_services/vnf_generic/vnf/test_prox_helpers.py index 31f08da3e..9a30fb9e9 100644 --- a/yardstick/tests/unit/network_services/vnf_generic/vnf/test_prox_helpers.py +++ b/yardstick/tests/unit/network_services/vnf_generic/vnf/test_prox_helpers.py @@ -1374,6 +1374,36 @@ class TestProxDpdkVnfSetupEnvHelper(unittest.TestCase): ['missing_addtional_file', 'dofile("nosuch")'], ], ], + [ + 'core 0', + [ + ['name', 'p0'] + ] + ], + [ + 'core 1-4', + [ + ['name', 'p1'] + ] + ], + [ + 'core 5,6', + [ + ['name', 'p2'] + ] + ], + [ + 'core xx', + [ + ['name', 'p3'] + ] + ], + [ + 'core $x', + [ + ['name', 'p4'] + ] + ] ] expected = [ @@ -1403,6 +1433,54 @@ class TestProxDpdkVnfSetupEnvHelper(unittest.TestCase): ['missing_addtional_file', 'dofile("nosuch")'], ], ], + [ + 'core 0', + [ + ['name', 'p0'] + ] + ], + [ + 'core 1', + [ + ['name', 'p1'] + ] + ], + [ + 'core 2', + [ + ['name', 'p1'] + ] + ], + [ + 'core 3', + [ + ['name', 'p1'] + ] + ], + [ + 'core 4', + [ + ['name', 'p1'] + ] + ], + [ + 'core 5', + [ + ['name', 'p2'] + ] + ], + [ + 'core 6', + [ + ['name', 'p2'] + ] + ], + [ + 'core $x', + [ + ['name', 'p4'] + ] + ] ] result = helper.generate_prox_config_file('/c/d/e') self.assertEqual(result, expected, str(result)) |