Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/lib-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ jobs:
- openssl-qat-engine
- sgx-sdk-demo
- sgx-aesmd-demo
- dsa-dpdk-dmadevtest
builder: [buildah, docker]
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/lib-e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
matrix:
include:
- name: e2e-dsa-gnr
targetjob: e2e-dsa
targetjob: e2e-dsa SKIP="(App:dpdk-test)"
runner: simics-gnr
images:
- intel-dsa-plugin
Expand Down Expand Up @@ -44,6 +44,7 @@ jobs:
- intel-dsa-plugin
- intel-idxd-config-initcontainer
- accel-config-demo
- dsa-dpdk-dmadevtest
- intel-deviceplugin-operator
- intel-iaa-plugin
- crypto-perf
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,7 @@ The summary of resources available via plugins in this repository is given in th
* [dlb-libdlb-demo-pod.yaml](demo/dlb-libdlb-demo-pod.yaml)
* `dsa.intel.com` : `wq-user-[shared or dedicated]`
* [dsa-accel-config-demo-pod.yaml](demo/dsa-accel-config-demo-pod.yaml)
* [dsa-dpdk-dmadevtest.yaml](demo/dsa-dpdk-dmadevtest.yaml)
* `fpga.intel.com` : custom, see [mappings](cmd/fpga_admissionwebhook/README.md#mappings)
* [intelfpga-job.yaml](demo/intelfpga-job.yaml)
* `gpu.intel.com` : `i915`, `i915_monitoring`, `xe` or `xe_monitoring`
Expand Down
22 changes: 22 additions & 0 deletions cmd/dsa_plugin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Table of Contents
* [Pre-built Images](#pre-built-images)
* [Verify Plugin Registration](#verify-plugin-registration)
* [Testing and Demos](#testing-and-demos)
* [DPDK application](#dpdk-application)

## Introduction

Expand Down Expand Up @@ -133,3 +134,24 @@ We can test the plugin is working by deploying the provided example accel-config
---- ------ ---- ---- -------
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.
```
### DPDK application

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_`.

e.g.
```
{
"dev":"wqX.0",
"mode":"dedicated",
"size":16,
"group_id":0,
"priority":10,
"block_on_fault":1,
"type":"user",
"name":"dpdk_X0",
"driver_name":"user",
"threshold":15
}
```

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).
28 changes: 28 additions & 0 deletions demo/dsa-dpdk-dmadevtest.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
apiVersion: v1
kind: Pod
metadata:
name: dpdk
spec:
restartPolicy: Never
containers:
- name: dpdk
image: intel/dsa-dpdk-dmadevtest:devel
securityContext:
capabilities:
add: ["SYS_RAWIO"]
volumeMounts:
- mountPath: /mnt/hugepage
name: hugepage
resources:
requests:
hugepages-2Mi: 64Mi
memory: 128Mi
dsa.intel.com/wq-user-dedicated: 1
limits:
hugepages-2Mi: 64Mi
memory: 128Mi
dsa.intel.com/wq-user-dedicated: 1
volumes:
- name: hugepage
emptyDir:
medium: HugePages
28 changes: 28 additions & 0 deletions demo/dsa-dpdk-dmadevtest/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
FROM debian:sid-slim AS builder

ARG DIR=/dpdk-build
WORKDIR $DIR

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

# Download & unpack DPDK tarball
ARG DPDK_TARBALL=dpdk-24.11.1.tar.xz
ARG DPDK_TARBALL_SHA256="bcae7d42c449fc456dfb279feabcbe0599a29bebb2fe2905761e187339d96b8e"

RUN wget -q https://fast.dpdk.org/rel/$DPDK_TARBALL \
&& echo "$DPDK_TARBALL_SHA256 $DPDK_TARBALL" | sha256sum -c - \
&& tar -xf $DPDK_TARBALL && rm $DPDK_TARBALL

RUN cd dpdk-* && meson setup \
"-Dplatform=generic" \
"-Denable_drivers=dma/idxd" \
"-Denable_apps=test" \
--prefix $(pwd)/installdir \
builddir
RUN cd dpdk-* && ninja -C builddir install && install -D installdir/bin/dpdk-test /install_root/usr/bin/dpdk-test

FROM debian:sid-slim
RUN apt-get update && apt-get install -y --no-install-recommends libipsec-mb2 libnuma1 libatomic1 && ldconfig -v
COPY --from=builder /install_root/usr/bin/dpdk-test /usr/bin/dpdk-test

ENTRYPOINT ["dpdk-test", "dmadev_autotest"]
8 changes: 4 additions & 4 deletions demo/dsa.conf
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"priority":10,
"block_on_fault":1,
"type":"user",
"name":"appX0",
"name":"dpdk_X0",
"driver_name":"user",
"threshold":15
}
Expand All @@ -43,7 +43,7 @@
"priority":10,
"block_on_fault":1,
"type":"user",
"name":"appX1",
"name":"dpdk_X1",
"driver_name":"user",
"threshold":15
}
Expand All @@ -69,7 +69,7 @@
"priority":10,
"block_on_fault":1,
"type":"user",
"name":"appX2",
"name":"dpdk_X2",
"driver_name":"user",
"threshold":15
}
Expand All @@ -95,7 +95,7 @@
"priority":10,
"block_on_fault":1,
"type":"user",
"name":"appX3",
"name":"dpdk_X3",
"driver_name":"user",
"threshold":15
}
Expand Down
1 change: 0 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,6 @@ require (
golang.org/x/time v0.7.0 // indirect
golang.org/x/tools v0.28.0 // indirect
gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect
google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20241202173237-19429a94021a // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20241202173237-19429a94021a // indirect
gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -344,8 +344,8 @@ golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8T
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
gomodules.xyz/jsonpatch/v2 v2.4.0 h1:Ci3iUJyx9UeRx7CeFN8ARgGbkESwJK+KB9lLcWxY/Zw=
gomodules.xyz/jsonpatch/v2 v2.4.0/go.mod h1:AH3dM2RI6uoBZxn3LVrfvJ3E0/9dG4cSrbuBJT4moAY=
google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de h1:F6qOa9AZTYJXOUEr4jDysRDLrm4PHePlge4v4TGAlxY=
google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de/go.mod h1:VUhTRKeHn9wwcdrk73nvdC9gF178Tzhmt/qyaFcPLSo=
google.golang.org/genproto v0.0.0-20240123012728-ef4313101c80 h1:KAeGQVN3M9nD0/bQXnr/ClcEMJ968gUXJQ9pwfSynuQ=
google.golang.org/genproto v0.0.0-20240123012728-ef4313101c80/go.mod h1:cc8bqMqtv9gMOr0zHg2Vzff5ULhhL2IXP4sbcn32Dro=
google.golang.org/genproto/googleapis/api v0.0.0-20241202173237-19429a94021a h1:OAiGFfOiA0v9MRYsSidp3ubZaBnteRUyn3xB2ZQ5G/E=
google.golang.org/genproto/googleapis/api v0.0.0-20241202173237-19429a94021a/go.mod h1:jehYqy3+AhJU9ve55aNOaSml7wUXjF9x6z2LcCfpAhY=
google.golang.org/genproto/googleapis/rpc v0.0.0-20241202173237-19429a94021a h1:hgh8P4EuoxpsuKMXX/To36nOFD7vixReXgn8lPGnt+o=
Expand Down
4 changes: 2 additions & 2 deletions scripts/set-version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ if [ $# != 1 ] || [ "$1" = "?" ] || [ "$1" = "--help" ]; then
exit 1
fi

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)
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)

for file in $files; do
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";
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";
done
15 changes: 15 additions & 0 deletions test/e2e/dsa/dsa.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ const (
kustomizationYaml = "deployments/dsa_plugin/overlays/dsa_initcontainer/dsa_initcontainer.yaml"
configmapYaml = "demo/dsa.conf"
demoYaml = "demo/dsa-accel-config-demo-pod.yaml"
dpdkDemoYaml = "demo/dsa-dpdk-dmadevtest.yaml"
podName = "dsa-accel-config-demo"
dpdkPodName = "dpdk"
)

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

demoDpdkPath, errFailedToLocateRepoFile := utils.LocateRepoFile(dpdkDemoYaml)
if errFailedToLocateRepoFile != nil {
framework.Failf("unable to locate %q: %v", dpdkDemoYaml, errFailedToLocateRepoFile)
}

var dpPodName string

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

ginkgo.It("deploys a demo app [App:dpdk-test]", func(ctx context.Context) {
e2ekubectl.RunKubectlOrDie(f.Namespace.Name, "apply", "-f", demoDpdkPath)

ginkgo.By("waiting for the DSA DPDK demo to succeed")
err := e2epod.WaitForPodSuccessInNamespaceTimeout(ctx, f.ClientSet, dpdkPodName, f.Namespace.Name, 200*time.Second)
gomega.Expect(err).To(gomega.BeNil(), utils.GetPodLogs(ctx, f, dpdkPodName, dpdkPodName))
})

ginkgo.When("there is no app to run [App:noapp]", func() {
ginkgo.It("does nothing", func() {})
})
Expand Down
Loading