diff options
-rw-r--r-- | ansible/install.yaml | 2 | ||||
-rw-r--r-- | ansible/roles/enable_iommu_on_boot/tasks/main.yml | 54 | ||||
-rw-r--r-- | ansible/roles/enable_iommu_on_boot/tasks/manual_modify_grub.yml | 12 | ||||
-rw-r--r-- | ansible/roles/enable_iommu_on_boot/vars/main.yml | 4 | ||||
-rw-r--r-- | ansible/ubuntu_server_baremetal_deploy_samplevnfs.yml | 1 | ||||
-rw-r--r-- | requirements.txt | 3 | ||||
-rw-r--r-- | samples/vnf_samples/nsut/prox/prox-tg-topology-scale-up.yaml | 36 | ||||
-rw-r--r-- | samples/vnf_samples/nsut/prox/standalone-args.yaml | 46 | ||||
-rw-r--r-- | samples/vnf_samples/nsut/prox/tc_prox_sriov_l3fwd-scale-up.yaml | 95 |
9 files changed, 195 insertions, 58 deletions
diff --git a/ansible/install.yaml b/ansible/install.yaml index 0800ee534..01478fb12 100644 --- a/ansible/install.yaml +++ b/ansible/install.yaml @@ -63,8 +63,8 @@ - role: set_package_installer_proxy when: proxy_env is defined and proxy_env # can't update grub in chroot/docker - # ?? - enable_iommu_on_boot - enable_hugepages_on_boot + - enable_iommu_on_boot # needed for collectd plugins - increase_open_file_limits - install_image_dependencies diff --git a/ansible/roles/enable_iommu_on_boot/tasks/main.yml b/ansible/roles/enable_iommu_on_boot/tasks/main.yml index 1b98a50b1..e406fcc1e 100644 --- a/ansible/roles/enable_iommu_on_boot/tasks/main.yml +++ b/ansible/roles/enable_iommu_on_boot/tasks/main.yml @@ -1,4 +1,4 @@ -# Copyright (c) 2017 Intel Corporation +# Copyright (c) 2017-2018 Intel Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -22,41 +22,45 @@ iommu_boot_params: ' amd_iommu=on iommu=pt' when: hostvars[inventory_hostname]['ansible_system_vendor'] == "AuthenticAMD" -- name: Set facts for this role +- name: Define grub string for IOMMU set_fact: - hugepages_help_string: ' # added by hugepages role' - iommu_help_string: ', added by iommu role' - hugepages_params: " default_hugepagesz=1G hugepagesz=1G hugepages=8" - iommu_original_kernel_params: 'GRUB_CMDLINE_LINUX="\$GRUB_CMDLINE_LINUX{{ hugepages_params }}' - iommu_enabled_kernel_params: '{{ iommu_original_kernel_params }}{{ iommu_boot_params }}"' - iommu_enabled_kernel_params_with_help: '{{ iommu_original_kernel_params }}{{ iommu_boot_params }}"{{ hugepages_help_string }}{{ iommu_help_string }}' + enable_iommu: 'GRUB_CMDLINE_LINUX="$GRUB_CMDLINE_LINUX{{ iommu_boot_params }}' -- name: check if iommu is set by this role in /etc/default/grub +- name: check if iommu is set by this role in {{ grub_file}} lineinfile: - path: /etc/default/grub - line: '{{ iommu_enabled_kernel_params_with_help }}' - #changed_when: no + path: "{{ grub_file}}" + regexp: '{{ iommu_help_string }}' + line: '{{ iommu_help_string }}' + state: absent check_mode: yes - register: is_mine_iommu_etc_grub + register: is_nsb_iommu_role ignore_errors: True -- name: check if iommu is set by someone else - command: "grep -o 'iommu' /etc/default/grub" +- name: Check if IOMMU is set by someone else + lineinfile: + path: "{{ grub_file}}" + regexp: "_iommu=" + line: '{{ iommu_help_string }}' + state: absent + check_mode: yes register: is_iommu ignore_errors: True -- fail: - msg: "Iommu already set by someone else" - when: is_mine_iommu_etc_grub.changed == false and is_iommu.stdout != "" +- name: Send info that IOMMU is configured by someone else + debug: + msg: "INFO: NOT modified, IOMMU is already configured by someone." + when: + - not is_nsb_iommu_role.changed + - is_iommu.changed -- name: 'Configure iommu in /etc/default/grub' -# and /boot/grub/grub.cfg(when: ansible_distribution == "Ubuntu")' +- name: Add IOMMU when it is not set lineinfile: - path: /etc/default/grub - regexp: '({{ iommu_original_kernel_params }})"{{ hugepages_help_string }}' - line: '\1{{ iommu_boot_params }}"{{ hugepages_help_string }}{{ iommu_help_string }}' - backrefs: yes - when: is_mine_iommu_etc_grub.changed == true + path: "{{ grub_file }}" + regexp: "{{ iommu_help_string }}" + line: '{{ enable_iommu }}" {{ iommu_help_string }}' + when: + - not is_nsb_iommu_role.changed + - not is_iommu.changed - name: find boot grub.cfg find: diff --git a/ansible/roles/enable_iommu_on_boot/tasks/manual_modify_grub.yml b/ansible/roles/enable_iommu_on_boot/tasks/manual_modify_grub.yml index 6760c3f9d..e0c880912 100644 --- a/ansible/roles/enable_iommu_on_boot/tasks/manual_modify_grub.yml +++ b/ansible/roles/enable_iommu_on_boot/tasks/manual_modify_grub.yml @@ -1,4 +1,4 @@ -# Copyright (c) 2017 Intel Corporation +# Copyright (c) 2017-2018 Intel Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -12,14 +12,12 @@ # See the License for the specific language governing permissions and # limitations under the License. --- - - - name: check if iommu is set by this role in /boot grub.cfg files lineinfile: path: "{{ item.path }}" - regexp: '{{ hugepages_params }}{{ iommu_boot_params }}' - line: '' - #changed_when: no + regexp: '{{ iommu_boot_params }}' + line: '{{ iommu_boot_params }}' + state: absent check_mode: yes register: is_mine_iommu_boot_grub ignore_errors: True @@ -29,6 +27,6 @@ path: "{{ item.path }}" regexp: '(.*linux\s+/boot/vmlinuz.*)$' replace: '\1{{ iommu_boot_params }}' - when: is_mine_iommu_boot_grub.msg != "line replaced" + when: not is_mine_iommu_boot_grub.changed - debug: var=ansible_kernel diff --git a/ansible/roles/enable_iommu_on_boot/vars/main.yml b/ansible/roles/enable_iommu_on_boot/vars/main.yml index 1b642dcb5..d2575ffd6 100644 --- a/ansible/roles/enable_iommu_on_boot/vars/main.yml +++ b/ansible/roles/enable_iommu_on_boot/vars/main.yml @@ -1,4 +1,4 @@ -# Copyright (c) 2017 Intel Corporation +# Copyright (c) 2017-2018 Intel Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -12,6 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. --- +grub_file: "/etc/default/grub" +iommu_help_string: ' # added by Yardstick ansible iommu role' update_grub: Debian: "update-grub2" RedHat: "grub2-mkconfig -o /boot/grub2/grub.cfg" diff --git a/ansible/ubuntu_server_baremetal_deploy_samplevnfs.yml b/ansible/ubuntu_server_baremetal_deploy_samplevnfs.yml index b69fb58fb..84e1f9adf 100644 --- a/ansible/ubuntu_server_baremetal_deploy_samplevnfs.yml +++ b/ansible/ubuntu_server_baremetal_deploy_samplevnfs.yml @@ -24,6 +24,7 @@ when: proxy_env is defined and proxy_env # can't update grub in chroot/docker - enable_hugepages_on_boot + - enable_iommu_on_boot # needed for collectd plugins - increase_open_file_limits - install_image_dependencies diff --git a/requirements.txt b/requirements.txt index 43a6c7fdb..e55687914 100644 --- a/requirements.txt +++ b/requirements.txt @@ -34,7 +34,8 @@ netaddr==0.7.19 # BSD License; OSI Approved BSD License; OSI Approved netifaces==0.10.6 # MIT License; OSI Approved MIT License os-client-config==1.28.0 # OSI Approved Apache Software License osc-lib==1.8.0 # OSI Approved Apache Software License -oslo.config==5.1.0 # OSI Approved Apache Software License +oslo.log==3.41.0 # OSI Approved Apache Software License +oslo.config==5.1.0 # OSI Approved Apache Software License oslo.i18n==3.17.0 # OSI Approved Apache Software License oslo.messaging==5.36.0 # OSI Approved Apache Software License oslo.privsep==1.23.0 # OSI Approved Apache Software License diff --git a/samples/vnf_samples/nsut/prox/prox-tg-topology-scale-up.yaml b/samples/vnf_samples/nsut/prox/prox-tg-topology-scale-up.yaml index 74c48bac2..87db3702f 100644 --- a/samples/vnf_samples/nsut/prox/prox-tg-topology-scale-up.yaml +++ b/samples/vnf_samples/nsut/prox/prox-tg-topology-scale-up.yaml @@ -11,8 +11,9 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. - +--- {% set vports = get(extra_args, 'vports', 2) %} + nsd:nsd-catalog: nsd: - id: prox-tg-topology @@ -27,36 +28,25 @@ nsd:nsd-catalog: vnfd-id-ref: vnf__0 VNF model: ../../vnf_descriptors/prox_vnf.yaml vld: - - id: uplink_0 - name: tg__0 to vnf__0 link 1 +{% for vport in range(0,vports,2|int) %} + - id: uplink_{{loop.index0}} + name: tg__0 to vnf__0 link {{ vport + 1 }} type: ELAN vnfd-connection-point-ref: - member-vnf-index-ref: '1' - vnfd-connection-point-ref: xe0 + vnfd-connection-point-ref: xe{{ vport }} vnfd-id-ref: tg__0 - member-vnf-index-ref: '2' - vnfd-connection-point-ref: xe0 + vnfd-connection-point-ref: xe{{ vport }} vnfd-id-ref: vnf__0 -{% for vport in range(vports-1|int) %} - - id: downlink_{{ vport }} - name: vnf__0 to tg__0 link {{ vport+2 }} + - id: downlink_{{loop.index0}} + name: vnf__0 to tg__0 link {{ vport + 2 }} type: ELAN vnfd-connection-point-ref: - - member-vnf-index-ref: '1' - vnfd-connection-point-ref: xe{{ vport+1 }} - vnfd-id-ref: vnf__0 - member-vnf-index-ref: '2' - vnfd-connection-point-ref: xe{{ vport+1 }} - vnfd-id-ref: tg__0 -{% else %} - - id: downlink_0 - name: vnf__0 to tg__0 link 1 - type: ELAN - vnfd-connection-point-ref: - - member-vnf-index-ref: '1' - vnfd-connection-point-ref: xe0 + vnfd-connection-point-ref: xe{{ vport + 1 }} vnfd-id-ref: vnf__0 - - member-vnf-index-ref: '2' - vnfd-connection-point-ref: xe0 + - member-vnf-index-ref: '1' + vnfd-connection-point-ref: xe{{ vport + 1 }} vnfd-id-ref: tg__0 -{% endfor %}
\ No newline at end of file +{% endfor %} diff --git a/samples/vnf_samples/nsut/prox/standalone-args.yaml b/samples/vnf_samples/nsut/prox/standalone-args.yaml new file mode 100644 index 000000000..7f45112e3 --- /dev/null +++ b/samples/vnf_samples/nsut/prox/standalone-args.yaml @@ -0,0 +1,46 @@ +# Copyright (c) 2018 Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +--- + +networks: + uplink: + - + port_num: 0 + phy_port: "0000:05:00.0" + vpci: "0000:00:0a.0" + cidr: '152.16.100.10/24' + gateway_ip: '152.16.100.20' + - + port_num: 2 + phy_port: "0000:05:00.2" + vpci: "0000:00:0c.0" + cidr: '152.16.50.10/24' + gateway_ip: '152.16.100.20' + + downlink: + - + port_num: 1 + phy_port: "0000:05:00.1" + vpci: "0000:00:0b.0" + cidr: '152.16.40.10/24' + gateway_ip: '152.16.100.20' + + - + port_num: 3 + phy_port: "0000:05:00.3" + vpci: "0000:00:0d.0" + cidr: '152.16.30.10/24' + gateway_ip: '152.16.100.20' + diff --git a/samples/vnf_samples/nsut/prox/tc_prox_sriov_l3fwd-scale-up.yaml b/samples/vnf_samples/nsut/prox/tc_prox_sriov_l3fwd-scale-up.yaml new file mode 100644 index 000000000..a824ef940 --- /dev/null +++ b/samples/vnf_samples/nsut/prox/tc_prox_sriov_l3fwd-scale-up.yaml @@ -0,0 +1,95 @@ +# Copyright (c) 2018 Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +{% set vports = vports or 2 %} +--- +schema: "yardstick:task:0.1" + +scenarios: +- + type: NSPerf + traffic_profile: ../../traffic_profiles/prox_binsearch.yaml + extra_args: + vports: {{ vports }} + topology: prox-tg-topology-scale-up.yaml + + nodes: + tg__0: tg__0.yardstick + vnf__0: vnf__0.yardstick + + options: + vnf__0: + prox_path: /opt/nsb_bin/prox + prox_config: "configs/handle_l3fwd-{{ vports }}.cfg" + prox_args: + "-t": "" + prox_files: +{% if vports == 2 %} + "configs/ipv4-2port.lua" : "" +{% else %} + "configs/ipv4.lua" : "" +{% endif %} + prox_generate_parameter: True + + tg__0: + prox_path: /opt/nsb_bin/prox + prox_config: "configs/gen_l3fwd-{{ vports }}.cfg" + prox_args: + "-e": "" + "-t": "" + + runner: + type: Duration + # we kill after duration, independent of test duration, so set this high + duration: 1800 + +contexts: + - name: yardstick + type: Node + file: prox_tg_bm.yaml + - name: yardstick + type: StandaloneSriov + file: /etc/yardstick/nodes/standalone/host_sriov.yaml + vm_deploy: True + flavor: + images: "/var/lib/libvirt/images/yardstick-nsb-image.img" + ram: 16384 + extra_specs: + hw:cpu_sockets: 1 + hw:cpu_cores: 10 + hw:cpu_threads: 2 + servers: + vnf__0: + network_ports: + mgmt: + cidr: '1.1.1.62/24' +{% for port_num in range((vports/2)|int) %} + xe{{ port_num * 2 }}: + - uplink_{{ port_num }} + xe{{ (port_num * 2) + 1 }}: + - downlink_{{ port_num }} +{% endfor %} + networks: +{% for port_num in range((vports/2)|int) %} + uplink_{{ port_num }}: + phy_port: "{{ networks.uplink[port_num].phy_port }}" + vpci: "{{ networks.uplink[port_num].vpci }}" + cidr: "{{ networks.uplink[port_num].cidr }}" + gateway_ip: "{{ networks.uplink[port_num].gateway_ip }}" + downlink_{{ port_num }}: + phy_port: "{{ networks.downlink[port_num].phy_port }}" + vpci: "{{ networks.downlink[port_num].vpci }}" + cidr: "{{ networks.downlink[port_num].cidr }}" + gateway_ip: "{{ networks.downlink[port_num].gateway_ip }}" +{% endfor %} |