Commit Graph

118 Commits

Author SHA1 Message Date
Mikko Ylinen
fe3eaeeb0b qat: drop AppArmor annotations
"unconfined" annotation was needed to get writes to new_id / bind
to succeed on AppArmor enabled OSes.

However, many things have changed:

* new_id should not be used anymore and it was dropped in the plugin.
* QAT initcontainer has assumed the role of HW initialization.
* vfio-pci is the preferred "dpdkDriver" and starting with QAT Gen4, it
is the only available VF driver so unbind isn't necessary.
* k8s AppArmor is "GA" since 1.30 and the annotation is deprecated.

As of now, the initcontainer will take care of binding QAT VFs to vfio-pci
so the plugin does not neeed to set AppArmor at all.

Signed-off-by: Mikko Ylinen <mikko.ylinen@intel.com>
2025-01-16 13:54:37 +02:00
Mikko Ylinen
aaa720a329 qat: drop setupDeviceIDs()
setupDeviceIDs() is obsoleted and the preferred approach is driver_override
already implemented in qat-init.sh initcontainer.

The new_id mechanism was added way before we had the initcontainer support in place.
Furthermore, at least for vfio-pci we don't need it at all if the driver uses
ids=8086:<qat VF dev IDs>.

Drop write attemps to new_id in favor of the initcontainer functionality.

Signed-off-by: Mikko Ylinen <mikko.ylinen@intel.com>
2025-01-16 13:54:37 +02:00
Mikko Ylinen
1a62423d21 qat-init: bind QAT VFs to vfio-pci
QAT device plugin has some initialization functions that require
special SecurityContext parameters (e.g., setting Apparmor policies
on some OSes).

It's better to move all of the initialization to the privileged
init-container that is already taking care some parts of it.

With this change, we default to vfio-pci "DpdkDrv".

Signed-off-by: Mikko Ylinen <mikko.ylinen@intel.com>
2025-01-16 13:54:37 +02:00
Hyeongju Johannes Lee
51b7745260 qat, initcontainer: add enablement of auto_reset
Signed-off-by: Hyeongju Johannes Lee <hyeongju.lee@intel.com>
2024-09-30 16:49:44 -07:00
Hyeongju Johannes Lee
ea6d52d443 QAT: make plugin read trimmed heartbeat status
Plugin used to consider only the value "-1" but there are some
cases when files show "\n" or "\n\x00". This makes plugin to have
wrong status of the device. So, trim the value after \n so only
numerical value can be read.

Signed-off-by: Hyeongju Johannes Lee <hyeongju.lee@intel.com>
2024-08-05 19:57:33 +03:00
Mikko Ylinen
5a59385a09 qat: drop c6xxvf from defaults
The devices searched by default are QAT Gen4+ only.

Signed-off-by: Mikko Ylinen <mikko.ylinen@intel.com>
2024-06-11 07:31:49 +03:00
Tuomas Katila
11c9753aca
Merge pull request #1745 from bart0sh/PR155-fpga-support-CDI
FPGA: support CDI
2024-05-28 11:19:58 +03:00
Ed Bartosh
988fbed528 deviceplugin: add DeviceInfo.hooks field 2024-05-22 13:13:38 +03:00
Hyeongju Johannes Lee
2af37fd4cb qat_dpdk_app: drop generic
Signed-off-by: Hyeongju Johannes Lee <hyeongju.lee@intel.com>
2024-05-07 20:46:12 +03:00
Tuomas Katila
ff91a97934
Merge pull request #1720 from mythi/PR-2024-010
ci: move to golangci-lint v1.57.2
2024-05-03 12:55:29 +03:00
Tuomas Katila
05bb8ef156 qat: add support for 420xx driver and its devices (4946)
Signed-off-by: Tuomas Katila <tuomas.katila@intel.com>
2024-05-02 11:36:13 +03:00
Mikko Ylinen
54f9d730e9 ci: move to golangci-lint v1.57.2
Signed-off-by: Mikko Ylinen <mikko.ylinen@intel.com>
2024-05-02 09:18:27 +03:00
hugo-syn
039865aec8
chore: Fix multiple typos (#1653)
* chore: Fix multiple typos

Signed-off-by: hugo-syn <hugo.vincent@synacktiv.com>
2024-01-25 08:18:48 +02:00
Oleg Zhurakivskyy
ab0e8bc146 qat: Add annotation configurability in the operator
Signed-off-by: Oleg Zhurakivskyy <oleg.zhurakivskyy@intel.com>
2024-01-09 10:20:16 +02:00
Tuomas Katila
5016f54e47 qat: add support for new capabilities
Signed-off-by: Tuomas Katila <tuomas.katila@intel.com>
2023-10-13 15:09:57 +03:00
Tuomas Katila
c7162df440 qat: add heartbeat check and use that as a device healthiness indicator
Signed-off-by: Tuomas Katila <tuomas.katila@intel.com>
2023-10-13 15:09:04 +03:00
Mikko Ylinen
4ba166a40e qat: make device ID scan less verbose
currently, the QAT plugin warns when it finds a PCI ID that is
not an enabled QAT device. This is too verbose so lower the
log priority to "Info".

Signed-off-by: Mikko Ylinen <mikko.ylinen@intel.com>
2023-09-20 14:02:52 +03:00
Mikko Ylinen
06f1db9fb8 qat: update README
The documentation needs clarifications to how QAT Gen4 SW differs from
older platfoms:

- only upstream driver is available and due to this, the -mode parameter
  is now deprecated
- the QAT VF services are configurable and thus the resource names
  differ

Signed-off-by: Mikko Ylinen <mikko.ylinen@intel.com>
2023-09-15 18:49:52 +03:00
Tuomas Katila
446ab6642f Fix QAT kernel driver links
Signed-off-by: Tuomas Katila <tuomas.katila@intel.com>
2023-08-02 12:07:09 +03:00
ZhangLi
ca96e5b312 Change the regular expression string of the device type to support sIOV device of QAT
The string of the sIOV device type exceeds the range of [[alnum]], such as:
# adf_ctl status
Checking status of all devices.
There is 2 QAT acceleration device(s) in the system:
 qat_dev0 - type: vqat-adi,  inst_id: 0,  node_id: 0,  bsf: 0000:00:08.0,  #accel: 1 #engines: 1 state: up
 qat_dev1 - type: vqat-adi,  inst_id: 1,  node_id: 0,  bsf: 0000:00:09.0,  #accel: 1 #engines: 1 state: up
2023-07-24 15:59:11 +08:00
Mikko Ylinen
d83a6418a7 qat: report cy/dc capabilities for 401xx/402xx too
Signed-off-by: Mikko Ylinen <mikko.ylinen@intel.com>
2023-05-24 14:26:04 +03:00
Hyeongju Johannes Lee
ffc2ce9b3c doc, qat: update document
default qat.conf file does not exist any more. Update it to make
user create own conf file or use --from-literal instead.

Signed-off-by: Hyeongju Johannes Lee <hyeongju.lee@intel.com>
2023-05-17 06:37:20 -07:00
Hyeongju Johannes Lee
cdfc3bb54e increase default maxNumDevices to 64
In case there are more than 32 devices and there is no config set,
all scanned devices have the same service. So, we increase the
default value of maxNumDevices to 64 from 32.

Signed-off-by: Hyeongju Johannes Lee <hyeongju.lee@intel.com>
2023-04-27 13:14:39 -07:00
Hyeongju Johannes Lee
1a41402903 qat init: make conf optional 2023-04-27 12:48:27 -07:00
Mikko Ylinen
934c00f5fc qat: add support for QAT 402xx
Based on
https://lore.kernel.org/linux-crypto/20230303165650.81405-1-damian.muszynski@intel.com/

Signed-off-by: Mikko Ylinen <mikko.ylinen@intel.com>
2023-03-09 15:06:30 +02:00
Tuomas Katila
26b8b9bd3d Update README kubectl applies for zsh support
Signed-off-by: Tuomas Katila <tuomas.katila@intel.com>
2022-12-29 12:25:29 +02:00
Mikko Ylinen
10a26b8fd8
Merge pull request #1234 from hj-johannes-lee/qat-cfgServices
qat: add configuration of cfgServices to qat initcontainer
2022-12-13 08:26:13 +02:00
Hyeongju Johannes Lee
a6037eae3c
qat: add configuration of cfgServices to qat initcontainer
Signed-off-by: Hyeongju Johannes Lee <hyeongju.lee@intel.com>
2022-12-12 21:48:21 +02:00
Mikko Ylinen
06701ab03c qat: minor doc updates
Signed-off-by: Mikko Ylinen <mikko.ylinen@intel.com>
2022-12-08 12:17:23 +02:00
Mikko Ylinen
fd1b25b9d4 docs: move away from 01.org doc links
Signed-off-by: Mikko Ylinen <mikko.ylinen@intel.com>
2022-10-03 18:22:07 +03:00
Mikko Ylinen
3abf10d7ff qat: read device capabilities from sysfs
Linux 6.0 adds sysfs-driver-qat entries to read device capabilities:
42e66b1cc3/Documentation/ABI/testing/sysfs-driver-qat

Implement the logic for reading from sysfs and prefer that over debugfs.

Signed-off-by: Mikko Ylinen <mikko.ylinen@intel.com>
2022-09-09 14:16:03 +03:00
Mikko Ylinen
307e960871 docs: fix remaining review comments
Signed-off-by: Mikko Ylinen <mikko.ylinen@intel.com>
2022-09-06 14:28:25 +03:00
Mikko Ylinen
1b3accacc2 docs: rework development guide
Currently, each individual plugin README documents roughly the same
daily development steps to git clone, build, and deploy. Re-purpose
the plugin READMEs more towards cluster admin type of documentation
and start moving all development related documentation to DEVEL.md.

The same is true for e2e testing documentation which is scattered
in places where they don't belong to. Having all day-to-day
development Howtos is good to have in a centralized place.

Finally, the cleanup includes some harmonization to plugins'
table of contents which now follows the pattern:

* [Introduction](#introduction)
(* [Modes and Configuration Options](#modes-and-configuration-options))
* [Installation](#installation)
    (* [Prerequisites](#prerequisites))
    * [Pre-built Images](#pre-built-images)
    * [Verify Plugin Registration](#verify-plugin-registration)
* [Testing and Demos](#testing-and-demos)
    * ...

Signed-off-by: Mikko Ylinen <mikko.ylinen@intel.com>
2022-08-31 20:00:15 +03:00
Mikko Ylinen
642c4f7b59 build: move to Go 1.19 and golangci-lint 1.48 because of that
Signed-off-by: Mikko Ylinen <mikko.ylinen@intel.com>
2022-08-15 10:13:37 +03:00
Mikko Ylinen
8987f1ba53 qat: add support for 401xx devices
QAT_401xx is a derivative of 4xxx. Add support for that device
by including the device IDs (both PF and VF).

Signed-off-by: Mikko Ylinen <mikko.ylinen@intel.com>
2022-06-02 08:11:39 +03:00
Mikko Ylinen
6ea51a3623 qat: kerneldrv: skip QAT Gen4 devices
Containers running on QAT Gen4 should be based on qatlib and therefore
kerneldrv is not the right mode. Skip registering 4xxx* devices to
ensure it is not used.

Signed-off-by: Mikko Ylinen <mikko.ylinen@intel.com>
2022-04-25 22:08:13 +03:00
Mikko Ylinen
069b9bd79a qat: 4xxx: split generic resource to compression and crypto
Signed-off-by: Mikko Ylinen <mikko.ylinen@intel.com>
2022-04-07 22:33:17 +03:00
Hyeongju Johannes Lee
d3c8063ff3 qat: implement preferredAllocation policies
Signed-off-by: Hyeongju Johannes Lee <hyeongju.lee@intel.com>
2022-04-07 14:14:00 +03:00
Tonny Tzeng
bf94f566fd doc: unify test images build with make
Signed-off-by: Tonny Tzeng <tonny.tzeng@intel.com>
2022-04-01 15:49:43 +08:00
Mikko Ylinen
1185f2329b crypto-perf: drop SYS_ADMIN capabilities
SYS_ADMIN capabilities are not necessary when using
vfio-pci.

Signed-off-by: Mikko Ylinen <mikko.ylinen@intel.com>
2022-02-16 11:26:20 +02:00
Ed Bartosh
55f3e17dd0 add 'annotations' parameter to the NewDeviceInfo API
Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>
2022-02-07 15:15:30 +02:00
Mikko Ylinen
c306f5ef68 qat: detect noiommu mode with VFIO
If the kernel has CONFIG_VFIO_NOIOMMU enabled and the node admin
has explicitly set enable_unsafe_noiommu_mode VFIO parameter,
VFIO taints the kernel and writes "vfio-noiommu" to the IOMMU
group name. If these conditions are true, the /dev/vfio/ devices
are prefixed with "noiommu-".

This use-case is documented for DPDK so we don't want to break
it (as it was before because we added DeviceMounts to
/dev/vfio/<iommugroup> files that did not exist).

See DPDK documentation for further information and warnings.

Signed-off-by: Mikko Ylinen <mikko.ylinen@intel.com>
2022-01-10 06:11:59 +02:00
Mikko Ylinen
c7e18d8b25 qat: rework driver binding
The new_id based driver binding is failing on kernels 5.11+ when the
QAT VF is not bound to any driver: attempts to write to new_id with
the same device ID repeatedly error with "file exists".

Move the new_id initialization to the beginning of the startup and
write the enabled device IDs only once.

This commit also fixes an issue where VF devices where not correctly detected
in virtual machines where the VF was not bound any driver.

Signed-off-by: Mikko Ylinen <mikko.ylinen@intel.com>
2021-12-21 08:20:02 +02:00
Mikko Ylinen
b48ca7f686 qat: update dpdkdrv unit tests
After a closer review, it was noticed that some of the QAT dpdkdrv
unit tests need updating:

- "Broken igb_uio DPDKdriver..." is actually testing unknown device ID
and we already have tests for it -> drop.
- "igb_uio DPDKdriver with one kernel bound device (not QAT device)" is
testing something impossible: an unknown VF devID is originated from a
QAT PF -> drop.
- creating files for unbind/new_id etc. is unnecessary because
os.WriteFile() creates them during the tests -> drop these lines to
simplify unit tests maintenance.

Signed-off-by: Mikko Ylinen <mikko.ylinen@intel.com>
2021-12-21 08:20:02 +02:00
Ed Bartosh
cec004c398 lint: enable wsl check
Fixes: #392

Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>
2021-12-17 11:48:48 +02:00
Mikko Ylinen
b921a4a458 qat: update default flags and deploy without ConfigMap
To make QAT plugin deployment consistent with the other plugins
we update the default flags and deploy without the flag settings
provided by the ConfigMap.

Signed-off-by: Mikko Ylinen <mikko.ylinen@intel.com>
2021-11-18 14:02:36 +02:00
Ed Bartosh
80829f72b1 ci: improve golangci job
- used the same go version as for the project build
- used verbose output
- fixed gofmt check failures

Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>
2021-11-13 00:32:25 +02:00
Mikko Ylinen
9d0d6cbe11 qat: set c6xxvf and 4xxxvf to default devices
The devices enabled by default are different between the
kustomize and operator based deployments.

This change harmonizes the defaults to c6xxvf and 4xxxvf
in both deployment options.

Signed-off-by: Mikko Ylinen <mikko.ylinen@intel.com>
2021-09-23 10:50:38 +03:00
Hyeongju Johannes Lee
8fc5df7e37 Add govet-fieldalignment
Add govet-fieldalignment to .golangci.yml
Fix errors that come from adding govet-fieldalignment
- by reordering the fields of structs
- by putting nolint:govet annotations

Signed-off-by: Hyeongju Johannes Lee <hyeongju.lee@intel.com>
2021-09-20 20:59:04 +03:00
Li Ning
dcc12d9089 documentation: remove deprecated toc section in README
The 'Verify node kubelet config' content was removed in 6b208f8.

Signed-off-by: Li Ning <ning.a.li@transwarp.io>
2021-09-07 19:38:41 +08:00