[dpdk-dev] [PATCH] cryptodev: fix cryptodev start return value
Trahe, Fiona
fiona.trahe at intel.com
Wed Jun 7 17:54:23 CEST 2017
Hi Pavan,
> -----Original Message-----
> From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Pavan Nikhilesh
> Sent: Wednesday, June 7, 2017 11:37 AM
> To: dev at dpdk.org
> Cc: Doherty, Declan <declan.doherty at intel.com>; Pavan Nikhilesh Bhagavatula
> <pbhagavatula at caviumnetworks.com>
> Subject: [dpdk-dev] [PATCH] cryptodev: fix cryptodev start return value
>
> From: Pavan Nikhilesh Bhagavatula <pbhagavatula at caviumnetworks.com>
>
> If cryptodev has already started it should return -EBUSY instead of 0
> when rte_cryptodev_start is called.
>
> Fixes: d11b0f30df88 ("cryptodev: introduce API and framework for crypto devices")
>
> Signed-off-by: Pavan Nikhilesh <pbhagavatula at caviumnetworks.com>
> ---
> lib/librte_cryptodev/rte_cryptodev.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/lib/librte_cryptodev/rte_cryptodev.c b/lib/librte_cryptodev/rte_cryptodev.c
> index b65cd9c..c815038 100644
> --- a/lib/librte_cryptodev/rte_cryptodev.c
> +++ b/lib/librte_cryptodev/rte_cryptodev.c
> @@ -1000,7 +1000,7 @@ rte_cryptodev_start(uint8_t dev_id)
> if (dev->data->dev_started != 0) {
> CDEV_LOG_ERR("Device with dev_id=%" PRIu8 " already started",
> dev_id);
> - return 0;
> + return -EBUSY;
It makes sense to me to return 0/success in this case, as the end result is the
same, the device is successfully started.
But I don't feel strongly about it if there's a good argument for making the change?
However, as it is an API change doesn't it need to be flagged in a release before the change is made?
}
>
> diag = (*dev->dev_ops->dev_start)(dev);
> --
> 2.7.4
More information about the dev
mailing list