From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id 5B4D4A0096 for ; Fri, 12 Apr 2019 13:24:56 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 6F6CD7CEB; Fri, 12 Apr 2019 13:24:53 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 038FF5F2E; Fri, 12 Apr 2019 13:24:50 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 12 Apr 2019 04:24:49 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,341,1549958400"; d="scan'208";a="142176256" Received: from irsmsx110.ger.corp.intel.com ([163.33.3.25]) by fmsmga007.fm.intel.com with ESMTP; 12 Apr 2019 04:24:48 -0700 Received: from irsmsx108.ger.corp.intel.com ([169.254.11.82]) by irsmsx110.ger.corp.intel.com ([169.254.15.173]) with mapi id 14.03.0415.000; Fri, 12 Apr 2019 12:24:48 +0100 From: "Iremonger, Bernard" To: "Ananyev, Konstantin" , "dev@dpdk.org" , "akhil.goyal@nxp.com" CC: "stable@dpdk.org" Thread-Topic: [PATCH] app/test/ipsec: fix logic around dequeue burst Thread-Index: AQHU8GenxYgpppzdo0iGALYD3dk02qY4RCOAgAAbsrA= Date: Fri, 12 Apr 2019 11:24:48 +0000 Message-ID: <8CEF83825BEC744B83065625E567D7C260D8858F@IRSMSX108.ger.corp.intel.com> References: <1554988097-18819-1-git-send-email-bernard.iremonger@intel.com> <2601191342CEEE43887BDE71AB9772580148A969D8@irsmsx105.ger.corp.intel.com> In-Reply-To: <2601191342CEEE43887BDE71AB9772580148A969D8@irsmsx105.ger.corp.intel.com> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNzU3YmRkNjAtOGM1Mi00MjE5LWE2NjEtZjQ4ODUxMjg2NzBjIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiVVRYTWdLWnNIRGhtZGg4bVNTdFpWd3VHQTZ2NWw2aTdOU01JQTkyMjZZaE5HaktCWm9RN3hueVk5WnhDTVZPNiJ9 x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.600.7 dlp-reaction: no-action x-originating-ip: [163.33.239.181] Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH] app/test/ipsec: fix logic around dequeue burst X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Message-ID: <20190412112448.Abx7VF1J9KNFWtfXxgLjvFlVC7MCqotF8g4pBxH6WwM@z> Hi Konstantin, > > Call rte_crypto_dequeue_burst() in a loop with a delay to ensure that > > all the packets are dequeued from the crtpto device. > > > > Fixes: 59d7353b0df0 ("test/ipsec: fix test suite setup") > > Cc: stable@dpdk.org > > Signed-off-by: Bernard Iremonger > > --- > > app/test/test_ipsec.c | 42 +++++++++++++++++++++++++++++++----------- > > 1 file changed, 31 insertions(+), 11 deletions(-) > > > > diff --git a/app/test/test_ipsec.c b/app/test/test_ipsec.c index > > 80a2d25..25a7df4 100644 > > --- a/app/test/test_ipsec.c > > +++ b/app/test/test_ipsec.c > > @@ -9,7 +9,7 @@ > > #include > > #include > > #include > > -#include > > +#include > > #include > > #include > > > > @@ -42,6 +42,7 @@ > > #define OUTBOUND_SPI 17 > > #define BURST_SIZE 32 > > #define REORDER_PKTS 1 > > +#define DEQUEUE_COUNT 1000 > > > > struct user_params { > > enum rte_crypto_sym_xform_type auth; @@ -758,7 +759,9 @@ > > crypto_ipsec(uint16_t num_pkts) > > struct ipsec_testsuite_params *ts_params =3D &testsuite_params; > > struct ipsec_unitest_params *ut_params =3D &unittest_params; > > uint32_t k, ng; > > + uint32_t pkt_cnt; > > struct rte_ipsec_group grp[1]; > > + int i; > > > > /* call crypto prepare */ > > k =3D rte_ipsec_pkt_crypto_prepare(&ut_params->ss[0], ut_params->ibuf= , > > @@ -774,9 +777,15 @@ crypto_ipsec(uint16_t num_pkts) > > return TEST_FAILED; > > } > > > > - k =3D rte_cryptodev_dequeue_burst(ts_params->valid_dev, 0, > > - ut_params->cop, num_pkts); > > - if (k !=3D num_pkts) { > > + for (i =3D 0, pkt_cnt =3D 0; > > + i < DEQUEUE_COUNT && pkt_cnt !=3D num_pkts; i++) { > > + k =3D rte_cryptodev_dequeue_burst(ts_params->valid_dev, 0, > > + &ut_params->cop[pkt_cnt], num_pkts - > pkt_cnt); > > + pkt_cnt +=3D k; > > + rte_delay_us(1); > > + } >=20 > Looks good to me. > My only suggestion would be to put that loop in a separate function to av= oid > duplications. > Apart from that: > Acked-by: Konstantin Ananyev I will put that loop in a separate function and send v2 Regards, Bernard. snip