Storage Performance Development Kit (SPDK)
 help / color / mirror / Atom feed
From: Walker, Benjamin <benjamin.walker at intel.com>
To: spdk@lists.01.org
Subject: Re: [SPDK] SPDK Ring Enqueue/Dequeue Issue
Date: Wed, 19 Sep 2018 19:42:52 +0000	[thread overview]
Message-ID: <3edd0b8a60bc4eb05cb2befd606e7542f39bf553.camel@intel.com> (raw)
In-Reply-To: 8C6480B2-5BD1-42D8-970F-DF40372A8A83@intel.com

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

On Wed, 2018-09-19 at 19:07 +0000, Harris, James R wrote:
> 
> On 9/19/18, 11:37 AM, "SPDK on behalf of Andrey Kuzmin" <
> spdk-bounces(a)lists.01.org on behalf of andrey.v.kuzmin(a)gmail.com> wrote:
> 
>     On Wed, Sep 19, 2018 at 9:13 PM John Barnard <john.barnard(a)broadcom.com>
>     wrote:
>     
> <snip>
> 
>     >
>     > It seems that the spdk_ring_enqueue function calls
>     > rte_ring_mp_enqueue_bulk(), while spdk_ring_dequeue function calls
>     > rte_ring_sc_dequeue_burst().  When we change it to call
>     > ret_ring_mp_dequeue_burst(), the problem went away.  So my question is,
> why
>     > this difference in the rte calls made by the SPDK?  Is this a bug or on
>     > purpose?  Also, we noticed that there is no ring create flag (in
>     > include/spdk/env.h) for multi-producer, multi-consumer (i.e.
>     > SPDK_RING_TYPE_MP_MC), although it doesn't seem to matter if we pass the
>     > SPDK_RING_TYPE_MP_SC flag to  spdk_ring_create() (i.e. it's the call to
>     > rte_ring_mp_dequeue_burst that's critical).  Is there a reason this flag
>     > was left out?
>     >
>     
>     The two issues above are interrelated. SPDK seemingly does not care for
>     MP/MC rings, so it neither defines the flag to create the respective ring
>     type, nor appreciates this ring type under ring_dequeue (for enqueue, it
>     uses MP flavor which works for SP case as well).
>     
>     The definitive answer as to why belongs to the SPDK team, while my guess
> is
>     that rings in SPDK are primarily (and solely, to the best of my knowledge)
>     for passing messages between SPDK threads where  MP/MC scenario does not
>   apply.
> 
> Andrey is correct.  There hasn’t been a use case for MP/MC rings in SPDK
> yet.  Rings are primarily used today for passing messages to a specific
> reactor – each reactor has its own ring (so it’s single consumer) but any
> thread may post messages to it.
> 
> I see no reason to not add MP/MC support if it’s needed for NVMe-oF FC.

The best way to introduce this into SPDK is to add flags or function variants
for single/multi-consumer, so the appropriate DPDK function call can be used
underneath. Changing the ring from single consumer to multi-consumer introduces
an atomic instruction. That's why we avoid that, given our only use case today
is single consumer.

> 
> John – is this something you’d like to tackle?
> 
> -Jim
> 
> _______________________________________________
> SPDK mailing list
> SPDK(a)lists.01.org
> https://lists.01.org/mailman/listinfo/spdk


             reply	other threads:[~2018-09-19 19:42 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-19 19:42 Walker, Benjamin [this message]
  -- strict thread matches above, loose matches on Subject: below --
2018-09-19 22:01 [SPDK] SPDK Ring Enqueue/Dequeue Issue Harris, James R
2018-09-19 21:38 John Barnard
2018-09-19 21:24 Harris, James R
2018-09-19 21:14 John Barnard
2018-09-19 19:48 Harris, James R
2018-09-19 19:07 Harris, James R
2018-09-19 18:37 Andrey Kuzmin
2018-09-19 18:13 John Barnard

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3edd0b8a60bc4eb05cb2befd606e7542f39bf553.camel@intel.com \
    --to=spdk@lists.01.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox