Thank you Ben for your response.
Yes I want to use DPDK in the app. I did include spdk_env_dpdk_post_init after eal init in
Rc1= rte_eal_init(argc, argv);
However spdk_thread_lib_init() is still returning -1 and thread creation with
p=spdk_thread_create("th1",NULL); crashes (under static library)
Do you have any idea on what else am I missing? Or what else could be causing the error?
From: SPDK <spdk-bounces(a)lists.01.org> On Behalf Of Walker, Benjamin
Sent: Monday, June 24, 2019 4:36 AM
To: Storage Performance Development Kit <spdk(a)lists.01.org>
Subject: Re: [SPDK] spdk thread lib init
From: SPDK [mailto:email@example.com] On Behalf Of Khoussi,
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
SPDK mailing list