Skip to contentSkip to conversation

cryptodev: clarify error codes returned

PATCH Applied Anoob Joseph 4 participants 5 messages Apr 24, 2023 – Jun 11, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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")
---
 lib/cryptodev/rte_cryptodev.h | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
lib/cryptodev/rte_cryptodev.h +5 -2
index 3a9ad13660..4e3a7db0fe 100644
@@ -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,
Signature · 1 line
2.25.1
Acked-by on v1 1/1
#1 lore raw

Hi Anoob,

Quoted 14 lines

-----Original Message-----
From: Anoob Joseph <[email protected]>
Sent: Monday 24 April 2023 10:19
To: Akhil Goyal <[email protected]>; Fan Zhang <[email protected]>
Cc: Jerin Jacob <[email protected]>; [email protected]
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.

Quoted 6 lines
Fixes bdce2564dbf7 ("cryptodev: rework session framework")
---
 lib/cryptodev/rte_cryptodev.h | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
Acked-by on v1 1/1
#2 lore raw
In reply to Anoob Joseph
Quoted 9 lines

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.

Quoted 3 lines
Fixes bdce2564dbf7 ("cryptodev: rework session framework")
Applied
#3 lore raw
Quoted 9 lines
Quoted 9 lines

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.

Quoted 4 lines
Quoted 3 lines
Fixes bdce2564dbf7 ("cryptodev: rework session framework")

Applied to dpdk-next-crypto

Thanks

#4 lore raw
In reply to Anoob Joseph

24/04/2023 11:19, Anoob Joseph:

Quoted 10 lines

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")

[...]

Quoted 7 lines

* @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.