Skip to content

Commit d6eb243

Browse files
Merge pull request #1719 from tkatila/gnrd-qat-support
Add QAT support for 420xx driver and the 4946 device (GNR-D)
2 parents 6bdd3ac + 78d416f commit d6eb243

File tree

11 files changed

+25
-11
lines changed

11 files changed

+25
-11
lines changed

.github/workflows/lib-e2e.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,13 @@ jobs:
2727
- intel-idxd-config-initcontainer
2828
- accel-config-demo
2929
- intel-deviceplugin-operator
30+
- name: e2e-qat-gnrd
31+
targetjob: e2e-qat FOCUS="Mode:dpdk.*Resource:(cy|dc)" SKIP=App:crypto-perf
32+
runner: simics-gnrd
33+
images:
34+
- intel-qat-plugin
35+
- intel-qat-initcontainer
36+
- openssl-qat-engine
3037
- name: e2e-qat
3138
targetjob: e2e-qat FOCUS=Resource:generic
3239
runner: qat

cmd/qat_plugin/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ The QAT plugin can take a number of command line arguments, summarised in the fo
4343
| Flag | Argument | Meaning |
4444
|:---- |:-------- |:------- |
4545
| -dpdk-driver | string | DPDK Device driver for configuring the QAT device (default: `vfio-pci`) |
46-
| -kernel-vf-drivers | string | Comma separated list of the QuickAssist VFs to search and use in the system. Devices supported: DH895xCC, C62x, C3xxx, 4xxx/401xx/402xx, C4xxx and D15xx (default: `c6xxvf,4xxxvf`) |
46+
| -kernel-vf-drivers | string | Comma separated list of the QuickAssist VFs to search and use in the system. Devices supported: DH895xCC, C62x, C3xxx, 4xxx/401xx/402xx, 420xx, C4xxx and D15xx (default: `c6xxvf,4xxxvf,420xxvf`) |
4747
| -max-num-devices | int | maximum number of QAT devices to be provided to the QuickAssist device plugin (default: `64`) |
4848
| -mode | string | Deprecated: plugin mode which can be either `dpdk` or `kernel` (default: `dpdk`).|
4949
| -allocation-policy | string | 2 possible values: balanced and packed. Balanced mode spreads allocated QAT VF resources balanced among QAT PF devices, and packed mode packs one QAT PF device full of QAT VF resources before allocating resources from the next QAT PF. (There is no default.) |
@@ -132,7 +132,7 @@ In addition to the default configuration, you can add device-specific configurat
132132

133133
| Device | Possible Configuration | How To Customize | Options | Notes |
134134
|:-------|:-----------------------|:-----------------|:--------|:------|
135-
| 4xxx, 401xx,402xx | [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` | Linux 6.0+ kernel is required. |
135+
| 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. |
136136

137137
To create a provisioning `configMap`, run the following command before deploying initcontainer:
138138

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

249249
```bash
250-
for i in 0442 0443 18a1 37c9 6f55 19e3 4941 4943; do lspci -d 8086:$i; done
250+
for i in 0442 0443 18a1 37c9 6f55 19e3 4941 4943 4945 4947; do lspci -d 8086:$i; done
251251
```
252252

253253
[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: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ var qatDeviceDriver = map[string]string{
6666
"4941": "4xxxvf",
6767
"4943": "4xxxvf",
6868
"4945": "4xxxvf",
69+
"4947": "420xxvf",
6970
"37c9": "c6xxvf",
7071
"6f55": "d15xxvf",
7172
}
@@ -382,7 +383,7 @@ func readDeviceConfiguration(pfDev string) string {
382383
}
383384

384385
devCfgPath := filepath.Join(filepath.Dir(filepath.Join(pfDev, "../../")), "kernel/debug",
385-
fmt.Sprintf("qat_4xxx_%s/dev_cfg", filepath.Base(pfDev)))
386+
fmt.Sprintf("qat_%s_%s/dev_cfg", getCurrentDriver(pfDev), filepath.Base(pfDev)))
386387

387388
devCfg, err := ini.LoadSources(lOpts, devCfgPath)
388389
if err != nil {
@@ -434,6 +435,7 @@ func getDeviceCapabilities(device string) (string, error) {
434435
"4941": {}, // QAT Gen4 (4xxx) VF PCI ID
435436
"4943": {}, // QAT Gen4 (401xx) VF PCI ID
436437
"4945": {}, // QAT Gen4 (402xx) VF PCI ID
438+
"4947": {}, // QAT Gen4 (420xx) VF PCI ID
437439
}
438440

439441
if _, ok := devicesWithCapabilities[devID]; !ok {

cmd/qat_plugin/qat_plugin.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ func main() {
4040
mode := flag.String("mode", "dpdk", "plugin mode which can be either dpdk (default) or kernel")
4141

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

demo/qat-init.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
#!/usr/bin/env bash
22
# This script is based on qatlib's qat_init.sh
33
NODE_NAME="${NODE_NAME:-}"
4-
ENABLED_QAT_PF_PCIIDS=${ENABLED_QAT_PF_PCIIDS:-37c8 4940 4942 4944}
4+
ENABLED_QAT_PF_PCIIDS=${ENABLED_QAT_PF_PCIIDS:-37c8 4940 4942 4944 4946}
55
DEVS=$(for pf in $ENABLED_QAT_PF_PCIIDS; do lspci -n | grep -e "$pf" | grep -o -e "^\\S*"; done)
66
SERVICES_LIST="sym asym sym;asym dc sym;dc asym;dc"
77
QAT_4XXX_DEVICE_PCI_ID="0x4940"
88
QAT_401XX_DEVICE_PCI_ID="0x4942"
99
QAT_402XX_DEVICE_PCI_ID="0x4944"
10+
QAT_420XX_DEVICE_PCI_ID="0x4946"
1011
SERVICES_ENABLED="NONE"
1112
SERVICES_ENABLED_FOUND="FALSE"
1213

@@ -31,7 +32,7 @@ sysfs_config() {
3132
for dev in $DEVS; do
3233
DEVPATH="/sys/bus/pci/devices/0000:$dev"
3334
PCI_DEV=$(cat "$DEVPATH"/device 2> /dev/null)
34-
if [ "$PCI_DEV" != "$QAT_4XXX_DEVICE_PCI_ID" ] && [ "$PCI_DEV" != "$QAT_401XX_DEVICE_PCI_ID" ] && [ "$PCI_DEV" != "$QAT_402XX_DEVICE_PCI_ID" ]; then
35+
if [ "$PCI_DEV" != "$QAT_4XXX_DEVICE_PCI_ID" ] && [ "$PCI_DEV" != "$QAT_401XX_DEVICE_PCI_ID" ] && [ "$PCI_DEV" != "$QAT_402XX_DEVICE_PCI_ID" ] && [ "$PCI_DEV" != "$QAT_420XX_DEVICE_PCI_ID" ]; then
3536
continue
3637
fi
3738

deployments/nfd/overlays/node-feature-rules/node-feature-rules.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ spec:
9595
- feature: pci.device
9696
matchExpressions:
9797
vendor: {op: In, value: ["8086"]}
98-
device: {op: In, value: ["37c8", "4940", "4942", "4944"]}
98+
device: {op: In, value: ["37c8", "4940", "4942", "4944", "4946"]}
9999
class: {op: In, value: ["0b40"]}
100100
- feature: kernel.loadedmodule
101101
matchExpressions:

deployments/operator/crd/bases/deviceplugin.intel.com_qatdeviceplugins.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ spec:
8181
- c3xxxvf
8282
- d15xxvf
8383
- 4xxxvf
84+
- 420xxvf
8485
- c4xxxvf
8586
type: string
8687
type: array

deployments/operator/samples/deviceplugin_v1_qatdeviceplugin.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ spec:
1515
kernelVfDrivers:
1616
- c6xxvf
1717
- 4xxxvf
18+
- 420xxvf
1819
maxNumDevices: 1
1920
logLevel: 4
2021
nodeSelector:

pkg/apis/deviceplugin/v1/qatdeviceplugin_types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import (
2121

2222
// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.
2323

24-
// +kubebuilder:validation:Enum={"dh895xccvf","c6xxvf","c3xxxvf","d15xxvf","4xxxvf","c4xxxvf"}
24+
// +kubebuilder:validation:Enum={"dh895xccvf","c6xxvf","c3xxxvf","d15xxvf","4xxxvf", "420xxvf", "c4xxxvf"}
2525

2626
// KernelVfDriver is a VF device driver for QuickAssist devices.
2727
type KernelVfDriver string

pkg/apis/deviceplugin/v1/qatdeviceplugin_webhook.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,8 @@ func (r *QatDevicePlugin) validatePlugin() error {
9292
// check if 4xxxvf is enabled
9393
contains := false
9494
devicesWithCapabilities := map[KernelVfDriver]struct{}{
95-
"4xxxvf": {},
95+
"4xxxvf": {},
96+
"420xxvf": {},
9697
}
9798

9899
for _, kernelVfDriver := range r.Spec.KernelVfDrivers {
@@ -103,7 +104,7 @@ func (r *QatDevicePlugin) validatePlugin() error {
103104
}
104105

105106
if !contains {
106-
return errors.Errorf("ProvisioningConfig is available only for 4xxx devices")
107+
return errors.Errorf("ProvisioningConfig is available only for 4xxx and 420xx devices")
107108
}
108109
}
109110

pkg/controllers/qat/controller.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,7 @@ func setInitContainer(dsSpec *v1.PodSpec, dpSpec devicepluginv1.QatDevicePluginS
213213
"c6xxvf": "37c8",
214214
"d15xxvf": "6f54",
215215
"4xxxvf": "4940 4942 4944",
216+
"420xxvf": "4946",
216217
"c4xxxvf": "18a0",
217218
}
218219

0 commit comments

Comments
 (0)