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 lcore(s)
EAL: No free hugepages reported in hugepages-1048576kB
EAL: Probing VFIO support...
registe service:
registe service:
main...
test. @ core
test. @ core
main...
test. @ core
test. @ core
main...
test. @ core
可以結合如下命令,檢視執行緒資訊,輔助理解處理流程。
[root@D128 dpdk-stable-17.11.]# 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