Skip to contentSkip to conversation

MIgrating code from v18.xx to v19.07

SPDK Harris 1 participant 2 messages Sep 19, 2019

lore
Share & tools
lore

Harris

#0 lore raw

Hi Jan,

We've moved the poller (and associated message) management into the spdk_thread itself. You should now be able to just do something like this:

thread = spdk_thread_create("jans_thread", NULL);
spdk_set_thread(thread);
poller = spdk_poller_register(...);
spdk_thread_poll(thread, 0, 0);

-Jim

On 9/19/19, 8:38 AM, "SPDK on behalf of Lisowiec, Jan" <spdk-bounces(a)lists.01.org on behalf of jan.lisowiec(a)intel.com> wrote:

Hi Everyone,

I'm in a process of migrating some piece of logic from spdk v18.xx to v19.07.

The code implements a simple poller by means of spdk_ring_create(), spdk_allocate_thread() and a callback that enqueues messages on the ring. In v19.07 spdk_allocate_thread() is no longer available. Is there a new way of achieving the same ? I've found examples/bdev/fio_plugin, which might be what I'm looking for but I wonder if I need all of it to implement my simple poller.

Can somebody provide some guidelines ?

Thanks
Jan
--------------------------------------------------------------------

Intel Technology Poland sp. z o.o.
ul. Slowackiego 173 | 80-298 Gdansk | Sad Rejonowy Gdansk Polnoc | VII Wydzial Gospodarczy Krajowego Rejestru Sadowego - KRS 101882 | NIP 957-07-52-316 | Kapital zakladowy 200.000 PLN.

Ta wiadomosc wraz z zalacznikami jest przeznaczona dla okreslonego adresata i moze zawierac informacje poufne. W razie przypadkowego otrzymania tej wiadomosci, prosimy o powiadomienie nadawcy oraz trwale jej usuniecie; jakiekolwiek przegladanie lub rozpowszechnianie jest zabronione.
This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). If you are not the intended recipient, please contact the sender and delete all copies; any review or distribution by others is strictly prohibited.
_______________________________________________
SPDK mailing list
SPDK(a)lists.01.org
https://lists.01.org/mailman/listinfo/spdk

#1 lore raw
Quoted 8 lines

-----Original Message-----
From: SPDK [mailto:spdk-bounces(a)lists.01.org] On Behalf Of Harris, James R
Sent: Thursday, September 19, 2019 9:01 AM
To: Storage Performance Development Kit <spdk(a)lists.01.org>
Subject: Re: [SPDK] MIgrating code from v18.xx to v19.07

Quoted 8 lines

Hi Jan,

We've moved the poller (and associated message) management into the spdk_thread itself. You should now be able to just do something like this:

thread = spdk_thread_create("jans_thread", NULL); spdk_set_thread(thread); poller = spdk_poller_register(...); spdk_thread_poll(thread, 0, 0);

If your application is using the SPDK application framework and your code is already executing inside an SPDK thread (i.e. you called spdk_app_start already) then you should do something like this:

static void thread_entry(void *arg) {
    spdk_poller_register(...);
}

thread = spdk_thread_create("jans_thread", NULL);
spdk_thread_send_msg(thread, thread_entry, NULL);

The application framework will automatically schedule your lightweight thread onto one of the system threads, so you can't safely call spdk_set_thread on your current thread. If you're using SPDK from outside of the SPDK application framework, do it like Jim suggested.

Thanks,
Ben

Quoted 47 lines

-Jim

On 9/19/19, 8:38 AM, "SPDK on behalf of Lisowiec, Jan" <spdk- bounces(a)lists.01.org on behalf of jan.lisowiec(a)intel.com> wrote:

Hi Everyone,

I'm in a process of migrating some piece of logic from spdk v18.xx to v19.07.

The code implements a simple poller by means of spdk_ring_create(),
spdk_allocate_thread() and a callback that enqueues messages on the ring. In v19.07 spdk_allocate_thread() is no longer available. Is there a new way of achieving the same ? I've found examples/bdev/fio_plugin, which might be what I'm looking for but I wonder if I need all of it to implement my simple poller.

Can somebody provide some guidelines ?

Thanks
Jan
--------------------------------------------------------------------

Intel Technology Poland sp. z o.o.
ul. Slowackiego 173 | 80-298 Gdansk | Sad Rejonowy Gdansk Polnoc | VII
Wydzial Gospodarczy Krajowego Rejestru Sadowego - KRS 101882 | NIP 957-07- 52-316 | Kapital zakladowy 200.000 PLN.

Ta wiadomosc wraz z zalacznikami jest przeznaczona dla okreslonego
adresata i moze zawierac informacje poufne. W razie przypadkowego otrzymania tej wiadomosci, prosimy o powiadomienie nadawcy oraz trwale jej usuniecie; jakiekolwiek
przegladanie lub rozpowszechnianie jest zabronione.
This e-mail and any attachments may contain confidential material for the
sole use of the intended recipient(s). If you are not the intended recipient, please contact the sender and delete all copies; any review or distribution by
others is strictly prohibited.
_______________________________________________
SPDK mailing list
SPDK(a)lists.01.org
https://lists.01.org/mailman/listinfo/spdk

_______________________________________________
SPDK mailing list
SPDK(a)lists.01.org
https://lists.01.org/mailman/listinfo/spdk