* [dpdk-dev] [PATCH] cryptodev: fix cryptodev start return value
@ 2017-06-07 10:36 Pavan Nikhilesh
2017-06-07 15:54 ` Trahe, Fiona
0 siblings, 1 reply; 4+ messages in thread
From: Pavan Nikhilesh @ 2017-06-07 10:36 UTC (permalink / raw)
To: dev; +Cc: declan.doherty, Pavan Nikhilesh Bhagavatula
From: Pavan Nikhilesh Bhagavatula <pbhagavatula@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@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;
}
diag = (*dev->dev_ops->dev_start)(dev);
--
2.7.4
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [dpdk-dev] [PATCH] cryptodev: fix cryptodev start return value
2017-06-07 10:36 [dpdk-dev] [PATCH] cryptodev: fix cryptodev start return value Pavan Nikhilesh
@ 2017-06-07 15:54 ` Trahe, Fiona
2017-06-08 8:12 ` Pavan Nikhilesh Bhagavatula
0 siblings, 1 reply; 4+ messages in thread
From: Trahe, Fiona @ 2017-06-07 15:54 UTC (permalink / raw)
To: Pavan Nikhilesh, dev; +Cc: Doherty, Declan, Trahe, Fiona
Hi Pavan,
> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Pavan Nikhilesh
> Sent: Wednesday, June 7, 2017 11:37 AM
> To: dev@dpdk.org
> Cc: Doherty, Declan <declan.doherty@intel.com>; Pavan Nikhilesh Bhagavatula
> <pbhagavatula@caviumnetworks.com>
> Subject: [dpdk-dev] [PATCH] cryptodev: fix cryptodev start return value
>
> From: Pavan Nikhilesh Bhagavatula <pbhagavatula@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@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
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [dpdk-dev] [PATCH] cryptodev: fix cryptodev start return value
2017-06-07 15:54 ` Trahe, Fiona
@ 2017-06-08 8:12 ` Pavan Nikhilesh Bhagavatula
2017-07-11 14:08 ` De Lara Guarch, Pablo
0 siblings, 1 reply; 4+ messages in thread
From: Pavan Nikhilesh Bhagavatula @ 2017-06-08 8:12 UTC (permalink / raw)
To: dev, Trahe, Fiona; +Cc: Doherty, Declan, Pavan Nikhilesh
On Wed, Jun 07, 2017 at 03:54:23PM +0000, Trahe, Fiona wrote:
> Hi Pavan,
>
> > -----Original Message-----
> > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Pavan Nikhilesh
> > Sent: Wednesday, June 7, 2017 11:37 AM
> > To: dev@dpdk.org
> > Cc: Doherty, Declan <declan.doherty@intel.com>; Pavan Nikhilesh Bhagavatula
> > <pbhagavatula@caviumnetworks.com>
> > Subject: [dpdk-dev] [PATCH] cryptodev: fix cryptodev start return value
> >
> > From: Pavan Nikhilesh Bhagavatula <pbhagavatula@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@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?
I do agree with this but from an application perspective when the API
is called again after the device has already started (without calling
the stop API) it would mean that there is an underlying issue with
the application's business logic and it would go undetected, so I feel
that we should strictly enforce this scenario as an error.
> However, as it is an API change doesn't it need to be flagged in a release before the change is made?
I don't think that this would be an API change as it doesn't deprecate
the existing ABI.
Any thoughts about this from the community are welcome as the same
issue affects multiple core libraries (crytodev, ethdev, eventdev).
>
>
> }
> >
> > diag = (*dev->dev_ops->dev_start)(dev);
> > --
> > 2.7.4
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [dpdk-dev] [PATCH] cryptodev: fix cryptodev start return value
2017-06-08 8:12 ` Pavan Nikhilesh Bhagavatula
@ 2017-07-11 14:08 ` De Lara Guarch, Pablo
0 siblings, 0 replies; 4+ messages in thread
From: De Lara Guarch, Pablo @ 2017-07-11 14:08 UTC (permalink / raw)
To: Pavan Nikhilesh Bhagavatula, dev, Trahe, Fiona; +Cc: Doherty, Declan
> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Pavan Nikhilesh
> Bhagavatula
> Sent: Thursday, June 8, 2017 9:13 AM
> To: dev@dpdk.org; Trahe, Fiona <fiona.trahe@intel.com>
> Cc: Doherty, Declan <declan.doherty@intel.com>; Pavan Nikhilesh
> <pbhagavatula@caviumnetworks.com>
> Subject: Re: [dpdk-dev] [PATCH] cryptodev: fix cryptodev start return value
>
> On Wed, Jun 07, 2017 at 03:54:23PM +0000, Trahe, Fiona wrote:
> > Hi Pavan,
> >
> > > -----Original Message-----
> > > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Pavan
> Nikhilesh
> > > Sent: Wednesday, June 7, 2017 11:37 AM
> > > To: dev@dpdk.org
> > > Cc: Doherty, Declan <declan.doherty@intel.com>; Pavan Nikhilesh
> > > Bhagavatula <pbhagavatula@caviumnetworks.com>
> > > Subject: [dpdk-dev] [PATCH] cryptodev: fix cryptodev start return
> > > value
> > >
> > > From: Pavan Nikhilesh Bhagavatula
> <pbhagavatula@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@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?
>
> I do agree with this but from an application perspective when the API is
> called again after the device has already started (without calling the stop
> API) it would mean that there is an underlying issue with the application's
> business logic and it would go undetected, so I feel that we should strictly
> enforce this scenario as an error.
>
> > However, as it is an API change doesn't it need to be flagged in a release
> before the change is made?
>
> I don't think that this would be an API change as it doesn't deprecate the
> existing ABI.
> Any thoughts about this from the community are welcome as the same
> issue affects multiple core libraries (crytodev, ethdev, eventdev).
Hi Pavan,
As said by Fiona and Thomas (for ethdev), this is an API change, so it would
require a deprecation notice, in order to be changed in the next release.
Thanks,
Pablo
> >
> >
> > }
> > >
> > > diag = (*dev->dev_ops->dev_start)(dev);
> > > --
> > > 2.7.4
> >
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2017-07-11 14:08 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-07 10:36 [dpdk-dev] [PATCH] cryptodev: fix cryptodev start return value Pavan Nikhilesh
2017-06-07 15:54 ` Trahe, Fiona
2017-06-08 8:12 ` Pavan Nikhilesh Bhagavatula
2017-07-11 14:08 ` De Lara Guarch, Pablo
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).