DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Iremonger, Bernard" <bernard.iremonger@intel.com>
To: "Ananyev, Konstantin" <konstantin.ananyev@intel.com>,
	"dev@dpdk.org" <dev@dpdk.org>,
	"akhil.goyal@nxp.com" <akhil.goyal@nxp.com>
Cc: "stable@dpdk.org" <stable@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH] app/test/ipsec: fix logic around dequeue burst
Date: Fri, 12 Apr 2019 11:24:48 +0000	[thread overview]
Message-ID: <8CEF83825BEC744B83065625E567D7C260D8858F@IRSMSX108.ger.corp.intel.com> (raw)
Message-ID: <20190412112448.Abx7VF1J9KNFWtfXxgLjvFlVC7MCqotF8g4pBxH6WwM@z> (raw)
In-Reply-To: <2601191342CEEE43887BDE71AB9772580148A969D8@irsmsx105.ger.corp.intel.com>

Hi Konstantin,

<snip>
> > 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 <bernard.iremonger@intel.com>
> > ---
> >  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 <rte_mbuf.h>
> >  #include <rte_malloc.h>
> >  #include <rte_memcpy.h>
> > -#include <rte_pause.h>
> > +#include <rte_cycles.h>
> >  #include <rte_bus_vdev.h>
> >  #include <rte_ip.h>
> >
> > @@ -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 = &testsuite_params;
> >  	struct ipsec_unitest_params *ut_params = &unittest_params;
> >  	uint32_t k, ng;
> > +	uint32_t pkt_cnt;
> >  	struct rte_ipsec_group grp[1];
> > +	int i;
> >
> >  	/* call crypto prepare */
> >  	k = 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 = rte_cryptodev_dequeue_burst(ts_params->valid_dev, 0,
> > -		ut_params->cop, num_pkts);
> > -	if (k != num_pkts) {
> > +	for (i = 0, pkt_cnt = 0;
> > +		i < DEQUEUE_COUNT && pkt_cnt != num_pkts; i++) {
> > +		k = rte_cryptodev_dequeue_burst(ts_params->valid_dev, 0,
> > +				&ut_params->cop[pkt_cnt], num_pkts -
> pkt_cnt);
> > +		pkt_cnt += k;
> > +		rte_delay_us(1);
> > +	}
> 
> Looks good to me.
> My only suggestion would be to put that loop in a separate function to avoid
> duplications.
> Apart from that:
> Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>

I will put that loop in a separate function and send v2

Regards,

Bernard.

snip

  parent reply	other threads:[~2019-04-12 11:24 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-11 13:08 Bernard Iremonger
2019-04-11 13:08 ` Bernard Iremonger
2019-04-11 17:14 ` Trahe, Fiona
2019-04-11 17:14   ` Trahe, Fiona
2019-04-12 10:31 ` Ananyev, Konstantin
2019-04-12 10:31   ` Ananyev, Konstantin
2019-04-12 11:24   ` Iremonger, Bernard [this message]
2019-04-12 11:24     ` Iremonger, Bernard
2019-04-12 14:08 ` [dpdk-dev] [PATCH v2] " Bernard Iremonger
2019-04-12 14:08   ` Bernard Iremonger

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=8CEF83825BEC744B83065625E567D7C260D8858F@IRSMSX108.ger.corp.intel.com \
    --to=bernard.iremonger@intel.com \
    --cc=akhil.goyal@nxp.com \
    --cc=dev@dpdk.org \
    --cc=konstantin.ananyev@intel.com \
    --cc=stable@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).