kohler / click

The Click modular router: fast modular packet processing and analysis
Other
743 stars 321 forks source link

Click program with DPDK cause high CPU utilization on other cores even if using taskset and lcore option #506

Closed ShaofengWu123 closed 1 year ago

ShaofengWu123 commented 1 year ago

I am currently running a toy click program shown below: FromDPDKDevice(0000:03:00.0) -> Print -> Discard; This program simply polls pakcets from a physical interafce p0, print and discard. The command I use for running this config is: taskset -c 0 ./click-dpdk --dpdk -l 0-1 n 1 --file-prefix=dpdk0 -- ./test_connect.click
During runtime, when there is no incoming traffic, The CPU utilization shown by top makes sense. As shown below, cpu0 is polling packets from interface p0. image

But when I generate traffic from another machine to the machine under test(they are connected using a 100G switch), I observe that as the packet rate grows, the utilization of cores other than core 0 or core 1 also grow. And the CPU utilization of core 0 drops.
The CPU utilization when packet rate is 5Gbps: image The CPU utilization when packet rate is 10Gbps: image

It confuses me because I thought that the above command should provide good isolation of core usage, and even if the packet rate grows, cores other than cpu0/1 should remain un-disturbed. I test dpdk-testpmd under same setting and it shows exactly the behavior that only core 0 has 100% utilization and other cores remain ~0% utilization or say idle.

My question is: do I miss anything in configuring a click modular router program so that core usage can be isolated? Or click program should behave like this with dpdk? Thanks!

ShaofengWu123 commented 1 year ago

I have managed to find the cause for this problem. This is because I use vscode to connect into the server, and when the application prints a lot of information, vscode-related process will consume a lot of CPU. I think this issue can be closed with this explanation.