#include "rte_kvargs.h"
#include "rte_crypto.h"
-#include "rte_dev.h"
#include <rte_common.h>
-#include <rte_config.h>
#include <rte_rcu_qsbr.h>
#include "rte_cryptodev_trace_fp.h"
/**< Transform type: RSA/MODEXP/DH/DSA/MODINV */
uint32_t op_types;
- /**< bitmask for supported rte_crypto_asym_op_type */
+ /**<
+ * Bitmask for supported rte_crypto_asym_op_type or
+ * rte_crypto_asym_ke_type. Which enum is used is determined
+ * by the rte_crypto_asym_xform_type. For key exchange algorithms
+ * like Diffie-Hellman it is rte_crypto_asym_ke_type, for others
+ * it is rte_crypto_asym_op_type.
+ */
__extension__
union {
* processed with this session
* @param mp mempool to allocate asymmetric session
* objects from
+ * @param session void ** for session to be used
+ *
* @return
- * - On success return pointer to asym-session
- * - On failure returns NULL
+ * - 0 on success.
+ * - -EINVAL on invalid arguments.
+ * - -ENOMEM on memory error for session allocation.
+ * - -ENOTSUP if device doesn't support session configuration.
*/
__rte_experimental
-void *
+int
rte_cryptodev_asym_session_create(uint8_t dev_id,
- struct rte_crypto_asym_xform *xforms, struct rte_mempool *mp);
+ struct rte_crypto_asym_xform *xforms, struct rte_mempool *mp,
+ void **session);
/**
* Frees symmetric crypto session header, after checking that all
int
rte_cryptodev_get_raw_dp_ctx_size(uint8_t dev_id);
+/**
+ * Set session event meta data
+ *
+ * @param dev_id The device identifier.
+ * @param sess Crypto or security session.
+ * @param op_type Operation type.
+ * @param sess_type Session type.
+ * @param ev_mdata Pointer to the event crypto meta data
+ * (aka *union rte_event_crypto_metadata*)
+ * @param size Size of ev_mdata.
+ *
+ * @return
+ * - On success, zero.
+ * - On failure, a negative value.
+ */
+__rte_experimental
+int
+rte_cryptodev_session_event_mdata_set(uint8_t dev_id, void *sess,
+ enum rte_crypto_op_type op_type,
+ enum rte_crypto_op_sess_type sess_type,
+ void *ev_mdata, uint16_t size);
+
/**
* Union of different crypto session types, including session-less xform
* pointer.