Skip to content

Commit 0d42dae

Browse files
authored
Merge pull request #2000 from mythi/PR-2025-005
qat: init: detect all system QAT devices
2 parents 4915bfe + 5f3a019 commit 0d42dae

11 files changed

+59
-47
lines changed

Diff for: .github/workflows/lib-e2e.yaml

+2-4
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,18 @@ jobs:
1212
matrix:
1313
include:
1414
- name: e2e-dsa-gnr
15-
targetjob: e2e-dsa SKIP="(App:dpdk-test)"
15+
targetjob: e2e-dsa SKIP="(App:(dpdk-test|accel-config))"
1616
runner: simics-gnr
1717
images:
1818
- intel-dsa-plugin
1919
- intel-idxd-config-initcontainer
20-
- accel-config-demo
2120
- intel-deviceplugin-operator
2221
- name: e2e-iaa-gnr
23-
targetjob: e2e-iaa
22+
targetjob: e2e-iaa SKIP="(App:accel-config)"
2423
runner: simics-gnr
2524
images:
2625
- intel-iaa-plugin
2726
- intel-idxd-config-initcontainer
28-
- accel-config-demo
2927
- intel-deviceplugin-operator
3028
- name: e2e-qat-gnrd
3129
targetjob: e2e-qat FOCUS="Mode:dpdk" SKIP="(App:(crypto-perf|compress-perf|qat-engine)|Functionality)"

Diff for: build/docker/intel-dlb-initcontainer.Dockerfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ ARG DIR=/intel-device-plugins-for-kubernetes
4040
WORKDIR $DIR
4141
COPY . .
4242
RUN install -D ${DIR}/LICENSE /install_root/licenses/intel-device-plugins-for-kubernetes/LICENSE
43-
ARG TOYBOX_VERSION="0.8.11"
44-
ARG TOYBOX_SHA256="83a3a88cbe1fa30f099c2f58295baef4637aaf988085aaea56e03aa29168175d"
43+
ARG TOYBOX_VERSION="0.8.12"
44+
ARG TOYBOX_SHA256="3c529d93923dde67d048e7bcbd5d1bc0dd1ad09362269e2415f5f2eaab349b5b"
4545
ARG ROOT=/install_root
4646
RUN apt-get update && apt-get --no-install-recommends -y install musl musl-tools musl-dev
4747
SHELL ["/bin/bash", "-o", "pipefail", "-c"]

Diff for: build/docker/intel-fpga-initcontainer.Dockerfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@ RUN install -D ${DIR}/LICENSE /install_root/licenses/intel-device-plugins-for-ku
6666
--save_path /install_root/licenses/$CMD/go-licenses ; \
6767
else mkdir -p /install_root/licenses/$CMD/go-licenses/ && cd licenses/$CMD && cp -r * /install_root/licenses/$CMD/go-licenses/ ; fi
6868
###
69-
ARG TOYBOX_VERSION="0.8.11"
70-
ARG TOYBOX_SHA256="83a3a88cbe1fa30f099c2f58295baef4637aaf988085aaea56e03aa29168175d"
69+
ARG TOYBOX_VERSION="0.8.12"
70+
ARG TOYBOX_SHA256="3c529d93923dde67d048e7bcbd5d1bc0dd1ad09362269e2415f5f2eaab349b5b"
7171
ARG ROOT=/install_root
7272
RUN apt-get update && apt-get --no-install-recommends -y install musl musl-tools musl-dev
7373
SHELL ["/bin/bash", "-o", "pipefail", "-c"]

Diff for: build/docker/intel-gpu-initcontainer.Dockerfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ RUN install -D ${DIR}/LICENSE /install_root/licenses/intel-device-plugins-for-ku
5656
--save_path /install_root/licenses/$CMD/go-licenses ; \
5757
else mkdir -p /install_root/licenses/$CMD/go-licenses/ && cd licenses/$CMD && cp -r * /install_root/licenses/$CMD/go-licenses/ ; fi
5858
###
59-
ARG TOYBOX_VERSION="0.8.11"
60-
ARG TOYBOX_SHA256="83a3a88cbe1fa30f099c2f58295baef4637aaf988085aaea56e03aa29168175d"
59+
ARG TOYBOX_VERSION="0.8.12"
60+
ARG TOYBOX_SHA256="3c529d93923dde67d048e7bcbd5d1bc0dd1ad09362269e2415f5f2eaab349b5b"
6161
ARG ROOT=/install_root
6262
RUN apt-get update && apt-get --no-install-recommends -y install musl musl-tools musl-dev
6363
SHELL ["/bin/bash", "-o", "pipefail", "-c"]

Diff for: build/docker/intel-qat-initcontainer.Dockerfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ ARG DIR=/intel-device-plugins-for-kubernetes
4040
WORKDIR $DIR
4141
COPY . .
4242
RUN install -D ${DIR}/LICENSE /install_root/licenses/intel-device-plugins-for-kubernetes/LICENSE
43-
ARG TOYBOX_VERSION="0.8.11"
44-
ARG TOYBOX_SHA256="83a3a88cbe1fa30f099c2f58295baef4637aaf988085aaea56e03aa29168175d"
43+
ARG TOYBOX_VERSION="0.8.12"
44+
ARG TOYBOX_SHA256="3c529d93923dde67d048e7bcbd5d1bc0dd1ad09362269e2415f5f2eaab349b5b"
4545
ARG ROOT=/install_root
4646
RUN apt-get update && apt-get --no-install-recommends -y install musl musl-tools musl-dev
4747
SHELL ["/bin/bash", "-o", "pipefail", "-c"]

Diff for: build/docker/intel-sgx-initcontainer.Dockerfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ RUN install -D ${DIR}/LICENSE /install_root/licenses/intel-device-plugins-for-ku
5656
--save_path /install_root/licenses/$CMD/go-licenses ; \
5757
else mkdir -p /install_root/licenses/$CMD/go-licenses/ && cd licenses/$CMD && cp -r * /install_root/licenses/$CMD/go-licenses/ ; fi
5858
###
59-
ARG TOYBOX_VERSION="0.8.11"
60-
ARG TOYBOX_SHA256="83a3a88cbe1fa30f099c2f58295baef4637aaf988085aaea56e03aa29168175d"
59+
ARG TOYBOX_VERSION="0.8.12"
60+
ARG TOYBOX_SHA256="3c529d93923dde67d048e7bcbd5d1bc0dd1ad09362269e2415f5f2eaab349b5b"
6161
ARG ROOT=/install_root
6262
RUN apt-get update && apt-get --no-install-recommends -y install musl musl-tools musl-dev
6363
SHELL ["/bin/bash", "-o", "pipefail", "-c"]

Diff for: build/docker/lib/toybox_build.docker

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
ARG TOYBOX_VERSION="0.8.11"
2-
ARG TOYBOX_SHA256="83a3a88cbe1fa30f099c2f58295baef4637aaf988085aaea56e03aa29168175d"
1+
ARG TOYBOX_VERSION="0.8.12"
2+
ARG TOYBOX_SHA256="3c529d93923dde67d048e7bcbd5d1bc0dd1ad09362269e2415f5f2eaab349b5b"
33

44
ARG ROOT=/install_root
55

Diff for: build/docker/toybox-config-static

+6-8
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#
22
# Automatically generated make config: don't edit
33
# ToyBox version: KCONFIG_VERSION
4-
# Tue Apr 23 18:03:07 2024
4+
# Wed Mar 19 11:18:16 2025
55
#
66
# CONFIG_TOYBOX_ON_ANDROID is not set
77
CONFIG_TOYBOX_FORK=y
@@ -105,6 +105,7 @@ CONFIG_TEST_GLUE=y
105105
#
106106
# CONFIG_ARP is not set
107107
# CONFIG_ARPING is not set
108+
# CONFIG_AWK is not set
108109
# CONFIG_BC is not set
109110
# CONFIG_BOOTCHARTD is not set
110111
# CONFIG_BRCTL is not set
@@ -138,22 +139,18 @@ CONFIG_TEST_GLUE=y
138139
# CONFIG_IPCRM is not set
139140
# CONFIG_IPCS is not set
140141
# CONFIG_KLOGD is not set
141-
# CONFIG_KLOGD_SOURCE_RING_BUFFER is not set
142142
# CONFIG_LAST is not set
143143
# CONFIG_LSOF is not set
144144
# CONFIG_MAN is not set
145145
# CONFIG_MDEV is not set
146146
# CONFIG_MDEV_CONF is not set
147-
# CONFIG_MKE2FS is not set
148-
# CONFIG_MKE2FS_JOURNAL is not set
149-
# CONFIG_MKE2FS_GEN is not set
150-
# CONFIG_MKE2FS_LABEL is not set
151-
# CONFIG_MKE2FS_EXTENDED is not set
152147
# CONFIG_MODPROBE is not set
153148
# CONFIG_MORE is not set
154149
# CONFIG_ROUTE is not set
155150
CONFIG_SH=y
151+
# CONFIG_BREAK is not set
156152
# CONFIG_CD is not set
153+
# CONFIG_CONTINUE is not set
157154
# CONFIG_DECLARE is not set
158155
# CONFIG_EXIT is not set
159156
# CONFIG_SET is not set
@@ -163,6 +160,7 @@ CONFIG_SH=y
163160
# CONFIG_EXPORT is not set
164161
# CONFIG_JOBS is not set
165162
# CONFIG_LOCAL is not set
163+
# CONFIG_RETURN is not set
166164
# CONFIG_SHIFT is not set
167165
# CONFIG_SOURCE is not set
168166
# CONFIG_WAIT is not set
@@ -237,7 +235,7 @@ CONFIG_SH=y
237235
# CONFIG_LSATTR is not set
238236
# CONFIG_CHATTR is not set
239237
# CONFIG_LSMOD is not set
240-
CONFIG_LSPCI=y
238+
# CONFIG_LSPCI is not set
241239
# CONFIG_LSUSB is not set
242240
# CONFIG_MAKEDEVS is not set
243241
# CONFIG_MCOOKIE is not set

Diff for: build/docker/toybox-config-ubi9-micro

+14-11
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#
22
# Automatically generated make config: don't edit
33
# ToyBox version: KCONFIG_VERSION
4-
# Wed Sep 6 10:24:35 2023
4+
# Wed Mar 19 11:21:03 2025
55
#
66
# CONFIG_TOYBOX_ON_ANDROID is not set
77
CONFIG_TOYBOX_FORK=y
@@ -35,6 +35,7 @@ CONFIG_TOYBOX_FORK=y
3535
# CONFIG_FALSE is not set
3636
# CONFIG_FILE is not set
3737
# CONFIG_FIND is not set
38+
# CONFIG_FOLD is not set
3839
# CONFIG_GETCONF is not set
3940
CONFIG_GREP=y
4041
CONFIG_EGREP=y
@@ -86,10 +87,10 @@ CONFIG_FGREP=y
8687
# CONFIG_TIME is not set
8788
# CONFIG_TOUCH is not set
8889
# CONFIG_TRUE is not set
90+
# CONFIG_TSORT is not set
8991
# CONFIG_TTY is not set
9092
# CONFIG_ULIMIT is not set
9193
# CONFIG_ARCH is not set
92-
# CONFIG_LINUX32 is not set
9394
# CONFIG_UNAME is not set
9495
# CONFIG_UNIQ is not set
9596
# CONFIG_UNLINK is not set
@@ -104,12 +105,14 @@ CONFIG_FGREP=y
104105
#
105106
# CONFIG_ARP is not set
106107
# CONFIG_ARPING is not set
108+
# CONFIG_AWK is not set
107109
# CONFIG_BC is not set
108110
# CONFIG_BOOTCHARTD is not set
109111
# CONFIG_BRCTL is not set
110112
# CONFIG_CHSH is not set
111113
# CONFIG_CROND is not set
112114
# CONFIG_CRONTAB is not set
115+
# CONFIG_CSPLIT is not set
113116
# CONFIG_DHCP is not set
114117
# CONFIG_DHCP6 is not set
115118
# CONFIG_DHCPD is not set
@@ -118,10 +121,8 @@ CONFIG_FGREP=y
118121
# CONFIG_DUMPLEASES is not set
119122
# CONFIG_EXPR is not set
120123
# CONFIG_FDISK is not set
121-
# CONFIG_FOLD is not set
122124
# CONFIG_FSCK is not set
123125
# CONFIG_GETFATTR is not set
124-
# CONFIG_GETOPT is not set
125126
# CONFIG_GETTY is not set
126127
# CONFIG_GITCOMPAT is not set
127128
# CONFIG_GITCLONE is not set
@@ -138,22 +139,18 @@ CONFIG_FGREP=y
138139
# CONFIG_IPCRM is not set
139140
# CONFIG_IPCS is not set
140141
# CONFIG_KLOGD is not set
141-
# CONFIG_KLOGD_SOURCE_RING_BUFFER is not set
142142
# CONFIG_LAST is not set
143143
# CONFIG_LSOF is not set
144144
# CONFIG_MAN is not set
145145
# CONFIG_MDEV is not set
146146
# CONFIG_MDEV_CONF is not set
147-
# CONFIG_MKE2FS is not set
148-
# CONFIG_MKE2FS_JOURNAL is not set
149-
# CONFIG_MKE2FS_GEN is not set
150-
# CONFIG_MKE2FS_LABEL is not set
151-
# CONFIG_MKE2FS_EXTENDED is not set
152147
# CONFIG_MODPROBE is not set
153148
# CONFIG_MORE is not set
154149
# CONFIG_ROUTE is not set
155150
# CONFIG_SH is not set
151+
# CONFIG_BREAK is not set
156152
# CONFIG_CD is not set
153+
# CONFIG_CONTINUE is not set
157154
# CONFIG_DECLARE is not set
158155
# CONFIG_EXIT is not set
159156
# CONFIG_SET is not set
@@ -163,6 +160,7 @@ CONFIG_FGREP=y
163160
# CONFIG_EXPORT is not set
164161
# CONFIG_JOBS is not set
165162
# CONFIG_LOCAL is not set
163+
# CONFIG_RETURN is not set
166164
# CONFIG_SHIFT is not set
167165
# CONFIG_SOURCE is not set
168166
# CONFIG_WAIT is not set
@@ -213,6 +211,7 @@ CONFIG_FGREP=y
213211
# CONFIG_FREERAMDISK is not set
214212
# CONFIG_FSFREEZE is not set
215213
# CONFIG_FSYNC is not set
214+
# CONFIG_GETOPT is not set
216215
# CONFIG_GPIODETECT is not set
217216
# CONFIG_GPIOFIND is not set
218217
# CONFIG_GPIOINFO is not set
@@ -230,15 +229,17 @@ CONFIG_FGREP=y
230229
# CONFIG_INSMOD is not set
231230
# CONFIG_IONICE is not set
232231
# CONFIG_IORENICE is not set
232+
# CONFIG_LINUX32 is not set
233233
# CONFIG_LOGIN is not set
234234
# CONFIG_LOSETUP is not set
235235
# CONFIG_LSATTR is not set
236236
# CONFIG_CHATTR is not set
237237
# CONFIG_LSMOD is not set
238-
CONFIG_LSPCI=y
238+
# CONFIG_LSPCI is not set
239239
# CONFIG_LSUSB is not set
240240
# CONFIG_MAKEDEVS is not set
241241
# CONFIG_MCOOKIE is not set
242+
# CONFIG_MEMEATER is not set
242243
# CONFIG_MIX is not set
243244
# CONFIG_MKPASSWD is not set
244245
# CONFIG_MKSWAP is not set
@@ -282,6 +283,7 @@ CONFIG_LSPCI=y
282283
# CONFIG_TASKSET is not set
283284
# CONFIG_TIMEOUT is not set
284285
# CONFIG_TRUNCATE is not set
286+
# CONFIG_TS is not set
285287
# CONFIG_UCLAMPSET is not set
286288
# CONFIG_UPTIME is not set
287289
# CONFIG_USLEEP is not set
@@ -382,6 +384,7 @@ CONFIG_TOYBOX_LSM_NONE=y
382384
# CONFIG_TOYBOX_FLOAT is not set
383385
# CONFIG_TOYBOX_HELP is not set
384386
# CONFIG_TOYBOX_HELP_DASHDASH is not set
387+
# CONFIG_TOYBOX_ZHELP is not set
385388
# CONFIG_TOYBOX_FREE is not set
386389
# CONFIG_TOYBOX_NORECURSE is not set
387390
# CONFIG_TOYBOX_DEBUG is not set

Diff for: demo/qat-autoreset.sh

+11-4
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,20 @@
11
#!/usr/bin/env bash
22
NODE_NAME="${NODE_NAME:-}"
33
ENABLED_QAT_PF_PCIIDS=${ENABLED_QAT_PF_PCIIDS:-37c8 4940 4942 4944 4946}
4-
DEVS=$(for pf in $ENABLED_QAT_PF_PCIIDS; do lspci -n | grep -e "$pf" | grep -o -e "^\\S*"; done)
54

65
AUTORESET_ENABLED="NONE"
76
AUTORESET_ENABLED_FOUND="FALSE"
87
AUTORESET_OPTIONS_LIST="on off"
98

9+
DEVS=""
10+
for DEV in $(realpath /sys/bus/pci/devices/*); do
11+
for PF in $ENABLED_QAT_PF_PCIIDS; do
12+
if grep -q "$PF" "$DEV"/device; then
13+
DEVS="$DEV $DEVS"
14+
fi
15+
done
16+
done
17+
1018
check_config() {
1119
[ -f "conf/qat.conf" ] && AUTORESET_ENABLED=$(grep "^AutoresetEnabled=" conf/qat.conf | cut -d= -f 2 | grep '\S')
1220
[ -f "conf/qat-$NODE_NAME.conf" ] && AUTORESET_ENABLED=$(grep "^AutoresetEnabled=" conf/qat-"$NODE_NAME".conf | cut -d= -f 2 | grep '\S')
@@ -25,9 +33,8 @@ check_config() {
2533

2634
enable_auto_reset() {
2735
if [ "$AUTORESET_ENABLED_FOUND" = "TRUE" ]; then
28-
for dev in $DEVS; do
29-
devpath="/sys/bus/pci/devices/0000:$dev"
30-
autoreset_path="$devpath/qat/auto_reset"
36+
for devpath in $DEVS; do
37+
autoreset_path="$devpath"/qat/auto_reset
3138
if ! test -w "$autoreset_path"; then
3239
echo "error: $autoreset_path is not found or not writable. Check if QAT driver module is loaded. Skipping..."
3340
exit 1

Diff for: demo/qat-init.sh

+14-8
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
# This script is based on qatlib's qat_init.sh
33
NODE_NAME="${NODE_NAME:-}"
44
ENABLED_QAT_PF_PCIIDS=${ENABLED_QAT_PF_PCIIDS:-37c8 4940 4942 4944 4946}
5-
DEVS=$(for pf in $ENABLED_QAT_PF_PCIIDS; do lspci -n | grep -e "$pf" | grep -o -e "^\\S*"; done)
65
SERVICES_LIST="sym asym sym;asym dc sym;dc asym;dc"
76
QAT_4XXX_DEVICE_PCI_ID="0x4940"
87
QAT_401XX_DEVICE_PCI_ID="0x4942"
@@ -11,6 +10,15 @@ QAT_420XX_DEVICE_PCI_ID="0x4946"
1110
SERVICES_ENABLED="NONE"
1211
SERVICES_ENABLED_FOUND="FALSE"
1312

13+
DEVS=""
14+
for DEV in $(realpath /sys/bus/pci/devices/*); do
15+
for PF in $ENABLED_QAT_PF_PCIIDS; do
16+
if grep -q "$PF" "$DEV"/device; then
17+
DEVS="$DEV $DEVS"
18+
fi
19+
done
20+
done
21+
1422
check_config() {
1523
[ -f "conf/qat.conf" ] && SERVICES_ENABLED=$(grep "^ServicesEnabled=" conf/qat.conf | cut -d= -f 2 | grep '\S')
1624
[ -f "conf/qat-$NODE_NAME.conf" ] && SERVICES_ENABLED=$(grep "^ServicesEnabled=" conf/qat-"$NODE_NAME".conf | cut -d= -f 2 | grep '\S')
@@ -29,8 +37,7 @@ check_config() {
2937

3038
sysfs_config() {
3139
if [ "$SERVICES_ENABLED_FOUND" = "TRUE" ]; then
32-
for dev in $DEVS; do
33-
DEVPATH="/sys/bus/pci/devices/0000:$dev"
40+
for DEVPATH in $DEVS; do
3441
PCI_DEV=$(cat "$DEVPATH"/device 2> /dev/null)
3542
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
3643
continue
@@ -45,15 +52,14 @@ sysfs_config() {
4552
echo "$SERVICES_ENABLED" > "$DEVPATH"/qat/cfg_services
4653
CURRENT_SERVICES=$(cat "$DEVPATH"/qat/cfg_services)
4754
fi
48-
echo "Device $dev configured with services: $CURRENT_SERVICES"
55+
echo "Device $DEVPATH configured with services: $CURRENT_SERVICES"
4956
done
5057
fi
5158
}
5259

5360
enable_sriov() {
54-
for dev in $DEVS; do
55-
DEVPATH="/sys/bus/pci/devices/0000:$dev"
56-
NUMVFS="$DEVPATH/sriov_numvfs"
61+
for DEVPATH in $DEVS; do
62+
NUMVFS="$DEVPATH"/sriov_numvfs
5763
if ! test -w "$NUMVFS"; then
5864
echo "error: $NUMVFS is not found or not writable. Check if QAT driver module is loaded"
5965
exit 1
@@ -65,7 +71,7 @@ enable_sriov() {
6571
if [ "$(cat "$NUMVFS")" -ne 0 ]; then
6672
echo "$DEVPATH already configured"
6773
else
68-
tee "$NUMVFS" < "$DEVPATH/sriov_totalvfs"
74+
tee "$NUMVFS" < "$DEVPATH"/sriov_totalvfs
6975
VFDEVS=$(realpath -L "$DEVPATH"/virtfn*)
7076
for vfdev in $VFDEVS; do
7177
BSF=$(basename "$vfdev")

0 commit comments

Comments
 (0)