33# expect $TESTCMD, $PTEST, and $QAT* are set
44set -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+
631if [ " ${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
1944fi
2045
2146LCORE=$( 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
2551dpdk-test-" ${TESTCMD} " -perf ${EAL} -- ${PTEST} \
0 commit comments