diff options
Diffstat (limited to 'fdio.infra.ansible/roles/vpp_device')
5 files changed, 117 insertions, 48 deletions
diff --git a/fdio.infra.ansible/roles/vpp_device/defaults/main.yaml b/fdio.infra.ansible/roles/vpp_device/defaults/main.yaml deleted file mode 100644 index 9816d7087c..0000000000 --- a/fdio.infra.ansible/roles/vpp_device/defaults/main.yaml +++ /dev/null @@ -1,6 +0,0 @@ ---- -# file: roles/vpp_device/defaults/main.yaml - -iavf_target_dir: "/opt" -iavf_version: "4.1.1" -iavf_url: "https://downloads.sourceforge.net/project/e1000/iavf%20stable/{{ iavf_version }}/iavf-{{ iavf_version }}.tar.gz?ts=gAAAAABgvfs_L6gSH8B09NfEc8fzoooS3M2wyuOxlFEK5EtTstZWFdb2dYcqJZNqiirAT87dbc3GeJJrRst9KfUgS-byAeyaLw%3D%3D&r=https%3A%2F%2Fsourceforge.net%2Fprojects%2Fe1000%2Ffiles%2Fiavf%2520stable%2F{{ iavf_version }}%2Fiavf-{{ iavf_version }}.tar.gz%2Fdownload" diff --git a/fdio.infra.ansible/roles/vpp_device/files/csit-initialize-vfs-alt.sh b/fdio.infra.ansible/roles/vpp_device/files/csit-initialize-vfs-alt.sh new file mode 100644 index 0000000000..cd04d61251 --- /dev/null +++ b/fdio.infra.ansible/roles/vpp_device/files/csit-initialize-vfs-alt.sh @@ -0,0 +1,39 @@ +#!/usr/bin/env bash + +# Copyright (c) 2023 PANTHEON.tech and/or its affiliates. +# 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. + +# Add QLogic Corp. FastLinQ QL41000 Series 10/25/40/50GbE Controller to +# blacklist. +PCI_BLACKLIST=($(lspci -Dmmd ':8070:0200' | cut -f1 -d' ')) +# Add I350 Gigabit Network Connection 1521 to blacklist. +PCI_BLACKLIST+=($(lspci -Dmmd ':1521:0200' | cut -f1 -d' ')) +# Add MT27800 Family [ConnectX-5] 1017 to blacklist. +PCI_BLACKLIST+=($(lspci -Dmmd ':1017:0200' | cut -f1 -d' ')) + +# Add Intel Corporation Ethernet Controller XL710 for 40GbE QSFP+ to whitelist. +PCI_WHITELIST=($(lspci -Dmmd ':1583:0200' | cut -f1 -d' ')) +# Add MT2892 Family [ConnectX-6 Dx] 101d to whitelist. +PCI_WHITELIST+=($(lspci -Dmmd ':101d:0200' | cut -f1 -d' ')) + +# See http://pci-ids.ucw.cz/v2.2/pci.ids for more info. + +declare -A PF_INDICES +# Intel NICs +PF_INDICES["0000:01:00.0"]=0 +PF_INDICES["0000:01:00.1"]=1 +PF_INDICES["0003:02:00.0"]=0 +PF_INDICES["0003:02:00.1"]=1 +# Mellanox CX6 +PF_INDICES["0001:01:00.0"]=2 +PF_INDICES["0001:01:00.1"]=2
\ No newline at end of file diff --git a/fdio.infra.ansible/roles/vpp_device/files/csit-initialize-vfs-spr.sh b/fdio.infra.ansible/roles/vpp_device/files/csit-initialize-vfs-spr.sh new file mode 100644 index 0000000000..b240649b4c --- /dev/null +++ b/fdio.infra.ansible/roles/vpp_device/files/csit-initialize-vfs-spr.sh @@ -0,0 +1,28 @@ +#!/usr/bin/env bash + +# Copyright (c) 2023 Cisco and/or its affiliates. +# 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. + +# Add Intel Corporation Ethernet Controller 10G X550T to blacklist. +PCI_BLACKLIST=($(lspci -Dmmd ':1563:0200' | cut -f1 -d' ')) +# Add Intel Corporation Ethernet Controller E810-C for 100GbE QSFP to whitelist. +PCI_WHITELIST+=($(lspci -Dmmd ':1592:0200' | cut -f1 -d' ')) + +# See http://pci-ids.ucw.cz/v2.2/pci.ids for more info. + +declare -A PF_INDICES +# Intel NICs +PF_INDICES["0000:2a:00.0"]=0 +PF_INDICES["0000:2c:00.0"]=1 +PF_INDICES["0000:3f:00.0"]=0 +PF_INDICES["0000:3d:00.0"]=1 diff --git a/fdio.infra.ansible/roles/vpp_device/handlers/main.yaml b/fdio.infra.ansible/roles/vpp_device/handlers/main.yaml index 29342ae43c..3ac80cc16e 100644 --- a/fdio.infra.ansible/roles/vpp_device/handlers/main.yaml +++ b/fdio.infra.ansible/roles/vpp_device/handlers/main.yaml @@ -1,21 +1,21 @@ --- -# file: roles/vpp_device/handlers/main.yaml +# file: handlers/main.yaml -- name: Start csit-initialize-vfs.service - systemd: +- name: "Start csit-initialize-vfs.service" + ansible.builtin.systemd: enabled: true - state: started - name: csit-initialize-vfs.service + state: "started" + name: "csit-initialize-vfs.service" tags: - start-vf-service -- name: Update GRUB - command: update-grub +- name: "Update GRUB" + ansible.builtin.command: "update-grub" tags: - update-grub -- name: Reboot server - reboot: +- name: "Reboot server" + ansible.builtin.reboot: reboot_timeout: 3600 tags: - reboot-server diff --git a/fdio.infra.ansible/roles/vpp_device/tasks/main.yaml b/fdio.infra.ansible/roles/vpp_device/tasks/main.yaml index 418217aaac..91916456af 100644 --- a/fdio.infra.ansible/roles/vpp_device/tasks/main.yaml +++ b/fdio.infra.ansible/roles/vpp_device/tasks/main.yaml @@ -1,20 +1,18 @@ --- -# file: roles/vpp_device/tasks/main.yaml +# file: tasks/main.yaml -- name: Load Kernel Modules By Default - lineinfile: +- name: "Load Kernel Modules On Startup (vfio-pci)" + ansible.builtin.lineinfile: path: "/etc/modules" state: "present" line: "{{ item }}" with_items: - "vfio-pci" - when: - - cpu_microarchitecture == "thunderx2" tags: - load-kernel-modules -- name: Disable IPv6 Router Advertisement - sysctl: +- name: "Disable IPv6 Router Advertisement" + ansible.builtin.sysctl: name: "net.ipv6.conf.default.accept_ra" value: "0" state: "present" @@ -23,9 +21,19 @@ tags: - set-sysctl -- name: Disable IPv6 Router Advertisement - sysctl: - name: "net.ipv6.conf.all.accept_ra" +- name: "Disable IPv6 MLDv1 interval" + ansible.builtin.sysctl: + name: "net.ipv6.conf.default.mldv1_unsolicited_report_interval" + value: "0" + state: "present" + sysctl_file: "/etc/sysctl.d/90-csit.conf" + reload: "yes" + tags: + - set-sysctl + +- name: "Disable IPv6 MLDv2 interval" + ansible.builtin.sysctl: + name: "net.ipv6.conf.default.mldv2_unsolicited_report_interval" value: "0" state: "present" sysctl_file: "/etc/sysctl.d/90-csit.conf" @@ -33,9 +41,9 @@ tags: - set-sysctl -- name: Disable IPv6 MLDv1 interval - sysctl: - name: "net.ipv6.conf.all.mldv1_unsolicited_report_interval" +- name: "Disable IPv6 Autoconf" + ansible.builtin.sysctl: + name: "net.ipv6.conf.default.autoconf" value: "0" state: "present" sysctl_file: "/etc/sysctl.d/90-csit.conf" @@ -43,9 +51,9 @@ tags: - set-sysctl -- name: Disable IPv6 MLDv2 interval - sysctl: - name: "net.ipv6.conf.all.mldv2_unsolicited_report_interval" +- name: "Disable IPv6 MC Forwarding" + ansible.builtin.sysctl: + name: "net.ipv6.conf.default.mc_forwarding" value: "0" state: "present" sysctl_file: "/etc/sysctl.d/90-csit.conf" @@ -53,9 +61,9 @@ tags: - set-sysctl -- name: Disable IPv6 Autoconf - sysctl: - name: "net.ipv6.conf.all.autoconf" +- name: "Disable IPv4 IGMPv2 interval" + ansible.builtin.sysctl: + name: "net.ipv4.conf.default.igmpv2_unsolicited_report_interval" value: "0" state: "present" sysctl_file: "/etc/sysctl.d/90-csit.conf" @@ -63,9 +71,9 @@ tags: - set-sysctl -- name: Disable IPv6 MC Forwarding - sysctl: - name: "net.ipv6.conf.all.mc_forwarding" +- name: "Disable IPv4 IGMPv3 interval" + ansible.builtin.sysctl: + name: "net.ipv4.conf.default.igmpv3_unsolicited_report_interval" value: "0" state: "present" sysctl_file: "/etc/sysctl.d/90-csit.conf" @@ -73,8 +81,8 @@ tags: - set-sysctl -- name: Copy csit-initialize-vfs.sh - copy: +- name: "Copy csit-initialize-vfs.sh" + ansible.builtin.copy: src: "files/csit-initialize-vfs.sh" dest: "/usr/local/bin/" owner: "root" @@ -83,8 +91,8 @@ tags: - copy-vf-script -- name: Copy csit-initialize-vfs-data.sh - copy: +- name: "Copy csit-initialize-vfs-data.sh" + ansible.builtin.copy: src: "files/{{ vfs_data_file }}" dest: "/usr/local/bin/csit-initialize-vfs-data.sh" owner: "root" @@ -94,8 +102,8 @@ when: - vfs_data_file is defined -- name: Copy Default csit-initialize-vfs-data.sh - copy: +- name: "Copy Default csit-initialize-vfs-data.sh" + ansible.builtin.copy: src: "files/csit-initialize-vfs-default.sh" dest: "/usr/local/bin/csit-initialize-vfs-data.sh" owner: "root" @@ -105,8 +113,8 @@ when: - vfs_data_file is not defined -- name: Start csit-initialize-vfs.service - copy: +- name: "Start csit-initialize-vfs.service" + ansible.builtin.copy: src: "files/csit-initialize-vfs.service" dest: "/etc/systemd/system/" owner: "root" @@ -117,10 +125,10 @@ tags: - start-vf-service -- meta: flush_handlers +- ansible.builtin.meta: "flush_handlers" -- name: Set Hugepages In GRUB - lineinfile: +- name: "Set Hugepages In GRUB" + ansible.builtin.lineinfile: path: "/etc/default/grub" state: "present" regexp: "^GRUB_CMDLINE_LINUX=" |