diff options
author | Janne Peltonen <janne.peltonen@nokia.com> | 2023-03-02 21:49:09 +0200 |
---|---|---|
committer | Matias Elo <matias.elo@nokia.com> | 2023-04-12 15:52:37 +0300 |
commit | 18931e32af51d98ec8a5a5b3b50dd4f83cd7a7f9 (patch) | |
tree | 8629d331aa4226638f8e247cb162c5d7796acc29 /platform | |
parent | bd8fd8d73b91293e7f5e00bb015e9fb4deada115 (diff) |
linux-gen: crypto: do not set odp_crypto_packet_result_t::ok
Do not set odp_crypto_packet_result_t::ok unless compiled with
depreated API enabled.
Signed-off-by: Janne Peltonen <janne.peltonen@nokia.com>
Reviewed-by: Anoob Joseph <anoobj@marvell.com>
Diffstat (limited to 'platform')
-rw-r--r-- | platform/linux-generic/arch/aarch64/odp_crypto_armv8.c | 6 | ||||
-rw-r--r-- | platform/linux-generic/include/odp/api/plat/crypto_inlines.h | 14 | ||||
-rw-r--r-- | platform/linux-generic/odp_crypto_ipsecmb.c | 7 | ||||
-rw-r--r-- | platform/linux-generic/odp_crypto_null.c | 5 | ||||
-rw-r--r-- | platform/linux-generic/odp_crypto_openssl.c | 7 |
5 files changed, 12 insertions, 27 deletions
diff --git a/platform/linux-generic/arch/aarch64/odp_crypto_armv8.c b/platform/linux-generic/arch/aarch64/odp_crypto_armv8.c index 1fadec154..9b3c61210 100644 --- a/platform/linux-generic/arch/aarch64/odp_crypto_armv8.c +++ b/platform/linux-generic/arch/aarch64/odp_crypto_armv8.c @@ -182,12 +182,6 @@ static inline void set_crypto_op_result(odp_packet_t pkt, op_result = &packet_hdr(pkt)->crypto_op_result; op_result->cipher_status.alg_err = cipher_err; op_result->auth_status.alg_err = auth_err; -#if ODP_DEPRECATED_API - op_result->cipher_status.hw_err = ODP_CRYPTO_HW_ERR_NONE; - op_result->auth_status.hw_err = ODP_CRYPTO_HW_ERR_NONE; -#endif - op_result->ok = (cipher_err == ODP_CRYPTO_ALG_ERR_NONE && - auth_err == ODP_CRYPTO_ALG_ERR_NONE); } static inline void set_crypto_op_result_ok(odp_packet_t pkt) diff --git a/platform/linux-generic/include/odp/api/plat/crypto_inlines.h b/platform/linux-generic/include/odp/api/plat/crypto_inlines.h index 4f7a3a31e..ddf7debf4 100644 --- a/platform/linux-generic/include/odp/api/plat/crypto_inlines.h +++ b/platform/linux-generic/include/odp/api/plat/crypto_inlines.h @@ -46,15 +46,25 @@ _ODP_INLINE odp_event_t odp_crypto_packet_to_event(odp_packet_t pkt) _ODP_INLINE int odp_crypto_result(odp_crypto_packet_result_t *result, odp_packet_t pkt) { odp_crypto_packet_result_t *op_result; + odp_bool_t ok; _ODP_ASSERT(odp_packet_subtype(pkt) == ODP_EVENT_PACKET_CRYPTO); op_result = _odp_pkt_get_ptr(pkt, odp_crypto_packet_result_t, crypto_op); - if (result) + ok = op_result->cipher_status.alg_err == ODP_CRYPTO_ALG_ERR_NONE && + op_result->auth_status.alg_err == ODP_CRYPTO_ALG_ERR_NONE; + + if (result) { *result = *op_result; +#if ODP_DEPRECATED_API + result->ok = ok; + result->cipher_status.hw_err = ODP_CRYPTO_HW_ERR_NONE; + result->auth_status.hw_err = ODP_CRYPTO_HW_ERR_NONE; +#endif + } - return op_result->ok ? 0 : -1; + return ok ? 0 : -1; } /** @endcond */ diff --git a/platform/linux-generic/odp_crypto_ipsecmb.c b/platform/linux-generic/odp_crypto_ipsecmb.c index 1454bef4f..6532d5861 100644 --- a/platform/linux-generic/odp_crypto_ipsecmb.c +++ b/platform/linux-generic/odp_crypto_ipsecmb.c @@ -914,13 +914,6 @@ int crypto_int(odp_packet_t pkt_in, op_result = &packet_hdr(out_pkt)->crypto_op_result; op_result->cipher_status.alg_err = rc_cipher; op_result->auth_status.alg_err = rc_auth; -#if ODP_DEPRECATED_API - op_result->cipher_status.hw_err = ODP_CRYPTO_HW_ERR_NONE; - op_result->auth_status.hw_err = ODP_CRYPTO_HW_ERR_NONE; -#endif - op_result->ok = - (rc_cipher == ODP_CRYPTO_ALG_ERR_NONE) && - (rc_auth == ODP_CRYPTO_ALG_ERR_NONE); /* Synchronous, simply return results */ *pkt_out = out_pkt; diff --git a/platform/linux-generic/odp_crypto_null.c b/platform/linux-generic/odp_crypto_null.c index 5faaaeb27..6680a760b 100644 --- a/platform/linux-generic/odp_crypto_null.c +++ b/platform/linux-generic/odp_crypto_null.c @@ -535,11 +535,6 @@ int crypto_int(odp_packet_t pkt_in, op_result = &packet_hdr(out_pkt)->crypto_op_result; op_result->cipher_status.alg_err = ODP_CRYPTO_ALG_ERR_NONE; op_result->auth_status.alg_err = ODP_CRYPTO_ALG_ERR_NONE; -#if ODP_DEPRECATED_API - op_result->cipher_status.hw_err = ODP_CRYPTO_HW_ERR_NONE; - op_result->auth_status.hw_err = ODP_CRYPTO_HW_ERR_NONE; -#endif - op_result->ok = true; /* Synchronous, simply return results */ *pkt_out = out_pkt; diff --git a/platform/linux-generic/odp_crypto_openssl.c b/platform/linux-generic/odp_crypto_openssl.c index 2d9b69f5a..c1b250b18 100644 --- a/platform/linux-generic/odp_crypto_openssl.c +++ b/platform/linux-generic/odp_crypto_openssl.c @@ -2713,13 +2713,6 @@ out: op_result = &packet_hdr(out_pkt)->crypto_op_result; op_result->cipher_status.alg_err = rc_cipher; op_result->auth_status.alg_err = rc_auth; -#if ODP_DEPRECATED_API - op_result->cipher_status.hw_err = ODP_CRYPTO_HW_ERR_NONE; - op_result->auth_status.hw_err = ODP_CRYPTO_HW_ERR_NONE; -#endif - op_result->ok = - (rc_cipher == ODP_CRYPTO_ALG_ERR_NONE) && - (rc_auth == ODP_CRYPTO_ALG_ERR_NONE); /* Synchronous, simply return results */ *pkt_out = out_pkt; |