[dpdk-dev] [PATCH] app/test-crypto-perf: fix incorrect size of expression
De Lara Guarch, Pablo
pablo.de.lara.guarch at intel.com
Fri Feb 10 00:53:14 CET 2017
Hi Jacek,
> -----Original Message-----
> From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Jacek Piasecki
> Sent: Wednesday, February 08, 2017 4:05 PM
> To: Doherty, Declan
> Cc: dev at dpdk.org; Piasecki, JacekX
> Subject: [dpdk-dev] [PATCH] app/test-crypto-perf: fix incorrect size of
> expression
>
> Fix problem of passing a pointer to sizeof() function. Now the size
> of enabled_cdevs structure is passed by RTE_CRYPTO_MAX_DEVS.
>
> Coverity issue: 141068
> Fixes: f8be1786b1b8 ("app/crypto-perf: introduce performance test
> application")
>
> Signed-off-by: Jacek Piasecki <jacekx.piasecki at intel.com>
> ---
> app/test-crypto-perf/main.c | 8 +++++---
> 1 file changed, 5 insertions(+), 3 deletions(-)
>
> diff --git a/app/test-crypto-perf/main.c b/app/test-crypto-perf/main.c
> index 634ea5f..dff906e 100644
> --- a/app/test-crypto-perf/main.c
> +++ b/app/test-crypto-perf/main.c
> @@ -39,13 +39,14 @@
> };
>
> static int
> -cperf_initialize_cryptodev(struct cperf_options *opts, uint8_t
> *enabled_cdevs)
> +cperf_initialize_cryptodev(struct cperf_options *opts, uint8_t
> *enabled_cdevs,
> + uint8_t enabled_cdevs_dim)
I think this extra parameter in the function is unnecessary,
as it is always RTE_CRYPTO_MAX_DEVS.
Better to pass RTE_CRYPTO_MAX_DEVS to rte_cryptodev_devices_get() directly.
> {
> uint8_t cdev_id, enabled_cdev_count = 0, nb_lcores;
> int ret;
>
> enabled_cdev_count = rte_cryptodev_devices_get(opts-
> >device_type,
> - enabled_cdevs, RTE_DIM(enabled_cdevs));
> + enabled_cdevs, enabled_cdevs_dim);
Thanks,
Pablo
More information about the dev
mailing list