OpenFastPath / ofp

OpenFastPath project
BSD 3-Clause "New" or "Revised" License
349 stars 126 forks source link

odph_thread_create(): Number of threads (19) and CPUs (1) does not match #287

Closed LinArcX closed 8 months ago

LinArcX commented 9 months ago

Hi. I tried to run the webserver2 example. but I get this error.(I'm using wsl on windows 10, Debian Buster)

↳ sudo ./webserver2 -f ofp.cli -i eth0
RLIMIT_CORE: 0/-1
Setting to max: 0
DBG: odp_system_info.c:86:default_huge_page_size(): defaut hp size is 2048 kB
DBG: odp_system_info.c:86:default_huge_page_size(): defaut hp size is 2048 kB
Compiler defines:
  __GCC_ATOMIC_LLONG_LOCK_FREE:        2
  __GCC_ATOMIC_LONG_LOCK_FREE:         2
  __GCC_ATOMIC_INT_LOCK_FREE:          2
  __GCC_HAVE_SYNC_COMPARE_AND_SWAP_16: 0

HW time counter freq: 2803210574 hz

DBG: odp_ishm.c:1673:_odp_ishm_init_global(): Shm single VA size: 262144kB
DBG: odp_ishm.c:1685:_odp_ishm_init_global(): Shm huge page usage limit: 64kB
DBG: odp_ishm.c:1705:_odp_ishm_init_global(): ishm: using dir /dev/shm
DBG: odp_ishm.c:1720:_odp_ishm_init_global(): Huge pages mount point is: /mnt/huge
DBG: odp_ishm.c:1629:_odp_ishm_cleanup_files(): opendir failed for /mnt/huge/0: No such file or directory
DBG: odp_ishmphy.c:61:_odp_ishmphy_reserve_single_va(): VA Reserved: 0xe7800000, len=268435456
System config:
  system.thread_count_max: 256

Pool config:
  pool.local_cache_size: 256
  pool.burst_size: 32
  pool.pkt.max_num: 262143
  pool.pkt.max_len: 65536
  pool.pkt.base_align: 64
  pool.buf.min_align: 64

DBG: odp_pool.c:338:_odp_pool_init_global():
Pool init global
DBG: odp_pool.c:339:_odp_pool_init_global():   event_hdr_t size               20
DBG: odp_pool.c:340:_odp_pool_init_global():   buffer_hdr_t size              64
DBG: odp_pool.c:341:_odp_pool_init_global():   packet_hdr_t size              192
DBG: odp_pool.c:342:_odp_pool_init_global():   timeout_hdr_t size             64
DBG: odp_pool.c:343:_odp_pool_init_global():   event_vector_hdr_t size        64
DBG: odp_pool.c:344:_odp_pool_init_global():   packet_hdr_t::seg_data offset  20
DBG: odp_pool.c:345:_odp_pool_init_global():   packet_hdr_t::timestamp offset 88
DBG: odp_pool.c:346:_odp_pool_init_global():

Event validation mode: abort

Stash config:
  stash.max_num: 512
  stash.max_num_obj: 4095

DBG: odp_queue_basic.c:122:queue_init_global(): Starts...
Queue config:
  queue_basic.max_queue_size: 8192
  queue_basic.default_queue_size: 4096

DBG: odp_queue_lf.c:267:_odp_queue_lf_init_global():
Lock-free queue init
DBG: odp_queue_lf.c:268:_odp_queue_lf_init_global():   u128 lock-free: 0

DBG: odp_queue_basic.c:177:queue_init_global(): ... done.
DBG: odp_queue_basic.c:178:queue_init_global():   queue_entry_t size 384
DBG: odp_queue_basic.c:179:queue_init_global():   max num queues     2048
DBG: odp_queue_basic.c:180:queue_init_global():   max queue size     8192
DBG: odp_queue_basic.c:181:queue_init_global():   max num lockfree   0
DBG: odp_queue_basic.c:182:queue_init_global():   max lockfree size  0

Using scheduler 'basic'
DBG: odp_schedule_basic.c:600:schedule_init_global(): Schedule init ... Scheduler config:
  sched_basic.prio_spread: 4
  sched_basic.prio_spread_weight: 63
  sched_basic.load_balance: 1
  sched_basic.order_stash_size: 512
  sched_basic.burst_size_default[]:       32  32  32  32  32  16   8   4
  sched_basic.burst_size_max[]:          255 255 255 255 255  16  16   8
  sched_basic.burst_size_atomic[]:         0   0   0   0   0   0   0   0
  sched_basic.burst_size_max_atomic[]:     0   0   0   0   0   0   0   0
  sched_basic.burst_size_parallel[]:       0   0   0   0   0   0   0   0
  sched_basic.burst_size_max_parallel[]:   0   0   0   0   0   0   0   0
  sched_basic.burst_size_ordered[]:        0   0   0   0   0   0   0   0
  sched_basic.burst_size_max_ordered[]:    0   0   0   0   0   0   0   0
  sched_basic.group_enable.all: 1
  sched_basic.group_enable.worker: 1
  sched_basic.group_enable.control: 1
  sched_basic.powersave.poll_time_nsec: 0
  sched_basic.powersave.sleep_time_nsec: 0
  dynamic load balance: ON

DBG: odp_schedule_basic.c:686:schedule_init_global(): done
Packet IO config:
  pktio.pktin_frame_offset: 0
  pktio.tx_compl_pool_size: 1024

PKTIO: initialized loop interface.
PKTIO: initialized pcap interface.
PKTIO: initialized null interface.
PKTIO: initialized socket mmap, use export ODP_PKTIO_DISABLE_SOCKET_MMAP=1 to disable.
PKTIO: initialized socket mmsg, use export ODP_PKTIO_DISABLE_SOCKET_MMSG=1 to disable.
Timer using lock-based implementation
Timer config:
  timer.inline: 0
  timer.inline_poll_interval: 10
  timer.inline_poll_interval_nsec: 500000
  timer.inline_thread_type: 0

ODP system info
---------------
ODP API version: 1.42.0
CPU model:       12th Gen Intel(R) Core(TM) i7-12800H

CPU freq (hz):   2803201000
Cache line size: 64
Core count:      20

Running ODP appl: "webserver2"
-----------------
IF-count:        1
Using IFs:       eth0
Execution mode: scheduler

I 0 4153388480 app_main.c:341] SP core: 0
Workers core start: 1
Workers core count: 19

D 0 4153388480 ofp_init.c:199] Using configuration file: /opt/ofp/etc/ofp.conf

E 0 4153388480 ofp_init.c:203] (null)(0): file I/O error

DBG: odp_timer.c:1037:posix_timer_start(): Creating POSIX timer for timer pool TmrPool, period 10000000 ns
I 3 4153388480 ofp_uma.c:45] Creating pool 'udp_inpcb', nitems=1024 size=1032 total=1056768
I 3 4153388480 ofp_uma.c:45] Creating pool 'tcp_inpcb', nitems=2048 size=1032 total=2113536
I 3 4153388480 ofp_uma.c:45] Creating pool 'tcpcb', nitems=2048 size=636 total=1302528
I 4 4153388480 ofp_uma.c:45] Creating pool 'tcptw', nitems=409 size=60 total=24540
I 4 4153388480 ofp_uma.c:45] Creating pool 'syncache', nitems=30720 size=132 total=4055040
I 5 4153388480 ofp_uma.c:45] Creating pool 'tcpreass', nitems=320 size=28 total=8960
I 5 4153388480 ofp_uma.c:45] Creating pool 'sackhole', nitems=65536 size=28 total=1835008
I 6 4153388480 ofp_ipsec.c:187] IPsec not supported with SP. Disabling IPsec.
I 6 4153388480 ofp_init.c:438] Slow path threads on core 0
D 6 4153388480 ofp_ifnet.c:303] Interface 'eth0' becomes 'fp0', port 0
DBG: pktio/socket_mmap.c:650:sock_mmap_open(): MTU size: 1514
DBG: pktio/socket_mmap.c:652:sock_mmap_open(): TX ring setup:
DBG: pktio/socket_mmap.c:488:mmap_setup_ring():   tp_block_size 16384
DBG: pktio/socket_mmap.c:489:mmap_setup_ring():   tp_block_nr   256
DBG: pktio/socket_mmap.c:490:mmap_setup_ring():   tp_frame_size 16384
DBG: pktio/socket_mmap.c:491:mmap_setup_ring():   tp_frame_nr   256
DBG: pktio/socket_mmap.c:657:sock_mmap_open(): RX ring setup:
DBG: pktio/socket_mmap.c:488:mmap_setup_ring():   tp_block_size 16384
DBG: pktio/socket_mmap.c:489:mmap_setup_ring():   tp_block_nr   256
DBG: pktio/socket_mmap.c:490:mmap_setup_ring():   tp_frame_size 16384
DBG: pktio/socket_mmap.c:491:mmap_setup_ring():   tp_frame_nr   256
DBG: odp_packet_io.c:409:odp_pktio_open(): interface: eth0, driver: socket_mmap
I 23 4153388480 ofp_ifnet.c:215] Device 'eth0' addr  00:15:5d:03:9f:5c
I 23 4153388480 ofp_ifnet.c:237] Device 'eth0' MTU=1500
D 23 4153388480 ofp_tunthread.c:115] Fastpath device fp0 addr  00:15:5d:03:9f:5c
D 23 4153388480 ofp_tunthread.c:131] Fastpath device fp0 MTU 1500
DBG: odp_packet_io.c:689:odp_pktio_start(): interface: eth0, input queues: 1, output queues: 1
threads.c:67:run_thread(): helper: ODP control thread started as linux pthread. (pid=5856)
threads.c:302:odph_thread_create(): Number of threads (19) and CPUs (1) does not match
E 25 4153388480 app_main.c:406] Error: odph_thread_create() failed.
bogdanPricope commented 9 months ago

Have you tried: ` diff --git a/example/webserver2/app_main.c b/example/webserver2/app_main.c index cb8ef6f..04d6c1d 100644 --- a/example/webserver2/app_main.c +++ b/example/webserver2/app_main.c @@ -402,7 +402,7 @@ int main(int argc, char *argv[]) odp_cpumask_set(&cpu_mask, first_worker + i);

            if (odph_thread_create(&thread_tbl[i], &thr_common, &thr_params,
JereLeppanen commented 9 months ago

Fix included in PR #289.

JereLeppanen commented 8 months ago

289 merged, closing the issue.