From af032f688a71cbb94f213be89db18190fe927e69 Mon Sep 17 00:00:00 2001 From: pmikus Date: Wed, 12 Apr 2023 07:46:55 +0000 Subject: feat(ansible): Intel DMA Signed-off-by: pmikus Change-Id: I68a6965712c7e4b39f931fb4487142fa9c5088dc --- .../lf_inventory/host_vars/10.30.51.56.yaml | 1 + fdio.infra.ansible/roles/intel/defaults/main.yaml | 33 +++++++++++++++- fdio.infra.ansible/roles/intel/tasks/dsa.yaml | 39 ++++++++++++++++++ fdio.infra.ansible/roles/intel/tasks/i40e.yaml | 8 ++-- fdio.infra.ansible/roles/intel/tasks/iavf.yaml | 8 ++-- fdio.infra.ansible/roles/intel/tasks/ice.yaml | 20 +++++----- fdio.infra.ansible/roles/intel/tasks/main.yaml | 46 ++++++++++++++++------ topologies/available/lf_2n_spr_testbed23.yaml | 18 +++++++++ 8 files changed, 142 insertions(+), 31 deletions(-) create mode 100644 fdio.infra.ansible/roles/intel/tasks/dsa.yaml diff --git a/fdio.infra.ansible/inventories/lf_inventory/host_vars/10.30.51.56.yaml b/fdio.infra.ansible/inventories/lf_inventory/host_vars/10.30.51.56.yaml index 8452ceadc1..dd0ef2c731 100644 --- a/fdio.infra.ansible/inventories/lf_inventory/host_vars/10.30.51.56.yaml +++ b/fdio.infra.ansible/inventories/lf_inventory/host_vars/10.30.51.56.yaml @@ -32,3 +32,4 @@ cpu_microarchitecture: "sapphirerapids" intel_700_matrix: "dpdk22.07" intel_800_matrix: "dpdk22.07" mellanox_matrix: "dpdk22.07" +intel_dsa_matrix: true \ No newline at end of file diff --git a/fdio.infra.ansible/roles/intel/defaults/main.yaml b/fdio.infra.ansible/roles/intel/defaults/main.yaml index b46fa3ebc0..f7d2fb65ff 100644 --- a/fdio.infra.ansible/roles/intel/defaults/main.yaml +++ b/fdio.infra.ansible/roles/intel/defaults/main.yaml @@ -1,5 +1,5 @@ --- -# file: roles/intel/defaults/main.yaml +# file: defaults/main.yaml packages: "{{ packages_base + packages_by_distro[ansible_distribution | lower] + packages_by_arch[ansible_machine] }}" @@ -8,7 +8,30 @@ packages_base: packages_by_distro: ubuntu: - - [] + - "build-essential" + - "autoconf" + - "automake" + - "autotools-dev" + - "libtool" + - "pkgconf" + - "asciidoc" + - "xmlto" + - "uuid-dev" + - "libjson-c-dev" + - "libkeyutils-dev" + - "libz-dev" + - "libssl-dev" + - "debhelper" + - "devscripts" + - "debmake" + - "quilt" + - "fakeroot" + - "lintian" + - "asciidoctor" + - "file" + - "gnupg" + - "patch" + - "patchutils" packages_by_arch: aarch64: @@ -46,6 +69,9 @@ intel_800_compatibility_matrix: iavf: "4.5.3" nvm: "4.00" +intel_dsa_compatibility_matrix: + dsa: "4.0" + intel_i40e_url: "2.17.15": "i40e%20stable/2.17.15/i40e-2.17.15.tar.gz/download" "2.19.3": "i40e%20stable/2.19.3/i40e-2.19.3.tar.gz/download" @@ -60,3 +86,6 @@ intel_iavf_url: intel_ddp_url: "1.3.35.0": "727568/800%20Series%20DDP%20Comms%20Package%201.3.35.0.zip" "1.3.37.0": "738733/800%20Series%20DDP%20Comms%20Package%201.3.37.0.zip" + +intel_dsa_url: + "4.0": "https://github.com/intel/idxd-config/archive/refs/tags/accel-config-v4.0.tar.gz" diff --git a/fdio.infra.ansible/roles/intel/tasks/dsa.yaml b/fdio.infra.ansible/roles/intel/tasks/dsa.yaml new file mode 100644 index 0000000000..2f038b0e9f --- /dev/null +++ b/fdio.infra.ansible/roles/intel/tasks/dsa.yaml @@ -0,0 +1,39 @@ +--- +# file: tasks/dsa.yaml + +- name: Get DSA Driver + ansible.builtin.uri: + url: "{{ intel_dsa_url[dsa] }}" + follow_redirects: "all" + force: true + dest: "{{ intel_extract_dir }}/accel-config-v{{ dsa }}.tar.gz" + mode: "0644" + failed_when: false + tags: + - intel-inst + +- name: Extract DSA Driver + ansible.builtin.unarchive: + remote_src: true + src: "{{ intel_extract_dir }}/accel-config-v{{ dsa }}.tar.gz" + dest: "{{ intel_extract_dir }}/" + creates: "{{ intel_extract_dir }}/idxd-config-accel-config-v{{ dsa }}" + register: intel_driver_extracted + tags: + - intel-inst + +- name: Install DSA Driver + ansible.builtin.command: "{{ item }}" + args: + chdir: "{{ intel_extract_dir }}/idxd-config-accel-config-v{{ dsa }}" + become: true + with_items: + - "./autogen.sh" + - "./configure CFLAGS='-g -O2' --prefix=/usr --sysconfdir=/etc --libdir=/usr/lib64" + - "make" + - "make check" + - "make install" + when: + - intel_driver_extracted + tags: + - intel-inst diff --git a/fdio.infra.ansible/roles/intel/tasks/i40e.yaml b/fdio.infra.ansible/roles/intel/tasks/i40e.yaml index 01b3d763d8..8b069bf9b2 100644 --- a/fdio.infra.ansible/roles/intel/tasks/i40e.yaml +++ b/fdio.infra.ansible/roles/intel/tasks/i40e.yaml @@ -1,7 +1,7 @@ --- -# file: roles/intel/tasks/i40e.yaml +# file: tasks/i40e.yaml -- name: Inst - Get i40e Network Adapter Driver +- name: Get i40e Network Adapter Driver ansible.builtin.uri: url: "{{ intel_sourceforge_download_url }}/{{ intel_i40e_url[i40e] }}" follow_redirects: "all" @@ -12,7 +12,7 @@ tags: - intel-inst -- name: Inst - Extract i40e Network Adapter Driver +- name: Extract i40e Network Adapter Driver ansible.builtin.unarchive: remote_src: true src: "{{ intel_extract_dir }}/i40e-{{ i40e }}.tar.gz" @@ -22,7 +22,7 @@ tags: - intel-inst -- name: Inst - i40e Network Adapter Driver +- name: Install i40e Network Adapter Driver ansible.builtin.command: "{{ item }}" args: chdir: "{{ intel_extract_dir }}/i40e-{{ i40e }}/src" diff --git a/fdio.infra.ansible/roles/intel/tasks/iavf.yaml b/fdio.infra.ansible/roles/intel/tasks/iavf.yaml index 226b79bdab..127e31bee2 100644 --- a/fdio.infra.ansible/roles/intel/tasks/iavf.yaml +++ b/fdio.infra.ansible/roles/intel/tasks/iavf.yaml @@ -1,7 +1,7 @@ --- -# file: roles/intel/tasks/iavf.yaml +# file: tasks/iavf.yaml -- name: Inst - Get iavf Network Adapter Driver +- name: Get iavf Network Adapter Driver ansible.builtin.uri: url: "{{ intel_sourceforge_download_url }}/{{ intel_iavf_url[iavf] }}" follow_redirects: "all" @@ -12,7 +12,7 @@ tags: - intel-inst -- name: Inst - Extract iavf Network Adapter Driver +- name: Extract iavf Network Adapter Driver ansible.builtin.unarchive: remote_src: true src: "{{ intel_extract_dir }}/iavf-{{ iavf }}.tar.gz" @@ -22,7 +22,7 @@ tags: - intel-inst -- name: Inst - iavf Network Adapter Driver +- name: Install iavf Network Adapter Driver ansible.builtin.command: "{{ item }}" args: chdir: "{{ intel_extract_dir }}/iavf-{{ iavf }}/src" diff --git a/fdio.infra.ansible/roles/intel/tasks/ice.yaml b/fdio.infra.ansible/roles/intel/tasks/ice.yaml index 1c1c199f69..c773a65a34 100644 --- a/fdio.infra.ansible/roles/intel/tasks/ice.yaml +++ b/fdio.infra.ansible/roles/intel/tasks/ice.yaml @@ -1,7 +1,7 @@ --- -# file: roles/intel/tasks/ice.yaml +# file: tasks/ice.yaml -- name: Inst - Get ice Network Adapter Driver +- name: Get ice Network Adapter Driver ansible.builtin.uri: url: "{{ intel_sourceforge_download_url }}/{{ intel_ice_url[ice] }}" follow_redirects: "all" @@ -12,7 +12,7 @@ tags: - intel-inst -- name: Inst - Extract ice Network Adapter Driver +- name: Extract ice Network Adapter Driver ansible.builtin.unarchive: remote_src: true src: "{{ intel_extract_dir }}/ice-{{ ice }}.tar.gz" @@ -22,7 +22,7 @@ tags: - intel-inst -- name: Inst - ice Network Adapter Driver +- name: Install ice Network Adapter Driver ansible.builtin.command: "{{ item }}" args: chdir: "{{ intel_extract_dir }}/ice-{{ ice }}/src" @@ -36,7 +36,7 @@ tags: - intel-inst -- name: Inst - Get Dynamic Device Personalization (DDP) Package +- name: Get Dynamic Device Personalization (DDP) Package ansible.builtin.get_url: url: "{{ intel_download_url }}/{{ intel_ddp_url[ddp] }}" dest: "{{ intel_extract_dir }}/800-Series-Comms-Binary-Package-{{ ddp }}.zip" @@ -44,7 +44,7 @@ tags: - intel-inst -- name: Inst - Extract Dynamic Device Personalization (DDP) Package +- name: Extract Dynamic Device Personalization (DDP) Package ansible.builtin.unarchive: remote_src: true src: "{{ intel_extract_dir }}/800-Series-Comms-Binary-Package-{{ ddp }}.zip" @@ -54,7 +54,7 @@ tags: - intel-inst -- name: Inst - Extract Dynamic Device Personalization (DDP) Package +- name: Extract Dynamic Device Personalization (DDP) Package ansible.builtin.unarchive: remote_src: true src: "{{ intel_extract_dir }}/ice_comms-{{ ddp }}.zip" @@ -63,7 +63,7 @@ tags: - intel-inst -- name: Inst - Copy Dynamic Device Personalization (DDP) Package +- name: Copy Dynamic Device Personalization (DDP) Package ansible.builtin.copy: src: "{{ intel_extract_dir }}/ice_comms-{{ ddp }}.pkg" dest: "/lib/firmware/updates/intel/ice/ddp/ice-{{ ddp }}.pkg" @@ -72,7 +72,7 @@ tags: - intel-inst -- name: Inst - Link Dynamic Device Personalization (DDP) Package +- name: Link Dynamic Device Personalization (DDP) Package ansible.builtin.file: src: "ice-{{ ddp }}.pkg" dest: "/lib/firmware/updates/intel/ice/ddp/ice.pkg" @@ -80,7 +80,7 @@ tags: - intel-inst -- name: Inst - Extract Dynamic Device Personalization (DDP) Package (cleanup) +- name: Extract Dynamic Device Personalization (DDP) Package (cleanup) ansible.builtin.file: path: "{{ item }}" state: absent diff --git a/fdio.infra.ansible/roles/intel/tasks/main.yaml b/fdio.infra.ansible/roles/intel/tasks/main.yaml index 864811b218..7f0640a8d6 100644 --- a/fdio.infra.ansible/roles/intel/tasks/main.yaml +++ b/fdio.infra.ansible/roles/intel/tasks/main.yaml @@ -1,7 +1,7 @@ --- -# file: roles/intel/tasks/main.yaml +# file: tasks/main.yaml -- name: Inst - Update Package Cache (APT) +- name: Update Package Cache (APT) ansible.builtin.apt: update_cache: true cache_valid_time: 3600 @@ -10,14 +10,14 @@ tags: - intel-inst-drivers -- name: Inst - Prerequisites +- name: Install Prerequisites ansible.builtin.package: name: "{{ packages | flatten(levels=1) }}" state: latest tags: - intel-inst-drivers -- name: Inst - Check Presence of Intel Ethernet 700 Series +- name: Check Presence of Intel Ethernet 700 Series ansible.builtin.shell: "lspci -d 8086:1583; lspci -d 8086:1585; lspci -d 8086:1572; lspci -d 8086:158a; lspci -d 8086:158b" register: intel_700_pcis failed_when: false @@ -25,7 +25,7 @@ tags: - intel-inst-drivers -- name: Inst - Check Presence of Intel Ethernet 800 Series +- name: Check Presence of Intel Ethernet 800 Series ansible.builtin.shell: "lspci -d 8086:1592; lspci -d 8086:1891" register: intel_800_pcis failed_when: false @@ -33,7 +33,15 @@ tags: - intel-inst-drivers -- name: Inst - Get Intel Ethernet 700 Series driver versions +- name: Check Presence of Intel DSA + ansible.builtin.shell: "lspci -d 8086:0b25" + register: intel_dsa_pcis + failed_when: false + changed_when: false + tags: + - intel-inst-drivers + +- name: Get Intel Ethernet 700 Series driver versions ansible.builtin.set_fact: i40e: "{{ intel_700_compatibility_matrix[intel_700_matrix]['i40e'] }}" iavf: "{{ intel_700_compatibility_matrix[intel_700_matrix]['iavf'] }}" @@ -43,7 +51,7 @@ tags: - intel-inst-drivers -- name: Inst - Get Intel Ethernet 800 Series driver versions +- name: Get Intel Ethernet 800 Series driver versions ansible.builtin.set_fact: ice: "{{ intel_800_compatibility_matrix[intel_800_matrix]['ice'] }}" ddp: "{{ intel_800_compatibility_matrix[intel_800_matrix]['ddp'] }}" @@ -54,7 +62,15 @@ tags: - intel-inst-drivers -- name: Inst - Driver Intel Ethernet 700 Series +- name: Get Intel DSA driver versions + ansible.builtin.set_fact: + dsa: "{{ intel_dsa_compatibility_matrix['dsa'] }}" + when: > + intel_dsa_matrix is defined + tags: + - intel-inst-drivers + +- name: Driver Intel Ethernet 700 Series import_tasks: i40e.yaml when: > intel_700_pcis.stdout_lines | length > 0 and @@ -62,7 +78,7 @@ tags: - intel-inst-drivers -- name: Inst - Driver Intel Ethernet 800 Series +- name: Driver Intel Ethernet 800 Series import_tasks: ice.yaml when: > intel_800_pcis.stdout_lines | length > 0 and @@ -70,12 +86,20 @@ tags: - intel-inst-drivers -- name: Inst - Driver Intel iAVF +- name: Driver Intel iAVF import_tasks: iavf.yaml when: > (intel_700_pcis.stdout_lines | length > 0 and - intel_700_matrix is defined ) or + intel_700_matrix is defined) or (intel_800_pcis.stdout_lines | length > 0 and intel_800_matrix is defined) tags: - intel-inst-drivers + +- name: Driver Intel DSA + import_tasks: dsa.yaml + when: > + intel_dsa_pcis.stdout_lines | length > 0 and + intel_dsa_matrix is defined + tags: + - intel-inst-drivers diff --git a/topologies/available/lf_2n_spr_testbed23.yaml b/topologies/available/lf_2n_spr_testbed23.yaml index e83090ec17..26906a8e52 100644 --- a/topologies/available/lf_2n_spr_testbed23.yaml +++ b/topologies/available/lf_2n_spr_testbed23.yaml @@ -15,6 +15,15 @@ nodes: port: 22 username: testuser password: Csit1234 + bus: + device1: + pci_address: "0000:75:01.0" + driver: idxd + model: Intel-DSA + device2: + pci_address: "0000:f2:01.0" + driver: idxd + model: Intel-DSA interfaces: port1: # s57-t23-tg1-c2/p1 - 200GE port1 Mellanox ConnectX7-2p200GE. @@ -120,6 +129,15 @@ nodes: username: testuser password: Csit1234 uio_driver: vfio-pci + bus: + device1: + pci_address: "0000:75:01.0" + driver: idxd + model: Intel-DSA + device2: + pci_address: "0000:f2:01.0" + driver: idxd + model: Intel-DSA interfaces: port1: # s56-t23-sut1-c2/p1 - 200GE port1 Mellanox ConnectX7-2p200GE. -- cgit 1.2.3-korg