DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Trahe, Fiona" <fiona.trahe@intel.com>
To: "De Lara Guarch, Pablo" <pablo.de.lara.guarch@intel.com>,
	"Doherty, Declan" <declan.doherty@intel.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH v2 4/5] examples/l2fwd-crypto: fix session mempool size
Date: Fri, 20 Jul 2018 08:53:42 +0000	[thread overview]
Message-ID: <348A99DA5F5B7549AA880327E580B435895DDDF3@IRSMSX101.ger.corp.intel.com> (raw)
In-Reply-To: <20180719083959.41480-5-pablo.de.lara.guarch@intel.com>

Hi Pablo,

> -----Original Message-----
> From: De Lara Guarch, Pablo
> Sent: Thursday, July 19, 2018 9:40 AM
> To: Doherty, Declan <declan.doherty@intel.com>; Trahe, Fiona <fiona.trahe@intel.com>
> Cc: dev@dpdk.org; De Lara Guarch, Pablo <pablo.de.lara.guarch@intel.com>
> Subject: [PATCH v2 4/5] examples/l2fwd-crypto: fix session mempool size
> 
> The session mempool size for this application depends
> on the number of crypto devices that are capable
> of performing the operation given by the parameters on the app.
> 
> However, previously this calculation was done before all devices
> were checked, resulting in an incorrect number of sessions
> required.
> 
> Now the calculation of the devices to be used is done first
> (checking the capabilities of the enabled devices),
> followed by the creation of the session pool, resulting
> in a correct number of objects needed for the sessions
> to be created.
> 
> Fixes: e3bcb99a5e13 ("examples/l2fwd-crypto: limit number of sessions")
> 
> Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
> ---
>  examples/l2fwd-crypto/main.c | 272 +++++++++++++++++++++++++++++++++++++++++--
>  1 file changed, 260 insertions(+), 12 deletions(-)
> 
> diff --git a/examples/l2fwd-crypto/main.c b/examples/l2fwd-crypto/main.c


//snip//

> @@ -1976,16 +2217,31 @@ initialize_cryptodevs(struct l2fwd_crypto_options *options, unsigned
> nb_ports,
>  		return -1;
>  	}
> 
> -	for (cdev_id = 0; cdev_id < cdev_count; cdev_id++) {
> +	for (cdev_id = 0; cdev_id < cdev_count && enabled_cdev_count < nb_ports;
> +			cdev_id++) {
>  		sess_sz = rte_cryptodev_sym_get_private_session_size(cdev_id);
>  		if (sess_sz > max_sess_sz)
>  			max_sess_sz = sess_sz;

> +
> +		if (check_cryptodev_mask(options, cdev_id) < 0)
> +			continue;
> +
> +		if (check_capabilities(options, cdev_id) < 0)
> +			continue;
> +
> +		l2fwd_enabled_crypto_mask |= (((uint64_t)1) << cdev_id);
> +
> +		enabled_cdevs[cdev_id] = 1;
> +		enabled_cdev_count++;
>  	}
[Fiona] It would be better to move the sess_sz assignment down to after the capabilities check.
Apart from this 
Acked-by: Fiona Trahe <fiona.trahe@intel.com> 

  reply	other threads:[~2018-07-20  8:53 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-17 10:38 [dpdk-dev] [PATCH] " Pablo de Lara
2018-07-19  8:39 ` [dpdk-dev] [PATCH v2 0/5] L2fwd-crypto fixes Pablo de Lara
2018-07-19  8:39   ` [dpdk-dev] [PATCH v2 1/5] examples/l2fwd-crypto: check return value on IV size check Pablo de Lara
2018-07-19  8:39   ` [dpdk-dev] [PATCH v2 2/5] examples/l2fwd-crypto: skip device not supporting operation Pablo de Lara
2018-07-19  8:39   ` [dpdk-dev] [PATCH v2 3/5] examples/l2fwd-crypto: separate IV check from xform setting Pablo de Lara
2018-07-19  8:39   ` [dpdk-dev] [PATCH v2 4/5] examples/l2fwd-crypto: fix session mempool size Pablo de Lara
2018-07-20  8:53     ` Trahe, Fiona [this message]
2018-07-19  8:39   ` [dpdk-dev] [PATCH v2 5/5] examples/l2fwd-crypto: remove duplicated capability check Pablo de Lara
2018-07-20  9:01   ` [dpdk-dev] [PATCH v2 0/5] L2fwd-crypto fixes Trahe, Fiona
2018-07-20 10:41     ` De Lara Guarch, Pablo
2018-07-20 10:45       ` De Lara Guarch, Pablo

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=348A99DA5F5B7549AA880327E580B435895DDDF3@IRSMSX101.ger.corp.intel.com \
    --to=fiona.trahe@intel.com \
    --cc=declan.doherty@intel.com \
    --cc=dev@dpdk.org \
    --cc=pablo.de.lara.guarch@intel.com \
    /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).