Skip to content

Commit 71505e6

Browse files
committed
dsa: dpdk example workload and use it in e2e
Signed-off-by: Tuomas Katila <[email protected]>
1 parent c5b7194 commit 71505e6

File tree

11 files changed

+105
-10
lines changed

11 files changed

+105
-10
lines changed

.github/workflows/lib-build.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ jobs:
3535
- openssl-qat-engine
3636
- sgx-sdk-demo
3737
- sgx-aesmd-demo
38+
- dsa-dpdk-dmadevtest
3839
builder: [buildah, docker]
3940
steps:
4041
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4

.github/workflows/lib-e2e.yaml

+2-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
matrix:
1313
include:
1414
- name: e2e-dsa-gnr
15-
targetjob: e2e-dsa
15+
targetjob: e2e-dsa SKIP="(App:dpdk-test)"
1616
runner: simics-gnr
1717
images:
1818
- intel-dsa-plugin
@@ -44,6 +44,7 @@ jobs:
4444
- intel-dsa-plugin
4545
- intel-idxd-config-initcontainer
4646
- accel-config-demo
47+
- dsa-dpdk-dmadevtest
4748
- intel-deviceplugin-operator
4849
- intel-iaa-plugin
4950
- crypto-perf

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,7 @@ The summary of resources available via plugins in this repository is given in th
235235
* [dlb-libdlb-demo-pod.yaml](demo/dlb-libdlb-demo-pod.yaml)
236236
* `dsa.intel.com` : `wq-user-[shared or dedicated]`
237237
* [dsa-accel-config-demo-pod.yaml](demo/dsa-accel-config-demo-pod.yaml)
238+
* [dsa-dpdk-dmadevtest.yaml](demo/dsa-dpdk-dmadevtest.yaml)
238239
* `fpga.intel.com` : custom, see [mappings](cmd/fpga_admissionwebhook/README.md#mappings)
239240
* [intelfpga-job.yaml](demo/intelfpga-job.yaml)
240241
* `gpu.intel.com` : `i915`, `i915_monitoring`, `xe` or `xe_monitoring`

cmd/dsa_plugin/README.md

+22
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ Table of Contents
77
* [Pre-built Images](#pre-built-images)
88
* [Verify Plugin Registration](#verify-plugin-registration)
99
* [Testing and Demos](#testing-and-demos)
10+
* [DPDK application](#dpdk-application)
1011

1112
## Introduction
1213

@@ -133,3 +134,24 @@ We can test the plugin is working by deploying the provided example accel-config
133134
---- ------ ---- ---- -------
134135
Warning FailedScheduling 2m26s default-scheduler 0/1 nodes are available: 1 Insufficient dsa.intel.com/wq-user-dedicated, 1 Insufficient dsa.intel.com/wq-user-shared.
135136
```
137+
### DPDK application
138+
139+
DPDK use requires a couple of changes for the DSA configuration. The workqueue mode has to be `dedicated` and the name has to have a prefix of `dpdk_`.
140+
141+
e.g.
142+
```
143+
{
144+
"dev":"wqX.0",
145+
"mode":"dedicated",
146+
"size":16,
147+
"group_id":0,
148+
"priority":10,
149+
"block_on_fault":1,
150+
"type":"user",
151+
"name":"dpdk_X0",
152+
"driver_name":"user",
153+
"threshold":15
154+
}
155+
```
156+
157+
For testing DPDK, one can use the test container in the [demo directory](../../demo/dsa-dpdk-dmadevtest/) and its deployment [file](../../demo/dsa-dpdk-dmadevtest.yaml).

demo/dsa-dpdk-dmadevtest.yaml

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
apiVersion: v1
2+
kind: Pod
3+
metadata:
4+
name: dpdk
5+
spec:
6+
restartPolicy: Never
7+
containers:
8+
- name: dpdk
9+
image: intel/dsa-dpdk-dmadevtest:devel
10+
securityContext:
11+
capabilities:
12+
add: ["SYS_RAWIO"]
13+
volumeMounts:
14+
- mountPath: /mnt/hugepage
15+
name: hugepage
16+
resources:
17+
requests:
18+
hugepages-2Mi: 64Mi
19+
memory: 128Mi
20+
dsa.intel.com/wq-user-dedicated: 1
21+
limits:
22+
hugepages-2Mi: 64Mi
23+
memory: 128Mi
24+
dsa.intel.com/wq-user-dedicated: 1
25+
volumes:
26+
- name: hugepage
27+
emptyDir:
28+
medium: HugePages

demo/dsa-dpdk-dmadevtest/Dockerfile

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
FROM debian:sid-slim AS builder
2+
3+
ARG DIR=/dpdk-build
4+
WORKDIR $DIR
5+
6+
RUN apt-get update && apt-get install -y --no-install-recommends wget build-essential meson ninja-build python3-pyelftools libnuma-dev python3-pip pkg-config dpkg-dev libipsec-mb-dev
7+
8+
# Download & unpack DPDK tarball
9+
ARG DPDK_TARBALL=dpdk-24.11.1.tar.xz
10+
ARG DPDK_TARBALL_SHA256="bcae7d42c449fc456dfb279feabcbe0599a29bebb2fe2905761e187339d96b8e"
11+
12+
RUN wget -q https://fast.dpdk.org/rel/$DPDK_TARBALL \
13+
&& echo "$DPDK_TARBALL_SHA256 $DPDK_TARBALL" | sha256sum -c - \
14+
&& tar -xf $DPDK_TARBALL && rm $DPDK_TARBALL
15+
16+
RUN cd dpdk-* && meson setup \
17+
"-Dplatform=generic" \
18+
"-Denable_drivers=dma/idxd" \
19+
"-Denable_apps=test" \
20+
--prefix $(pwd)/installdir \
21+
builddir
22+
RUN cd dpdk-* && ninja -C builddir install && install -D installdir/bin/dpdk-test /install_root/usr/bin/dpdk-test
23+
24+
FROM debian:sid-slim
25+
RUN apt-get update && apt-get install -y --no-install-recommends libipsec-mb2 libnuma1 libatomic1 && ldconfig -v
26+
COPY --from=builder /install_root/usr/bin/dpdk-test /usr/bin/dpdk-test
27+
28+
ENTRYPOINT ["dpdk-test", "dmadev_autotest"]

demo/dsa.conf

+4-4
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"priority":10,
1818
"block_on_fault":1,
1919
"type":"user",
20-
"name":"appX0",
20+
"name":"dpdk_X0",
2121
"driver_name":"user",
2222
"threshold":15
2323
}
@@ -43,7 +43,7 @@
4343
"priority":10,
4444
"block_on_fault":1,
4545
"type":"user",
46-
"name":"appX1",
46+
"name":"dpdk_X1",
4747
"driver_name":"user",
4848
"threshold":15
4949
}
@@ -69,7 +69,7 @@
6969
"priority":10,
7070
"block_on_fault":1,
7171
"type":"user",
72-
"name":"appX2",
72+
"name":"dpdk_X2",
7373
"driver_name":"user",
7474
"threshold":15
7575
}
@@ -95,7 +95,7 @@
9595
"priority":10,
9696
"block_on_fault":1,
9797
"type":"user",
98-
"name":"appX3",
98+
"name":"dpdk_X3",
9999
"driver_name":"user",
100100
"threshold":15
101101
}

go.mod

-1
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,6 @@ require (
130130
golang.org/x/time v0.7.0 // indirect
131131
golang.org/x/tools v0.28.0 // indirect
132132
gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect
133-
google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de // indirect
134133
google.golang.org/genproto/googleapis/api v0.0.0-20241202173237-19429a94021a // indirect
135134
google.golang.org/genproto/googleapis/rpc v0.0.0-20241202173237-19429a94021a // indirect
136135
gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect

go.sum

+2-2
Original file line numberDiff line numberDiff line change
@@ -344,8 +344,8 @@ golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8T
344344
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
345345
gomodules.xyz/jsonpatch/v2 v2.4.0 h1:Ci3iUJyx9UeRx7CeFN8ARgGbkESwJK+KB9lLcWxY/Zw=
346346
gomodules.xyz/jsonpatch/v2 v2.4.0/go.mod h1:AH3dM2RI6uoBZxn3LVrfvJ3E0/9dG4cSrbuBJT4moAY=
347-
google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de h1:F6qOa9AZTYJXOUEr4jDysRDLrm4PHePlge4v4TGAlxY=
348-
google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de/go.mod h1:VUhTRKeHn9wwcdrk73nvdC9gF178Tzhmt/qyaFcPLSo=
347+
google.golang.org/genproto v0.0.0-20240123012728-ef4313101c80 h1:KAeGQVN3M9nD0/bQXnr/ClcEMJ968gUXJQ9pwfSynuQ=
348+
google.golang.org/genproto v0.0.0-20240123012728-ef4313101c80/go.mod h1:cc8bqMqtv9gMOr0zHg2Vzff5ULhhL2IXP4sbcn32Dro=
349349
google.golang.org/genproto/googleapis/api v0.0.0-20241202173237-19429a94021a h1:OAiGFfOiA0v9MRYsSidp3ubZaBnteRUyn3xB2ZQ5G/E=
350350
google.golang.org/genproto/googleapis/api v0.0.0-20241202173237-19429a94021a/go.mod h1:jehYqy3+AhJU9ve55aNOaSml7wUXjF9x6z2LcCfpAhY=
351351
google.golang.org/genproto/googleapis/rpc v0.0.0-20241202173237-19429a94021a h1:hgh8P4EuoxpsuKMXX/To36nOFD7vixReXgn8lPGnt+o=

scripts/set-version.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ if [ $# != 1 ] || [ "$1" = "?" ] || [ "$1" = "--help" ]; then
1515
exit 1
1616
fi
1717

18-
files=$(git grep -l '^TAG?*=\|intel/accel-config-demo:\|intel/crypto-perf:\|intel/opae-nlb-demo:\|intel/openssl-qat-engine:\|intel/dlb-libdlb-demo:\|intel/sgx-sdk-demo:\|intel/intel-[^ ]*:\|version=\|appVersion:\|tag:' Makefile deployments demo/*accel-config*.yaml demo/*fpga*.yaml demo/*openssl*.yaml demo/dlb-libdlb*.yaml pkg/controllers/*/*_test.go build/docker/*.Dockerfile test/e2e/*/*.go)
18+
files=$(git grep -l '^TAG?*=\|intel/dsa-dpdk-dmadevtest:\|intel/accel-config-demo:\|intel/crypto-perf:\|intel/opae-nlb-demo:\|intel/openssl-qat-engine:\|intel/dlb-libdlb-demo:\|intel/sgx-sdk-demo:\|intel/intel-[^ ]*:\|version=\|appVersion:\|tag:' Makefile deployments demo/*accel-config*.yaml demo/*fpga*.yaml demo/*openssl*.yaml demo/dlb-libdlb*.yaml demo/dsa-dpdk-dmadev*.yaml pkg/controllers/*/*_test.go build/docker/*.Dockerfile test/e2e/*/*.go)
1919

2020
for file in $files; do
21-
sed -i -e "s;\(^TAG?*=\|intel/accel-config-demo:\|intel/crypto-perf:\|intel/opae-nlb-demo:\|intel/openssl-qat-engine:\|intel/dlb-libdlb-demo:\|intel/sgx-sdk-demo:\|intel/intel-[^ ]*:\|version=\|appVersion: [^ ]\|tag: [^ ]\)[^ \"]*;\1$1;g" "$file";
21+
sed -i -e "s;\(^TAG?*=\|intel/dsa-dpdk-dmadevtest:\|intel/accel-config-demo:\|intel/crypto-perf:\|intel/opae-nlb-demo:\|intel/openssl-qat-engine:\|intel/dlb-libdlb-demo:\|intel/sgx-sdk-demo:\|intel/intel-[^ ]*:\|version=\|appVersion: [^ ]\|tag: [^ ]\)[^ \"]*;\1$1;g" "$file";
2222
done

test/e2e/dsa/dsa.go

+15
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,9 @@ const (
3636
kustomizationYaml = "deployments/dsa_plugin/overlays/dsa_initcontainer/dsa_initcontainer.yaml"
3737
configmapYaml = "demo/dsa.conf"
3838
demoYaml = "demo/dsa-accel-config-demo-pod.yaml"
39+
dpdkDemoYaml = "demo/dsa-dpdk-dmadevtest.yaml"
3940
podName = "dsa-accel-config-demo"
41+
dpdkPodName = "dpdk"
4042
)
4143

4244
func init() {
@@ -62,6 +64,11 @@ func describe() {
6264
framework.Failf("unable to locate %q: %v", demoYaml, errFailedToLocateRepoFile)
6365
}
6466

67+
demoDpdkPath, errFailedToLocateRepoFile := utils.LocateRepoFile(dpdkDemoYaml)
68+
if errFailedToLocateRepoFile != nil {
69+
framework.Failf("unable to locate %q: %v", dpdkDemoYaml, errFailedToLocateRepoFile)
70+
}
71+
6572
var dpPodName string
6673

6774
ginkgo.BeforeEach(func(ctx context.Context) {
@@ -110,6 +117,14 @@ func describe() {
110117
gomega.Expect(err).To(gomega.BeNil(), utils.GetPodLogs(ctx, f, podName, podName))
111118
})
112119

120+
ginkgo.It("deploys a demo app [App:dpdk-test]", func(ctx context.Context) {
121+
e2ekubectl.RunKubectlOrDie(f.Namespace.Name, "apply", "-f", demoDpdkPath)
122+
123+
ginkgo.By("waiting for the DSA DPDK demo to succeed")
124+
err := e2epod.WaitForPodSuccessInNamespaceTimeout(ctx, f.ClientSet, dpdkPodName, f.Namespace.Name, 200*time.Second)
125+
gomega.Expect(err).To(gomega.BeNil(), utils.GetPodLogs(ctx, f, dpdkPodName, dpdkPodName))
126+
})
127+
113128
ginkgo.When("there is no app to run [App:noapp]", func() {
114129
ginkgo.It("does nothing", func() {})
115130
})

0 commit comments

Comments
 (0)