From mboxrd@z Thu Jan 1 00:00:00 1970 From: Akhil Goyal Subject: [PATCH] app/test-crypto-perf: improve dequeue logic Date: Wed, 27 Mar 2019 11:47:44 +0000 Message-ID: <20190327113823.13481-1-akhil.goyal@nxp.com> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Cc: "declan.doherty@intel.com" , Akhil Goyal To: "dev@dpdk.org" Return-path: Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-eopbgr130042.outbound.protection.outlook.com [40.107.13.42]) by dpdk.org (Postfix) with ESMTP id 6B3161B1E3 for ; Wed, 27 Mar 2019 12:47:45 +0100 (CET) Content-Language: en-US List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" In case of hardware PMDs (which may take a longer duration for processing the packets), there may be a case when the number of enqueued packets are more than the dequeued. So if the difference is more than 8 times the burst size, more dequeue operations should be performed otherwise all the buffers will be blocked in hardware. Signed-off-by: Akhil Goyal --- app/test-crypto-perf/cperf_test_throughput.c | 40 +++++++++++--------- 1 file changed, 23 insertions(+), 17 deletions(-) diff --git a/app/test-crypto-perf/cperf_test_throughput.c b/app/test-crypto= -perf/cperf_test_throughput.c index 2767f4ea8..d24a6dda0 100644 --- a/app/test-crypto-perf/cperf_test_throughput.c +++ b/app/test-crypto-perf/cperf_test_throughput.c @@ -208,23 +208,29 @@ cperf_throughput_test_runner(void *test_ctx) =20 =20 /* Dequeue processed burst of ops from crypto device */ - ops_deqd =3D rte_cryptodev_dequeue_burst(ctx->dev_id, ctx->qp_id, - ops_processed, test_burst_size); - - if (likely(ops_deqd)) { - /* Free crypto ops so they can be reused. */ - rte_mempool_put_bulk(ctx->pool, - (void **)ops_processed, ops_deqd); - - ops_deqd_total +=3D ops_deqd; - } else { - /** - * Count dequeue polls which didn't return any - * processed operations. This statistic is mainly - * relevant to hw accelerators. - */ - ops_deqd_failed++; - } + do { + ops_deqd =3D rte_cryptodev_dequeue_burst( + ctx->dev_id, ctx->qp_id, + ops_processed, test_burst_size); + + if (likely(ops_deqd)) { + /* Free crypto ops for reuse */ + rte_mempool_put_bulk(ctx->pool, + (void **)ops_processed, + ops_deqd); + + ops_deqd_total +=3D ops_deqd; + } else { + /** + * Count dequeue polls which didn't + * return any processed operations. + * This statistic is mainly relevant + * to hw accelerators. + */ + ops_deqd_failed++; + } + } while (ops_enqd_total - ops_deqd_total > + test_burst_size * 8); =20 } =20 --=20 2.17.1