From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0a-00103a01.pphosted.com (mx0a-00103a01.pphosted.com [67.231.144.234]) by dpdk.org (Postfix) with ESMTP id 2925C95CB for ; Thu, 7 Jul 2016 03:52:50 +0200 (CEST) Received: from pps.filterd (m0000419.ppops.net [127.0.0.1]) by mx0a-00103a01.pphosted.com (8.16.0.11/8.16.0.11) with SMTP id u671nHWX018045 for ; Wed, 6 Jul 2016 21:52:49 -0400 Received: from mdwexght02.ciena.com (lin1-118-36-29.ciena.com [63.118.36.29]) by mx0a-00103a01.pphosted.com with ESMTP id 2418nt1ns2-1 (version=TLSv1 cipher=AES128-SHA bits=128 verify=NOT) for ; Wed, 06 Jul 2016 21:52:49 -0400 Received: from ONWVEXCHHT01.ciena.com (10.128.6.16) by MDWEXGHT02.ciena.com (10.4.140.213) with Microsoft SMTP Server (TLS) id 8.3.389.2; Wed, 6 Jul 2016 21:52:48 -0400 Received: from ONWVEXCHMB01.ciena.com ([10.128.6.18]) by ONWVEXCHHT01.ciena.com ([::1]) with mapi; Wed, 6 Jul 2016 21:52:47 -0400 From: "Yeddula, Avinash" To: "dev@dpdk.org" Date: Wed, 6 Jul 2016 21:52:46 -0400 Thread-Topic: Question on rte_ring_dequeue_bulk() Thread-Index: AdHX7y1iJ1ELS+gTRH2xYBL4llxOgwAAuamw Message-ID: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US X-TM-AS-Product-Ver: SMEX-11.0.0.4179-8.000.1202-22436.003 X-TM-AS-Result: No--13.946700-0.000000-31 X-TM-AS-User-Approved-Sender: Yes X-TM-AS-User-Blocked-Sender: No MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2016-07-06_11:, , signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 impostorscore=0 lowpriorityscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1604210000 definitions=main-1607070015 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: Re: [dpdk-dev] Question on rte_ring_dequeue_bulk() X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jul 2016 01:52:50 -0000 I apologies, I should have checked it more carefully. * if behavior =3D 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" obj= ects, rte_ring_dequeue_bulk() readjusts the value "n" returns what ever i= s available. I have a requirement where I need to know the new value of "n" , if the ap= i has returned less than what was requested. One way is to memset the "objects" and check for the non-zero values. I kin= d 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 3= 2. 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