Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot set CPU affinity in DPDK input #118

Closed
thorgrin opened this issue Dec 20, 2022 · 0 comments
Closed

Cannot set CPU affinity in DPDK input #118

thorgrin opened this issue Dec 20, 2022 · 0 comments
Labels

Comments

@thorgrin
Copy link

I have two NICs and I need to run two ipfixprobe processes to monitor the traffic. When I start as follows

ipfixprobe  --input 'dpdk;port=0;eal=ipfixprobe-eal -c 0x1 -a 0000:d8:00.0;q=1'

ipfixprobe  --input 'dpdk;port=0;eal=ipfixprobe-eal -c 0x2 -a 0000:3b:00.0 --file-prefix aaa;q=1'

both processes end up on first CPU, which is a great problem while actively polling for traffic - each process shows only 50% CPU usage, the packet reading often stalls in one or the other.

Possible solution

I've come up with the following workaround:

Comment out the call to set_thread_affinity function: https://github.com/CESNET/ipfixprobe/blob/master/input/dpdk.cpp#L330

Run with eal set as follows:

/usr/bin/ipfixprobe -i 'dpdk;p=0;q=1;e=ipfixprobe-eal --lcores (0-7)@(0,2,4,6,8,10,12,14,16,18,20,22) -a 0000:3b:00.0'
/usr/bin/ipfixprobe -i 'dpdk;p=0;q=1;e=ipfixprobe-eal --lcores (0-7)@(1,3,5,7,9,11,13,15,17,19,21,23) -a 0000:d8:00.0 --file-prefix=aaa'

The list of cores is set to the appropriate CPU by checking /sys/class/net/$ifc/device/local_cpulist.

Setup

OS: Ubuntu 22.04 LTS
Compilation as deb package using make deb with modified dh_auto_configure in debian/rules

Full configure params:

 ./configure --build=x86_64-linux-gnu --prefix=/usr --includedir=\${prefix}/include --mandir=\${prefix}/share/man --infodir=\${prefix}/share/info --sysconfdir=/etc --localstatedir=/var --disable-option-checking --disable-silent-rules --libdir=\${prefix}/lib/x86_64-linux-gnu --libexecdir=\${prefix}/lib/x86_64-linux-gnu --disable-maintainer-mode --disable-d
ependency-tracking --with-pcap --with-quic --with-msects --with-dpdk --enable-debug 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants