aboutsummaryrefslogtreecommitdiff
path: root/platform/linux-dpdk/odp_crypto.c
diff options
context:
space:
mode:
authorJanne Peltonen <janne.peltonen@nokia.com>2021-08-30 12:28:48 +0300
committerMatias Elo <matias.elo@nokia.com>2021-09-01 09:34:52 +0300
commitbe43246b752493f89e6f30a98bd4e0c835aab230 (patch)
treec3f517afb8f450dd1719152484399e460d0f9b99 /platform/linux-dpdk/odp_crypto.c
parentc3765cf9e5f7801e621b3f7e3106c17bbef1cd79 (diff)
Port 35c21145c "linux-gen: crypto: fix error handling in odp_crypto_operation()"
Port original commit from linux-generic. Signed-off-by: Janne Peltonen <janne.peltonen@nokia.com> Reviewed-by: Matias Elo <matias.elo@nokia.com>
Diffstat (limited to 'platform/linux-dpdk/odp_crypto.c')
-rw-r--r--platform/linux-dpdk/odp_crypto.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/platform/linux-dpdk/odp_crypto.c b/platform/linux-dpdk/odp_crypto.c
index 4c86874ea..8ed561534 100644
--- a/platform/linux-dpdk/odp_crypto.c
+++ b/platform/linux-dpdk/odp_crypto.c
@@ -2053,8 +2053,14 @@ int odp_crypto_operation(odp_crypto_op_param_t *param,
return rc;
rc = odp_crypto_result(&packet_result, out_pkt);
- if (rc < 0)
- return rc;
+ if (rc < 0) {
+ /*
+ * We cannot fail since odp_crypto_op() has already processed
+ * the packet. Let's indicate error in the result instead.
+ */
+ packet_hdr(out_pkt)->p.flags.crypto_err = 1;
+ packet_result.ok = false;
+ }
/* Indicate to caller operation was sync */
*posted = 0;