Skip to content

Commit 769e1d5

Browse files
authored
Merge pull request #2094 from mythi/PR-2025-011
qat: QAT Gen6
2 parents c81472c + 6cd39b9 commit 769e1d5

27 files changed

+72
-104
lines changed

.github/workflows/lib-publish.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ on:
1111
required: false
1212
type: string
1313
env:
14-
no_base_check: "['intel-qat-plugin-kerneldrv', 'intel-idxd-config-initcontainer', 'crypto-perf', 'opae-nlb-demo', 'intel-gpu-levelzero']"
14+
no_base_check: "['intel-idxd-config-initcontainer', 'crypto-perf', 'opae-nlb-demo', 'intel-gpu-levelzero']"
1515

1616
permissions:
1717
contents: read

.github/workflows/lib-validate.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@ jobs:
6464
- name: Check Dockerfiles
6565
run: make check-dockerfiles
6666
- run: make go-mod-tidy
67-
- run: make BUILDTAGS=kerneldrv
68-
- run: make test BUILDTAGS=kerneldrv
67+
- run: make
68+
- run: make test
6969
env:
7070
UNITTEST: 1
7171
- run: make check-github-actions
@@ -77,9 +77,9 @@ jobs:
7777
strategy:
7878
matrix:
7979
version:
80-
- 1.30.x
8180
- 1.31.x
8281
- 1.32.x
82+
- 1.33.x
8383
steps:
8484
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
8585
- uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5

.golangci.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
version: "2"
22
run:
3-
build-tags:
4-
- kerneldrv
53
tests: true
64
linters:
75
default: none

.trivyignore.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ misconfigurations:
44
paths:
55
- dlb_plugin/base/intel-dlb-plugin.yaml
66
- fpga_plugin/base/intel-fpga-plugin-daemonset.yaml
7-
- qat_plugin/base/intel-qat-kernel-plugin.yaml
87
- qat_plugin/overlays/qat_initcontainer/qat_initcontainer.yaml
98

109
- id: AVD-KSV-0017
@@ -13,7 +12,6 @@ misconfigurations:
1312
- dlb_plugin/overlays/dlb_initcontainer/dlb_initcontainer.yaml
1413
- dsa_plugin/overlays/dsa_initcontainer/dsa_initcontainer.yaml
1514
- iaa_plugin/overlays/iaa_initcontainer/iaa_initcontainer.yaml
16-
- qat_plugin/base/intel-qat-kernel-plugin.yaml
1715
- qat_plugin/overlays/qat_initcontainer/qat_initcontainer.yaml
1816

1917
- id: AVD-KSV-0047

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ BUILDER ?= "docker"
99
EXTRA_BUILD_ARGS ?= ""
1010

1111
CERT_MANAGER_VERSION ?= v1.15.2
12-
CONTROLLER_GEN_VERSION ?= v0.17.0
12+
CONTROLLER_GEN_VERSION ?= v0.18.0
1313
GOLANGCI_LINT_VERSION ?= v2.1.6
1414
KIND_VERSION ?= v0.23.0
1515
GOLICENSES_VERSION ?= v1.6.0

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ The summary of resources available via plugins in this repository is given in th
244244
* [iaa-accel-config-demo-pod.yaml](demo/iaa-accel-config-demo-pod.yaml)
245245
* `npu.intel.com` : `accel`
246246
* [intel-npu-workload.yaml](demo/intel-npu-workload.yaml)
247-
* `qat.intel.com` : `generic` or `cy`/`dc`/`asym-dc`/`sym-dc`
247+
* `qat.intel.com` : `generic` or `cy`/`dc`/`asym-[dc|decomp]`/`sym-[dc|decomp]`/`asym-[dc|decomp]`/`asym-sym-[dc|decomp]`/`dcc`/`decomp`
248248
* [compress-perf-dpdk-pod-requesting-qat-dc.yaml](deployments/qat_dpdk_app/compress-perf/compress-perf-dpdk-pod-requesting-qat-dc.yaml)
249249
* [crypto-perf-dpdk-pod-requesting-qat-cy.yaml](deployments/qat_dpdk_app/crypto-perf/crypto-perf-dpdk-pod-requesting-qat-cy.yaml)
250250
* `sgx.intel.com` : `epc`

cmd/qat_plugin/README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Supported Devices include, but may not be limited to, the following:
3232
The QAT device plugin provides access to QAT hardware accelerated cryptographic and compression features
3333
through the SR-IOV virtual functions (VF). Demonstrations are provided utilising [DPDK](https://doc.dpdk.org/) and [OpenSSL](https://www.openssl.org/).
3434

35-
QAT Kubernetes resources show up as `qat.intel.com/generic` on systems _before_ QAT Gen4 (4th Gen Xeon®) and `qat.intel.com/[cy|dc]` on QAT Gen4.
35+
QAT Kubernetes resources show up as `qat.intel.com/generic` on systems _before_ QAT Gen4 (4th Gen Xeon&reg;) and `qat.intel.com/[<configured services>]` on QAT Gen4+.
3636

3737
## Modes and Configuration Options
3838

@@ -120,8 +120,10 @@ In addition to the default configuration, you can add device-specific configurat
120120

121121
| Device | Possible Configuration | How To Customize | Options | Notes |
122122
|:-------|:-----------------------|:-----------------|:--------|:------|
123-
| 4xxx, 401xx, 402xx, 420xx | [cfg_services](https://github.com/torvalds/linux/blob/v6.6-rc5/Documentation/ABI/testing/sysfs-driver-qat) reports the configured services (crypto services or compression services) of the QAT device. | `ServicesEnabled=<value>` | compress:`dc`, crypto:`sym;asym`, <br>crypto+compress:`asym;dc`,<br>crypto+compress:`sym;dc` | 4xxx/401xx/402xx: Linux 6.0+ kernel. 420xx: Linux 6.8+ kernel. |
124-
| 4xxx, 401xx, 402xx, 420xx | [auto_reset](https://github.com/torvalds/linux/blob/a38297e3fb012ddfa7ce0321a7e5a8daeb1872b6/Documentation/ABI/testing/sysfs-driver-qat#L145) reports the setting of the QAT device's automatic error recovery functionality. | `AutoresetEnabled=<value>` | `on`, `off`, | Linux 6.8+ kernel. |
123+
| 4xxx, 401xx, 402xx, 420xx, 6xxx | [cfg_services](https://github.com/torvalds/linux/blob/v6.16/Documentation/ABI/testing/sysfs-driver-qat) reports the configured services (crypto services or compression services) of the QAT device. | `ServicesEnabled=<value>` | Available services: compress:`dc`, de-compress: `decomp`, (`6xxx` only), dc chaining feature: `dcc`, symmetric crypto: `sym`, asymmetric crypto: `asym`, | 4xxx/401xx/402xx: Linux 6.0+, 420xx: Linux 6.8+, 6xxx Linux 6.16. |
124+
| 4xxx, 401xx, 402xx, 420xx, 6xxx | [auto_reset](https://github.com/torvalds/linux/blob/v6.16/Documentation/ABI/testing/sysfs-driver-qat#L145) reports the setting of the QAT device's automatic error recovery functionality. | `AutoresetEnabled=<value>` | `on`, `off`, | 4xxx/401xx/402xx/420xx: Linux 6.8+, 6xxx: Linux 6.16+ |
125+
126+
**Note:** Service combinations are permitted for all services except `dcc`. On QAT Gen4 devices (`qat_4xxx` driver) a maximum of two services can be combined and on QAT Gen6 devices (`qat_6xxx` driver) a maximum of three services can be combined. The order of services is not significant. For instance, `sym;asym` is functionally equivalent to `asym;sym`.
125127

126128
To create a provisioning `configMap`, run the following command before deploying initcontainer:
127129

@@ -215,7 +217,7 @@ In order to utilise the QAT device plugin, QuickAssist SR-IOV virtual functions
215217
You can verify this on your nodes by checking for the relevant PCI identifiers:
216218

217219
```bash
218-
for i in 0442 0443 18a1 37c9 6f55 19e3 4941 4943 4945 4947; do lspci -d 8086:$i; done
220+
for i in 0442 0443 18a1 37c9 6f55 19e3 4941 4943 4945 4947 4949; do lspci -d 8086:$i; done
219221
```
220222

221223
[1]:https://www-ssl.intel.com/content/www/us/en/design/products-and-solutions/processors-and-chipsets/purley/intel-xeon-scalable-processors.html

cmd/qat_plugin/dpdkdrv/dpdkdrv.go

Lines changed: 10 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ var qatDeviceDriver = map[string]string{
6666
"4943": "4xxxvf",
6767
"4945": "4xxxvf",
6868
"4947": "420xxvf",
69+
"4949": "6xxxvf",
6970
"37c9": "c6xxvf",
7071
"6f55": "d15xxvf",
7172
}
@@ -352,7 +353,7 @@ func readDeviceConfiguration(pfDev string) string {
352353
}
353354

354355
if err2 == nil && len(qatCfgServices) != 0 {
355-
return strings.TrimSpace(string(qatCfgServices))
356+
return strings.Join(strings.SplitN(strings.TrimSpace(string(qatCfgServices)), ";", 3), "-")
356357
}
357358
}
358359

@@ -392,8 +393,7 @@ func getDeviceHealthiness(device string, lookup map[string]string) string {
392393
hbStatusFile := filepath.Join(filepath.Dir(filepath.Join(pfDev, "../../")), "kernel/debug",
393394
fmt.Sprintf("qat_%s_%s/heartbeat/status", driver, filepath.Base(pfDev)))
394395

395-
// If status reads "-1", the device is considered bad:
396-
// https://github.com/torvalds/linux/blob/v6.6-rc5/Documentation/ABI/testing/debugfs-driver-qat
396+
// If status reads "-1", the device is considered bad.
397397
if data, err := os.ReadFile(hbStatusFile); err == nil && strings.Split(string(data), "\n")[0] == "-1" {
398398
healthiness = pluginapi.Unhealthy
399399
}
@@ -414,6 +414,7 @@ func getDeviceCapabilities(device string) (string, error) {
414414
"4943": {}, // QAT Gen4 (401xx) VF PCI ID
415415
"4945": {}, // QAT Gen4 (402xx) VF PCI ID
416416
"4947": {}, // QAT Gen4 (420xx) VF PCI ID
417+
"4949": {}, // QAT Gen6 (6xxx) VF PCI ID
417418
}
418419

419420
if _, ok := devicesWithCapabilities[devID]; !ok {
@@ -426,27 +427,14 @@ func getDeviceCapabilities(device string) (string, error) {
426427
return defaultCapabilities, nil
427428
}
428429

429-
switch readDeviceConfiguration(pfDev) {
430-
case "sym;asym":
430+
services := readDeviceConfiguration(pfDev)
431+
switch services {
432+
case "sym-asym":
433+
fallthrough
434+
case "asym-sym":
431435
return "cy", nil
432-
case "asym;sym":
433-
return "cy", nil
434-
case "dc":
435-
return "dc", nil
436-
case "sym":
437-
return "sym", nil
438-
case "asym":
439-
return "asym", nil
440-
case "asym;dc":
441-
return "asym-dc", nil
442-
case "dc;asym":
443-
return "asym-dc", nil
444-
case "sym;dc":
445-
return "sym-dc", nil
446-
case "dc;sym":
447-
return "sym-dc", nil
448436
default:
449-
return defaultCapabilities, nil
437+
return services, nil
450438
}
451439
}
452440

cmd/qat_plugin/dpdkdrv/dpdkdrv_test.go

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -484,6 +484,34 @@ func TestScan(t *testing.T) {
484484
maxDevNum: 1,
485485
expectedDevNum: 1,
486486
},
487+
{
488+
name: "vfio-pci DPDKdriver with no kernel bound driver and where vfdevID is equal to qatDevId (4949), PF with decomp capabilities from sysfs",
489+
dpdkDriver: "vfio-pci",
490+
kernelVfDrivers: []string{"6xxxvf"},
491+
dirs: []string{
492+
"sys/bus/pci/drivers/6xxx",
493+
"sys/bus/pci/drivers/vfio-pci",
494+
"sys/devices/pci0000:02/0000:02:00.0",
495+
"sys/devices/pci0000:02/0000:02:00.0/qat",
496+
"sys/kernel/debug/qat_6xxx_0000:02:00.0",
497+
"sys/bus/pci/devices/0000:02:01.0",
498+
},
499+
files: map[string][]byte{
500+
"sys/devices/pci0000:02/0000:02:00.0/device": []byte("0x4948"),
501+
"sys/devices/pci0000:02/0000:02:00.0/qat/state": []byte("up"),
502+
"sys/devices/pci0000:02/0000:02:00.0/qat/cfg_services": []byte("decomp"),
503+
"sys/bus/pci/devices/0000:02:01.0/device": []byte("0x4949"),
504+
},
505+
symlinks: map[string]string{
506+
"sys/bus/pci/devices/0000:02:01.0/iommu_group": "sys/kernel/iommu_groups/vfiotestfile",
507+
"sys/bus/pci/devices/0000:02:01.0/physfn": "sys/devices/pci0000:02/0000:02:00.0",
508+
"sys/bus/pci/drivers/6xxx/0000:02:00.0": "sys/devices/pci0000:02/0000:02:00.0",
509+
"sys/bus/pci/devices/0000:02:00.0": "sys/devices/pci0000:02/0000:02:00.0",
510+
"sys/devices/pci0000:02/0000:02:00.0/virtfn0": "sys/bus/pci/devices/0000:02:01.0",
511+
},
512+
maxDevNum: 1,
513+
expectedDevNum: 1,
514+
},
487515
{
488516
name: "vfio-pci DPDKdriver with no kernel bound driver and where vfdevID is equal to qatDevId (4941), two PFs with dc and cy capabilities",
489517
dpdkDriver: "vfio-pci",

cmd/qat_plugin/qat_plugin.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ func main() {
3535
)
3636

3737
dpdkDriver := flag.String("dpdk-driver", "vfio-pci", "DPDK Device driver for configuring the QAT device")
38-
kernelVfDrivers := flag.String("kernel-vf-drivers", "4xxxvf,420xxvf", "Comma separated VF Device Driver of the QuickAssist Devices in the system. Devices supported: DH895xCC, C62x, C3xxx, C4xxx, 4xxx, 420xxx, and D15xx")
38+
kernelVfDrivers := flag.String("kernel-vf-drivers", "4xxxvf,420xxvf", "Comma separated VF Device Driver of the QuickAssist Devices in the system. Devices supported: DH895xCC, C62x, C3xxx, C4xxx, 4xxx, 420xxx, 6xxx, and D15xx")
3939
preferredAllocationPolicy := flag.String("allocation-policy", "", "Modes of allocating QAT devices: balanced and packed")
4040
maxNumDevices := flag.Int("max-num-devices", 64, "maximum number of QAT devices to be provided to the QuickAssist device plugin")
4141
flag.Parse()

0 commit comments

Comments
 (0)