cryptodev: clarify error codes returned

Message ID 20230424091920.660-1-anoobj@marvell.com (mailing list archive)
State Accepted, archived
Delegated to: akhil goyal
Headers
Series cryptodev: clarify error codes returned |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/loongarch-compilation success Compilation OK
ci/github-robot: build success github build: passed
ci/intel-Testing success Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-aarch64-unit-testing success Testing PASS
ci/iol-unit-testing fail Testing issues
ci/iol-abi-testing success Testing PASS
ci/iol-x86_64-compile-testing success Testing PASS
ci/iol-testing success Testing PASS
ci/iol-aarch64-compile-testing success Testing PASS
ci/iol-x86_64-unit-testing success Testing PASS
ci/intel-Functional success Functional PASS

Commit Message

Anoob Joseph April 24, 2023, 9:19 a.m. UTC
  When symmetric sessions are created, it may fail due to non-critical
errors. When PMD doesn't support the specific combination that
application requested, it can return -ENOTSUP which can be handled so in
application. The API is already setting rte_errno according to the
reason of the failure. Clarifying this in the spec to list down possible
error codes.

Fixes: bdce2564dbf7 ("cryptodev: rework session framework")

Signed-off-by: Anoob Joseph <anoobj@marvell.com>
---
 lib/cryptodev/rte_cryptodev.h | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
  

Comments

Power, Ciara May 8, 2023, 12:32 p.m. UTC | #1
Hi Anoob,

> -----Original Message-----
> From: Anoob Joseph <anoobj@marvell.com>
> Sent: Monday 24 April 2023 10:19
> To: Akhil Goyal <gakhil@marvell.com>; Fan Zhang
> <fanzhang.oss@gmail.com>
> Cc: Jerin Jacob <jerinj@marvell.com>; dev@dpdk.org
> Subject: [PATCH] cryptodev: clarify error codes returned
> 
> When symmetric sessions are created, it may fail due to non-critical errors.
> When PMD doesn't support the specific combination that application
> requested, it can return -ENOTSUP which can be handled so in application.
> The API is already setting rte_errno according to the reason of the failure.
> Clarifying this in the spec to list down possible error codes.
> 
> Fixes: bdce2564dbf7 ("cryptodev: rework session framework")
> 
> Signed-off-by: Anoob Joseph <anoobj@marvell.com>
> ---
>  lib/cryptodev/rte_cryptodev.h | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)

Acked-by: Ciara Power <ciara.power@intel.com>
  
Akhil Goyal May 16, 2023, 10:43 a.m. UTC | #2
> Subject: [PATCH] cryptodev: clarify error codes returned
> 
> When symmetric sessions are created, it may fail due to non-critical
> errors. When PMD doesn't support the specific combination that
> application requested, it can return -ENOTSUP which can be handled so in
> application. The API is already setting rte_errno according to the
> reason of the failure. Clarifying this in the spec to list down possible
> error codes.
> 
> Fixes: bdce2564dbf7 ("cryptodev: rework session framework")
> 
> Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
  
Akhil Goyal May 24, 2023, 10:59 a.m. UTC | #3
> > Subject: [PATCH] cryptodev: clarify error codes returned
> >
> > When symmetric sessions are created, it may fail due to non-critical
> > errors. When PMD doesn't support the specific combination that
> > application requested, it can return -ENOTSUP which can be handled so in
> > application. The API is already setting rte_errno according to the
> > reason of the failure. Clarifying this in the spec to list down possible
> > error codes.
> >
> > Fixes: bdce2564dbf7 ("cryptodev: rework session framework")
> >
> > Signed-off-by: Anoob Joseph <anoobj@marvell.com>
> Acked-by: Akhil Goyal <gakhil@marvell.com>

Cc: stable@dpdk.org

Applied to dpdk-next-crypto

Thanks
  
Thomas Monjalon June 11, 2023, 10:05 a.m. UTC | #4
24/04/2023 11:19, Anoob Joseph:
> When symmetric sessions are created, it may fail due to non-critical
> errors. When PMD doesn't support the specific combination that
> application requested, it can return -ENOTSUP which can be handled so in
> application. The API is already setting rte_errno according to the
> reason of the failure. Clarifying this in the spec to list down possible
> error codes.
> 
> Fixes: bdce2564dbf7 ("cryptodev: rework session framework")
> 
> Signed-off-by: Anoob Joseph <anoobj@marvell.com>
[...]
>   * @return
>   *  - On success return pointer to sym-session.
> - *  - On failure returns NULL.
> + *  - On failure returns NULL and rte_errno is set to the error code.
> + *     EINVAL on invalid arguments.
> + *     ENOMEM on memory error for session allocation.
> + *     ENOTSUP if device doesn't support session configuration.

If you don't make bullets, all lines are rendered on the same line, without any separator:
"
Returns
        On success return pointer to sym-session.
        On failure returns NULL and rte_errno is set to the error code. EINVAL on invalid arguments. ENOMEM on memory error for session allocation. ENOTSUP if device doesn't support session configuration.
"

In general, you must check the HTML rendering of the doc changes.

I am fixing while pulling.
  

Patch

diff --git a/lib/cryptodev/rte_cryptodev.h b/lib/cryptodev/rte_cryptodev.h
index 3a9ad13660..4e3a7db0fe 100644
--- a/lib/cryptodev/rte_cryptodev.h
+++ b/lib/cryptodev/rte_cryptodev.h
@@ -1048,11 +1048,14 @@  rte_cryptodev_asym_session_pool_create(const char *name, uint32_t nb_elts,
  * @param   dev_id   ID of device that we want the session to be used on
  * @param   xforms   Symmetric crypto transform operations to apply on flow
  *                   processed with this session
- * @param   mp       Mempool where the private data is allocated.
+ * @param   mp       Mempool to allocate symmetric session objects from
  *
  * @return
  *  - On success return pointer to sym-session.
- *  - On failure returns NULL.
+ *  - On failure returns NULL and rte_errno is set to the error code.
+ *     EINVAL on invalid arguments.
+ *     ENOMEM on memory error for session allocation.
+ *     ENOTSUP if device doesn't support session configuration.
  */
 void *
 rte_cryptodev_sym_session_create(uint8_t dev_id,