aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorJanne Peltonen <janne.peltonen@nokia.com>2023-01-04 14:07:56 +0200
committerPetri Savolainen <petri.savolainen@nokia.com>2023-02-13 15:45:20 +0200
commit0a314d35e6c0ae6c60e6c8f819440f4e5c232bb1 (patch)
treee7fd9a282fe005a3b69b9709ff4742931fbad7a0 /include
parentf2131a81ad507d06a5152dc3b6fbeeeb96a98979 (diff)
api: crypto: allow post-processing in odp_crypto_result()
Require that odp_crypto_result() is called before packet data of async processed packets can be assumed to be valid. This makes it possible for an ODP implementation to postpone part of crypto processing to odp_crypto_result() after completion event delivery. For backward compatibility, do not change the semantics of the legacy operation mode. I.e. this change applies only to the newly introduced operation modes. Signed-off-by: Janne Peltonen <janne.peltonen@nokia.com> Reviewed-by: Anoob Joseph <anoobj@marvell.com> Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com>
Diffstat (limited to 'include')
-rw-r--r--include/odp/api/spec/crypto.h12
1 files changed, 8 insertions, 4 deletions
diff --git a/include/odp/api/spec/crypto.h b/include/odp/api/spec/crypto.h
index 05ab514a0..4292b78c1 100644
--- a/include/odp/api/spec/crypto.h
+++ b/include/odp/api/spec/crypto.h
@@ -1,5 +1,5 @@
/* Copyright (c) 2014-2018, Linaro Limited
- * Copyright (c) 2021-2022, Nokia
+ * Copyright (c) 2021-2023, Nokia
* All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
@@ -257,15 +257,15 @@ odp_packet_t odp_crypto_packet_from_event(odp_event_t ev);
odp_event_t odp_crypto_packet_to_event(odp_packet_t pkt);
/**
- * Get crypto operation results from an crypto processed packet
+ * Get crypto operation results from a crypto processed packet
*
* Successful crypto operations of all types (SYNC and ASYNC) produce packets
* which contain crypto result metadata. This function copies the operation
- * results from an crypto processed packet. Event subtype of this kind of
+ * results from a crypto processed packet. Event subtype of this kind of
* packet is ODP_EVENT_PACKET_CRYPTO. Results are undefined if a non-crypto
* processed packet is passed as input.
*
- * @param packet An crypto processed packet (ODP_EVENT_PACKET_CRYPTO)
+ * @param packet A crypto processed packet (ODP_EVENT_PACKET_CRYPTO)
* @param[out] result Pointer to operation result for output
*
* @retval 0 On success
@@ -363,6 +363,10 @@ int odp_crypto_op(const odp_packet_t pkt_in[],
* creation on the packets. Behaves otherwise like odp_crypto_op() but
* returns output packets through events.
*
+ * With operation types other than ODP_CRYPTO_OP_TYPE_LEGACY, packet
+ * data of processed packets may not be valid before odp_crypto_result()
+ * has been called.
+ *
* With ODP_CRYPTO_OP_TYPE_OOP, an enqueued input packet is consumed but
* returned back unmodified after the crypto operation is complete. The
* caller may not access the input packet until getting the handle back