From: SPDK [mailto:firstname.lastname@example.org] On Behalf Of Khoussi, Siham
Sent: Thursday, June 20, 2019 11:22 PM
Subject: [SPDK] spdk thread lib init
I'm writing a simple application that starts off by initializing rte_eal then the
spdk_thread_lib_init before spdk_thread creation. however, I'n not sure why
spdk_thread_lib_init(NULL,0) keeps returning -1 causing a segmentation fault to
the app although I have allocated enough hugepages in the begining (100 of 1G
pages). Does anyone have an idea of what would be causing the error?
Are you intentionally initializing DPDK on your own for some reason? That's a valid
thing to do, but not the simplest way to use SPDK. If you just want to write an SPDK
application as easily as possible, use SPDK's application framework. The public API is
in include/spdk/event.h - you call spdk_app_init to bootstrap the entire application.
If you really do need to initialize DPDK on your own (because you're also using DPDK
directly in your application, and you're initializing it in a different way than SPDK
allows), you need to jump through a few more hoops.
1. Initialize DPDK.
2. Call spdk_env_dpdk_post_init, to initialize SPDK's environment abstraction layer
using the existing DPDK in your application. (This is why spdk_thread_lib_init was failing
3. Call spdk_thread_lib_init to initialize SPDK's threading library.
SPDK mailing list