X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=lib%2Fcryptodev%2Frte_cryptodev.h;h=585cee272781aaeadd7dfc80d73652aa58415fa1;hb=77dd857d306f6b71eb93935ce1a01197156b5428;hp=1d7bd076800d3edeca18e75c9e5b200c39a1b29d;hpb=92d55afe0ffa8e98cee454fa2c6f60c6bec81f04;p=dpdk.git diff --git a/lib/cryptodev/rte_cryptodev.h b/lib/cryptodev/rte_cryptodev.h index 1d7bd07680..585cee2727 100644 --- a/lib/cryptodev/rte_cryptodev.h +++ b/lib/cryptodev/rte_cryptodev.h @@ -20,9 +20,7 @@ extern "C" { #include "rte_kvargs.h" #include "rte_crypto.h" -#include "rte_dev.h" #include -#include #include #include "rte_cryptodev_trace_fp.h" @@ -170,7 +168,13 @@ struct rte_cryptodev_asymmetric_xform_capability { /**< 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 { @@ -996,14 +1000,19 @@ rte_cryptodev_sym_session_create(struct rte_mempool *mempool); * 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 @@ -1266,6 +1275,28 @@ __rte_experimental 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.