[dpdk] service core
dpdk 17.11 增加了一组新的API,serivce core
如命名,就是用一组core跑service函数。
我自己的测试程序如下:
https://github.com/tony-caotong/knickknack/tree/master/test/dpdk_service_core
测试程序的输出:
[root@D128 service_cores]# ./build/service_cores EAL: Detected 4 lcore(s) EAL: No free hugepages reported in hugepages-1048576kB EAL: Probing VFIO support... registe service: 0 registe 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
可以结合如下命令,查看线程信息,辅助理解处理流程。
[root@D128 dpdk-stable-17.11.1]# top -H -p `pidof service_cores`
更多资料:
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