DPDK patches and discussions
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: Olivier MATZ <olivier.matz@6wind.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] Could DPDK ring provide peek interface or any comments for this function?
Date: Tue, 4 Aug 2015 09:14:22 -0700	[thread overview]
Message-ID: <20150804091422.2af96521@urahara> (raw)
In-Reply-To: <55C0B6AC.2080001@6wind.com>

On Tue, 04 Aug 2015 14:57:16 +0200
Olivier MATZ <olivier.matz@6wind.com> wrote:

> Hi,
> 
> 
> On 08/04/2015 04:20 AM, Yan, Liming (Nokia - CN/Hangzhou) wrote:
> > Hi,
> >     As we see, DPDK ring has mainly the enqueue/dequeue APIs for SINGLE/MULTI producer/consumer.  I have a requirement in work to take a peek on the top object in the ring. I don't want to consume it, just check the reference of the object.  How could this be supported?   Or any alternative solution for my requirement?  Thanks.
> >     I wrote my own simple peek interface but it's not MC-safe. I think it's better if DPDK can support it officially.
> 
> I think it's a good idea. I think we could avoid a test by using
> the same naming convention than other functions applying to single
> consumer rings.
> 
> I'm not sure the function is safe on mc rings: the pointer returned
> via peek() should not be accessed while another core dequeues the
> object and modify/free it.

It is not possible for peek to be SMP safe. Another consumer could remove
item from ring and  free at any time.

  reply	other threads:[~2015-08-04 16:14 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-03 21:39 [dpdk-dev] I want to post my patch about examples/kni EaseTheWorld Mr.
2015-08-03 22:10 ` Thomas Monjalon
2015-08-04  2:08 ` [dpdk-dev] Could DPDK ring provide peek interface or any comments for this function? Yan, Liming (Nokia - CN/Hangzhou)
2015-08-04  2:20 ` Yan, Liming (Nokia - CN/Hangzhou)
2015-08-04 12:57   ` Olivier MATZ
2015-08-04 16:14     ` Stephen Hemminger [this message]
2015-08-05  3:08     ` Yan, Liming (Nokia - CN/Hangzhou)

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=20150804091422.2af96521@urahara \
    --to=stephen@networkplumber.org \
    --cc=dev@dpdk.org \
    --cc=olivier.matz@6wind.com \
    /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;
as well as URLs for NNTP newsgroup(s).