dpdk 17.11 adds a new set of APIs, serivce core
If named, it is to run the service function with a set of cores.
My own test program is as follows:
https://github.com/tony-caotong/knickknack/tree/master/test/dpdk_service_core
Output of the test program:
[root@D128 service_cores]# ./build/service_cores EAL: Detected 4 lcore(s) EAL: No free hugepages reported in hugepages-1048576kB EAL: Probing VFIO support... register service: 0 register service: 1 main... test. 1 @ core 3 test. 2 @ core 2 main... test. 1 @ core 3 test. 2 @ core 2 main... test. 1 @ core 3
You can use the following commands to view thread information to help understand the processing flow.
[root@D128 dpdk-stable-17.11.1]# top -H -p `pidof service_cores`
more info:
it is possible to assign specific workloads to each service core, and map N workloads to M number of service cores.
Each service lcore loops over the services that are enabled for that core, and invokes the function to run the service.
https://dpdk.org/doc/guides/prog_guide/service_cores.html
https://dpdk.org/doc/api/rte__service__component_8h_source.html
https://dpdk.org/doc/api/rte__service_8h_source.html