Skip to content

Commit af7c720

Browse files
committed
e2e: qat: fix dpdk tests on high core count systems
Signed-off-by: Tuomas Katila <[email protected]>
1 parent e27a6ab commit af7c720

File tree

1 file changed

+27
-1
lines changed

1 file changed

+27
-1
lines changed

demo/crypto-perf/run-dpdk-test

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,31 @@
33
# expect $TESTCMD, $PTEST, and $QAT* are set
44
set -u
55

6+
# input is a list of cpu cores, e.g. "2,3,5-6"
7+
# output is a list of incides in this format: 0@2,1@3,2@5,2@6
8+
function cpulist2indices() {
9+
local cpulist="$1"
10+
local output=""
11+
local i=0
12+
local cpus=(${cpulist//,/ })
13+
14+
for cpu in "${cpus[@]}"; do
15+
if [[ "$cpu" == *-* ]]; then
16+
local range=(${cpu//-/ })
17+
for ((j=range[0]; j<=range[1]; j++)); do
18+
19+
output="$output${i}@${j},"
20+
((i++))
21+
done
22+
else
23+
output="$output${i}@${cpu},"
24+
((i++))
25+
fi
26+
done
27+
28+
echo "${output%,}" # remove trailing comma
29+
}
30+
631
if [ "${TESTCMD}" != "crypto" ] && [ "${TESTCMD}" != "compress" ]; then
732
echo "run-dpdk-test: TESTCMD must be either crypto or compress"
833
exit 1
@@ -19,7 +44,8 @@ if [ -d "${CGROUP_PATH}"/cpuset ]; then
1944
fi
2045

2146
LCORE=$(cat "${CGROUP_PATH}"/cpuset.cpus)
47+
LCORE=$(cpulist2indices $LCORE)
2248

23-
EAL="--no-telemetry -l ${LCORE} ${PCI_ALLOWLIST}"
49+
EAL="--no-telemetry --lcores ${LCORE} ${PCI_ALLOWLIST}"
2450

2551
dpdk-test-"${TESTCMD}"-perf ${EAL} -- ${PTEST} \

0 commit comments

Comments
 (0)