I'm new to DPDK and running the Helloworld example given as part of the DPDK build.Here I'm able to successfully run and get the O/p expected. That is printing Hello World on different lcores.
./dpdk-helloworld -l 0-3 -n 4
EAL: Detected 112 lcore(s)
EAL: Detected 2 NUMA nodes
EAL: Detected static linkage of DPDK
EAL: Multi-process socket /var/run/dpdk/rte/mp_socket
EAL: Selected IOVA mode 'VA'
EAL: No available hugepages reported in hugepages-2048kB
EAL: Probing VFIO support...
EAL: No legacy callbacks, legacy socket not created
hello from core 1
hello from core 2
hello from core 3
hello from core 0
But When I run htop, I can see only the first core being used, I was expecting four core will be utilized.
Is there something wrong in my understanding of how EAL works in DPDK?
-
did you try the option suggested in the answer? If it solves the problem accept or upvote to close the question.Vipin Varghese– Vipin Varghese2021年07月06日 12:23:27 +00:00Commented Jul 6, 2021 at 12:23
-
can you please update your findings, it will help to understand if there are difference in understanding. If there are not please accept or upvote to close this question.Vipin Varghese– Vipin Varghese2021年07月13日 02:34:06 +00:00Commented Jul 13, 2021 at 2:34
1 Answer 1
There can be couple of reasons which might lead to your observation, such as
- DPDK example
hello worldis a simple run to competition program model which launcheslcore_helloin all worker threads and the main thread. There is no infinite loop of while or for to run on desired lcores. - DPDK application is running inside VM with ISOL cpu set for single core.
- htop sampling time is not enough to show case all 4 cpu were utilized
Since limited information is shared about setup and environment, I have to assume cause of your error is 3. The solution for your requirement is In order to achieve 100% utilization across all threads edit lcore_hello to be an infinite loop, example code below
static int
lcore_hello(__rte_unused void *arg)
{
unsigned lcore_id;
lcore_id = rte_lcore_id();
printf("hello from core %u\n", lcore_id);
while(1);
return 0;
}
Note: I highly recommend using perf record with the right sample rate to capture across all core events for specific application launches too.