X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;ds=sidebyside;f=lib%2Flibrte_cryptodev%2Frte_cryptodev_pmd.h;h=defe05ea058eaeac6548149187d27ec1397b03e5;hb=7c7b7562252742a6c298de64df486873336fd058;hp=6ff49d64d8defebd150ce00a453ab5f124b9614d;hpb=f8e9989606e7a9548a25ac10e2daae4c8af230cb;p=dpdk.git diff --git a/lib/librte_cryptodev/rte_cryptodev_pmd.h b/lib/librte_cryptodev/rte_cryptodev_pmd.h index 6ff49d64d8..defe05ea05 100644 --- a/lib/librte_cryptodev/rte_cryptodev_pmd.h +++ b/lib/librte_cryptodev/rte_cryptodev_pmd.h @@ -71,9 +71,6 @@ struct cryptodev_driver { uint8_t id; }; -/** pointer to global crypto devices data structure. */ -extern struct rte_cryptodev_global *rte_cryptodev_globals; - /** * Get the rte_cryptodev structure device pointer for the device. Assumes a * valid device index. @@ -191,13 +188,12 @@ typedef void (*cryptodev_info_get_t)(struct rte_cryptodev *dev, * @param qp_id Queue Pair Index * @param qp_conf Queue configuration structure * @param socket_id Socket Index - * @param session_pool Pointer to device session mempool * * @return Returns 0 on success. */ typedef int (*cryptodev_queue_pair_setup_t)(struct rte_cryptodev *dev, uint16_t qp_id, const struct rte_cryptodev_qp_conf *qp_conf, - int socket_id, struct rte_mempool *session_pool); + int socket_id); /** * Release memory resources allocated by given queue pair. @@ -479,14 +475,23 @@ RTE_INIT(init_ ##driver_id)\ static inline void * get_sym_session_private_data(const struct rte_cryptodev_sym_session *sess, uint8_t driver_id) { - return sess->sess_private_data[driver_id]; + if (unlikely(sess->nb_drivers <= driver_id)) + return NULL; + + return sess->sess_data[driver_id].data; } static inline void set_sym_session_private_data(struct rte_cryptodev_sym_session *sess, uint8_t driver_id, void *private_data) { - sess->sess_private_data[driver_id] = private_data; + if (unlikely(sess->nb_drivers <= driver_id)) { + CDEV_LOG_ERR("Set private data for driver %u not allowed\n", + driver_id); + return; + } + + sess->sess_data[driver_id].data = private_data; } static inline void *