DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Yeddula, Avinash" <ayeddula@ciena.com>
To: "dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] Question on rte_ring_dequeue_bulk()
Date: Wed, 6 Jul 2016 21:52:46 -0400	[thread overview]
Message-ID: <A1E50D8AD6310E47A6C10F075AEDC0220393CDF13A@ONWVEXCHMB01.ciena.com> (raw)

I apologies, I should have checked it more carefully.

*   if behavior = RTE_RING_QUEUE_VARIABLE
*   - n: Actual number of objects dequeued.

This function returns the "n" I was looking for.

Thanks
-Avinash

From: Yeddula, Avinash
Sent: Wednesday, July 06, 2016 6:39 PM
To: dev@dpdk.org
Subject: Question on rte_ring_dequeue_bulk()

Hi All,

* @param r
*   A pointer to the ring structure.
* @param obj_table
*   A pointer to a table of void * pointers (objects) that will be filled.
* @param n
*   The number of objects to dequeue from the ring to the obj_table.

By looking at the code I understood that, if the ring has less than "n" objects,  rte_ring_dequeue_bulk()  readjusts the value "n" returns what ever is available.
I have a requirement where I need to know  the new value of "n" , if the api has returned less than what was requested.

One way is to memset the "objects" and check for the non-zero values. I kind of, did not like this idea. Any better idea to get "n" ?


1.      rte_ring_dequeue_bulk(my-ring,  (void**) pkts, n)  -- n is set to 32.

2.      If the ring has less than 32 pkts, say 20, my understanding is that it returns 20 "pkt" ptrs.

3.      How do I get the number "20" ?

Hope my question was clear.

Thanks
-Avinash

             reply	other threads:[~2016-07-07  1:52 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-07  1:52 Yeddula, Avinash [this message]
  -- strict thread matches above, loose matches on Subject: below --
2016-07-07  1:38 Yeddula, Avinash

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=A1E50D8AD6310E47A6C10F075AEDC0220393CDF13A@ONWVEXCHMB01.ciena.com \
    --to=ayeddula@ciena.com \
    --cc=dev@dpdk.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;
as well as URLs for NNTP newsgroup(s).