blob: 1c113dbe8f16c05a84fdeb55590e6998442fdf7e [file] [log] [blame]
---
# qat tasks/qat.yml
#
# SPDX-FileCopyrightText: © 2021 Open Networking Foundation <support@opennetworking.org>
# SPDX-License-Identifier: Apache-2.0
- name: Blacklist kernel QAT drivers
blockinfile:
create: true
dest: /etc/modprobe.d/blacklist-intel_qat.conf
mode: 0644
block: |
# Blacklist kernel QAT drivers
blacklist qat_c62x
blacklist qat_c62xvf
blacklist qat_c6xx
blacklist qat_c6xxvf
blacklist qat_c3xxx
blacklist qat_c3xxxvf
blacklist qat_d15xx
blacklist qat_d15xxvf
blacklist qat_c4xxx
blacklist qat_c4xxxvf
blacklist intel_qat
backup: true
notify: reboot qat
- name: Flush handlers
meta: flush_handlers
- name: Install QAT driver compile requirements
apt:
name:
- "libboost-all-dev"
- "pciutils-dev"
- "libssl-dev"
- "build-essential"
- "pkg-config"
- "yasm"
state: "present"
update_cache: true
- name: Create root folder for QAT driver
file:
path: "{{ sriov_qat_driver_dir }}"
state: directory
owner: root
group: root
mode: "0644"
- name: Download QAT driver .tgz file
get_url:
url: "{{ sriov_qat_latest_url }}"
dest: "{{ sriov_qat_driver_dir }}/{{ sriov_qat_latest_name }}"
owner: "root"
group: "root"
mode: "0644"
checksum: "{{ sriov_qat_checksum }}"
- name: Unarchive QAT driver .tgz file
when: not sriov_qat_dkms_enabled
unarchive:
remote_src: true
list_files: true
src: "{{ sriov_qat_driver_dir }}/{{ sriov_qat_latest_name }}"
dest: "{{ sriov_qat_driver_dir }}"
owner: "root"
group: "root"
creates: "{{ sriov_qat_driver_dir }}/configure"
- name: Configure QAT driver with SR-IOV host
when: not sriov_qat_dkms_enabled
command:
cmd: "./configure --enable-icp-sriov=host"
chdir: "{{ sriov_qat_driver_dir }}"
creates: "{{ sriov_qat_driver_dir }}/config.status"
- name: Run the default target as root
when: not sriov_qat_dkms_enabled
command:
cmd: make
chdir: "{{ sriov_qat_driver_dir }}"
creates: "{{ sriov_qat_driver_dir }}/build/intel_qat.ko"
- name: Run 'install' target as root
when: not sriov_qat_dkms_enabled
command:
chdir: "{{ sriov_qat_driver_dir }}"
cmd: "make install"
creates: "/usr/local/bin/adf_ctl"
# - name: Run 'install-samples' target as root
# # command:
# chdir: "{{ sriov_qat_driver_dir }}"
# cmd: "make install-samples"
# creates: "{{ sriov_qat_driver_dir }}/build/cpa_sample_code"
# become: yes
- name: Create sriov_qat system servqat
template:
src: "{{ item.src }}"
dest: "{{ item.dest }}"
mode: "{{ item.mode }}"
owner: root
group: root
loop:
- {
src: "sriov_qat.sh.j2",
dest: "/usr/local/bin/sriov_qat.sh",
mode: "a+x",
}
- {
src: "sriov_qat.service.j2",
dest: "/etc/systemd/system/sriov_qat.service",
mode: 644,
}
notify: enable sriov_qat.service