[dpdk-dev] Question on rte_ring_dequeue_bulk()

Yeddula, Avinash ayeddula at ciena.com
Thu Jul 7 03:52:46 CEST 2016


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



More information about the dev mailing list