Storage Performance Development Kit (SPDK)
 help / color / mirror / Atom feed
* Re: [SPDK] MIgrating code from v18.xx to v19.07
@ 2019-09-19 16:00 Harris, James R
  0 siblings, 0 replies; 3+ messages in thread
From: Harris, James R @ 2019-09-19 16:00 UTC (permalink / raw)
  To: spdk

[-- Attachment #1: Type: text/plain, Size: 2068 bytes --]

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
    


^ permalink raw reply	[flat|nested] 3+ messages in thread
* Re: [SPDK] MIgrating code from v18.xx to v19.07
@ 2019-09-19 16:10 Walker, Benjamin
  0 siblings, 0 replies; 3+ messages in thread
From: Walker, Benjamin @ 2019-09-19 16:10 UTC (permalink / raw)
  To: spdk

[-- Attachment #1: Type: text/plain, Size: 3259 bytes --]



> -----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
> 
> 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


> -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

^ permalink raw reply	[flat|nested] 3+ messages in thread
* [SPDK] MIgrating code from v18.xx to v19.07
@ 2019-09-19 15:37 Lisowiec, Jan
  0 siblings, 0 replies; 3+ messages in thread
From: Lisowiec, Jan @ 2019-09-19 15:37 UTC (permalink / raw)
  To: spdk

[-- Attachment #1: Type: text/plain, Size: 1380 bytes --]

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.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-09-19 16:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-09-19 16:00 [SPDK] MIgrating code from v18.xx to v19.07 Harris, James R
  -- strict thread matches above, loose matches on Subject: below --
2019-09-19 16:10 Walker, Benjamin
2019-09-19 15:37 Lisowiec, Jan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox