Skip to content

Commit e1399b5

Browse files
committed
crypto-perf: move to clearlinux:base and add QAT test cases
Clear Linux enables DPDK QAT PMD so we can move to use everything from there. This saves maintenance efforts and we get more up-to-date DPDK. The DPDK version in this update gives a tool for compress perf too, for instance. The commit also adds kustomize scripts that overlay the original DPDK demo deployment to run dpdk-test-[compress|crypto|-perf test cases: $ kubectl apply -k deployments/qat_dpdk_app/test-compress1/ $ kubectl apply -f deployments/qat_dpdk_app/test-crypto1/ New test cases ('ptest's with varying parameters) can be easily added by following the pattern in test-[crypto|compress]1 directories. Signed-off-by: Mikko Ylinen <mikko.ylinen@intel.com>
1 parent 832e4aa commit e1399b5

File tree

15 files changed

+1745
-36
lines changed

15 files changed

+1745
-36
lines changed

demo/crypto-perf/Dockerfile

Lines changed: 29 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,29 @@
1-
FROM centos:7
2-
3-
ENV SHELL=/bin/bash
4-
5-
ENV RTE_TARGET=x86_64-native-linuxapp-gcc
6-
7-
# verified git commit hash
8-
ENV DPDK_VERSION=3d2e044
9-
10-
# install dependencies and some handy tools
11-
RUN rpm --rebuilddb; yum -y clean all; yum -y update;
12-
RUN yum -y install curl pciutils git numactl-devel make gcc openssl-devel
13-
14-
# clone DPDK and checkout desired version
15-
WORKDIR /usr/src
16-
RUN git clone http://dpdk.org/git/dpdk
17-
WORKDIR /usr/src/dpdk
18-
RUN git checkout $DPDK_VERSION
19-
20-
# explicitly enable QAT in the config
21-
RUN sed s#CONFIG_RTE_LIBRTE_PMD_QAT=n#CONFIG_RTE_LIBRTE_PMD_QAT=y# \
22-
-i config/common_base
23-
24-
# don't build kernel modules as they depend on the host kernel version
25-
RUN sed s#CONFIG_RTE_EAL_IGB_UIO=y#CONFIG_RTE_EAL_IGB_UIO=n# \
26-
-i config/common_linuxapp
27-
RUN sed s#CONFIG_RTE_KNI_KMOD=y#CONFIG_RTE_KNI_KMOD=n# \
28-
-i config/common_linuxapp
29-
30-
# build DPDK
31-
RUN make T=$RTE_TARGET config && \
32-
make T=$RTE_TARGET && \
33-
make T=$RTE_TARGET DESTDIR=install install
34-
35-
# go to the location of dpdk-test-crypto-perf app by default
36-
WORKDIR /usr/src/dpdk/build/app
1+
# CLEAR_LINUX_BASE and CLEAR_LINUX_VERSION can be used to make the build
2+
# reproducible by choosing an image by its hash and installing an OS version
3+
# with --version=:
4+
# CLEAR_LINUX_BASE=clearlinux@sha256:b8e5d3b2576eb6d868f8d52e401f678c873264d349e469637f98ee2adf7b33d4
5+
# CLEAR_LINUX_VERSION="--version=29970"
6+
#
7+
# This is used on release branches before tagging a stable version.
8+
# The master branch defaults to using the latest Clear Linux.
9+
ARG CLEAR_LINUX_BASE=clearlinux:latest
10+
11+
FROM ${CLEAR_LINUX_BASE} as builder
12+
13+
ARG CLEAR_LINUX_VERSION=
14+
15+
RUN mkdir /install_root && \
16+
swupd os-install \
17+
${CLEAR_LINUX_VERSION} \
18+
--path /install_root \
19+
--statedir /swupd-state \
20+
--bundles=os-core,dpdk \
21+
--no-boot-update && \
22+
rm -rf /install_root/var/lib/swupd/*
23+
24+
ADD run-dpdk-test /install_root/usr/bin/run-dpdk-test
25+
26+
FROM scratch as final
27+
COPY --from=builder /install_root /
28+
29+
CMD ["/bin/bash"]

demo/crypto-perf/run-dpdk-test

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/bin/bash
2+
3+
# expect $TESTCMD, $PTEST, and $QAT* are set
4+
set -u
5+
6+
if [ "${TESTCMD}" != "crypto" ] && [ "${TESTCMD}" != "compress" ]; then
7+
echo "run-dpdk-test: TESTCMD must be either crypto or compress"
8+
exit 1
9+
fi
10+
11+
PCI_WHITELIST=""
12+
13+
for i in `echo ${!QAT*}`; do PCI_WHITELIST="$PCI_WHITELIST -w ${!i}"; done
14+
15+
# "The default mempool handler is ring based."
16+
MEMPOOL=$(ls /usr/lib64/librte_mempool_ring.so*|tail -1)
17+
PMD_QAT=$(ls /usr/lib64/librte_pmd_qat.so*|tail -1)
18+
LCORE=$(cat /sys/fs/cgroup/cpuset/cpuset.cpus)
19+
20+
EAL="-l ${LCORE} ${PCI_WHITELIST} -d ${MEMPOOL} -d ${PMD_QAT}"
21+
22+
dpdk-test-${TESTCMD}-perf ${EAL} -- ${PTEST} \
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
apiVersion: v1
2+
kind: Pod
3+
metadata:
4+
name: qat-dpdk
5+
spec:
6+
containers:
7+
- name: crypto-perf
8+
env:
9+
- name: TESTCMD
10+
value: "compress"

deployments/qat_dpdk_app/patches/compress-perf/file.txt

Lines changed: 1600 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
nameSuffix: -compress-perf
2+
bases:
3+
- ../dpdk-test/
4+
patchesStrategicMerge:
5+
- volume_add_configmap.yaml
6+
- env_replace_testcmd.yaml
7+
configMapGenerator:
8+
- name: test-data
9+
files:
10+
- file.txt
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
apiVersion: v1
2+
kind: Pod
3+
metadata:
4+
name: qat-dpdk
5+
spec:
6+
containers:
7+
- name: crypto-perf
8+
volumeMounts:
9+
- name: testfile
10+
mountPath: /var/data/
11+
volumes:
12+
- name: testfile
13+
configMap:
14+
name: test-data
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
apiVersion: v1
2+
kind: Pod
3+
metadata:
4+
name: qat-dpdk-test
5+
spec:
6+
containers:
7+
- name: crypto-perf
8+
env:
9+
- name: TESTCMD
10+
value: "crypto"
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
nameSuffix: -crypto-perf
2+
bases:
3+
- ../dpdk-test/
4+
patchesJson6902:
5+
- target:
6+
version: v1
7+
kind: Pod
8+
name: qat-dpdk
9+
path: test.json
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[
2+
{"op": "replace", "path": "/spec/containers/0/env/0/value", "value": "crypto"}
3+
]
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[
2+
{"op": "remove", "path": "/spec/containers/0/args"},
3+
{"op": "replace", "path": "/spec/containers/0/command", "value": ["/usr/bin/run-dpdk-test"]},
4+
{"op": "add", "path": "/spec/containers/0/env", "value": [{"name": "TESTCMD", "value": "dummy"}, {"name": "PTEST", "value": "dummy"}]}
5+
]

0 commit comments

Comments
 (0)