numam-dpdk/lib
David Marchand b6be16acfe eal: fix control thread affinity with --lcores
The ctrl thread cpu affinity setting has been broken when using --lcores.

Using -l/-c options makes each lcore associated to a physical cpu in a 1:1
fashion.
On the contrary, when using --lcores, each lcore cpu affinity can be set
to a list of any online cpu on the system.

To handle both cases, each lcore cpu affinity is considered and removed
from the process startup cpu affinity.

Introduced macros to manipulate dpdk cpu sets in both Linux and FreeBSD.

Examples on a 8 cores Linux system:

$ cd /sys/fs/cgroup/cpuset/
$ mkdir dpdk
$ cd dpdk
$ echo 4-7 > cpuset.cpus
$ echo 0 > cpuset.mems
$ echo $$ > tasks

Before the fix:
$ ./master/app/testpmd --master-lcore 0 --lcores '(0,7)@(7,4,5)' \
 --no-huge --no-pci -m 512 -- -i --total-num-mbufs=2048

8427	cpu_list=4-5,7	testpmd
8428	cpu_list=4-6	eal-intr-thread
8429	cpu_list=4-6	rte_mp_handle
8430	cpu_list=4-5,7	lcore-slave-7

$ taskset -c 7 \
 ./master/app/testpmd --master-lcore 0 --lcores '(0,7)@(7,4,5)' \
 --no-huge --no-pci -m 512 -- -i --total-num-mbufs=2048

EAL: Detected 8 lcore(s)
EAL: Detected 1 NUMA nodes
EAL: Failed to create thread for interrupt handling
EAL: FATAL: Cannot init interrupt-handling thread
EAL: Cannot init interrupt-handling thread
PANIC in main():
Cannot init EAL

After the fix:
$ ./master/app/testpmd --master-lcore 0 --lcores '(0,7)@(7,4,5)' \
 --no-huge --no-pci -m 512 -- -i --total-num-mbufs=2048

15214	cpu_list=4-5,7	testpmd
15215	cpu_list=6	eal-intr-thread
15216	cpu_list=6	rte_mp_handle
15217	cpu_list=4-5,7	lcore-slave-7

$ taskset -c 7 \
 ./master/app/testpmd --master-lcore 0 --lcores '(0,7)@(7,4,5)' \
 --no-huge --no-pci -m 512 -- -i --total-num-mbufs=2048

15297	cpu_list=4-5,7	testpmd
15298	cpu_list=4-5,7	eal-intr-thread
15299	cpu_list=4-5,7	rte_mp_handle
15300	cpu_list=4-5,7	lcore-slave-7

Bugzilla ID: 322
Fixes: c3568ea376 ("eal: restrict control threads to startup CPU affinity")
Cc: stable@dpdk.org

Reported-by: Johan Källström <johan.kallstrom@ericsson.com>
Signed-off-by: David Marchand <david.marchand@redhat.com>
2019-07-30 23:11:19 +02:00
..
librte_acl eal: hide shared memory config 2019-07-06 10:32:34 +02:00
librte_bbdev bbdev: extend API for 5G FEC 2019-07-05 15:28:14 +02:00
librte_bitratestats bitrate: fix unchecked return value 2019-04-23 00:19:06 +02:00
librte_bpf bpf: fix validate for function return value 2019-07-04 10:33:13 +02:00
librte_cfgfile cfgfile: use calloc 2019-07-19 00:48:43 +02:00
librte_cmdline cmdline: use new ethernet address parser 2019-07-08 21:26:52 +02:00
librte_compressdev compressdev: clarify destination buffer size 2019-07-29 10:18:24 +02:00
librte_cryptodev cryptodev: fix typo in comment 2019-07-26 15:48:52 +02:00
librte_distributor distributor: fix livelock on flush 2019-07-29 23:23:37 +02:00
librte_eal eal: fix control thread affinity with --lcores 2019-07-30 23:11:19 +02:00
librte_efd eal: hide shared memory config 2019-07-06 10:32:34 +02:00
librte_ethdev ethdev: replace license text with SPDX tag 2019-07-29 15:07:48 +02:00
librte_eventdev eventdev: fix error sign 2019-07-07 13:23:57 +02:00
librte_flow_classify flow_classify: fix out-of-bounds access 2019-07-10 23:41:25 +02:00
librte_gro net: move TCP flags from ethdev header 2019-07-03 12:57:30 +02:00
librte_gso net: add rte prefix to UDP structure 2019-05-24 13:34:46 +02:00
librte_hash hash: replace license text with SPDX tag 2019-07-29 13:31:45 +02:00
librte_ip_frag ip_frag: remove remaining IP checkum offload flag 2019-07-16 13:23:04 +02:00
librte_ipsec ipsec: support header construction 2019-07-05 15:28:14 +02:00
librte_jobstats replace snprintf with strlcpy 2019-04-04 22:46:05 +02:00
librte_kni kni: fix kernel crash with multi-segments 2019-07-15 22:48:20 +02:00
librte_kvargs remove experimental tags from all symbol definitions 2019-06-29 19:04:43 +02:00
librte_latencystats doc: fix spelling reported by aspell in comments 2019-05-03 00:38:14 +02:00
librte_lpm lpm: replace license text with SPDX tag 2019-07-29 13:31:45 +02:00
librte_mbuf mbuf: clarify outer offsets for non-tunnel packets 2019-07-01 17:15:01 +02:00
librte_member eal: hide shared memory config 2019-07-06 10:32:34 +02:00
librte_mempool eal: hide shared memory config 2019-07-06 10:32:34 +02:00
librte_meter enforce experimental tag at beginning of declarations 2019-06-29 19:04:48 +02:00
librte_metrics metrics: add function to deinitialise library 2019-07-16 12:45:30 +02:00
librte_net net: be more restrictive with ethernet address format 2019-07-23 14:31:35 +02:00
librte_pci
librte_pdump ipc: handle unsupported IPC in action register 2019-06-05 11:27:36 +02:00
librte_pipeline examples/ip_pipeline: add config flexibility to TM 2019-07-22 15:42:59 +02:00
librte_port net: add rte prefix to IP defines 2019-05-24 13:34:46 +02:00
librte_power lib: add reasons for components being disabled 2019-07-02 23:21:05 +02:00
librte_rawdev rawdev: allow devices to skip extra memory allocation 2019-07-04 09:33:59 +02:00
librte_rcu eal: hide shared memory config 2019-07-06 10:32:34 +02:00
librte_reorder eal: hide shared memory config 2019-07-06 10:32:34 +02:00
librte_ring ring: add reset function for flushing 2019-07-17 19:51:56 +02:00
librte_sched sched: remove redundant macros 2019-07-22 15:44:16 +02:00
librte_security security: remove duplicated symbols from map file 2019-07-26 16:03:21 +02:00
librte_stack eal: add API to lock/unlock tailq list 2019-07-05 22:13:23 +02:00
librte_table table: fix crash in LPM IPv6 2019-07-04 23:44:58 +02:00
librte_telemetry telemetry: fix build with gcc 9 2019-07-04 18:48:04 +02:00
librte_timer timer: fix null access if not initialized 2019-07-18 23:14:53 +02:00
librte_vhost vhost: log virtio and vhost-user negotiated features 2019-07-08 21:26:52 +02:00
Makefile cfgfile: use log for error messages 2019-07-19 00:47:50 +02:00
meson.build cmdline: use new ethernet address parser 2019-07-08 21:26:52 +02:00