X-Git-Url: http://git.droids-corp.org/?p=dpdk.git;a=blobdiff_plain;f=lib%2Flibrte_cryptodev%2Frte_cryptodev.c;h=4929d045101af6a87864e702a9453e8381a6660d;hp=a52eaaa451000bc6467003cf44b982e7a6c1fc26;hb=725d2a7fbf717d9a6189ac9b49bad2b4f5391a60;hpb=11fdbf1b78660e058a059b02504065935b9ff730 diff --git a/lib/librte_cryptodev/rte_cryptodev.c b/lib/librte_cryptodev/rte_cryptodev.c index a52eaaa451..4929d04510 100644 --- a/lib/librte_cryptodev/rte_cryptodev.c +++ b/lib/librte_cryptodev/rte_cryptodev.c @@ -941,8 +941,7 @@ rte_cryptodev_close(uint8_t dev_id) int rte_cryptodev_queue_pair_setup(uint8_t dev_id, uint16_t queue_pair_id, - const struct rte_cryptodev_qp_conf *qp_conf, int socket_id, - struct rte_mempool *session_pool) + const struct rte_cryptodev_qp_conf *qp_conf, int socket_id) { struct rte_cryptodev *dev; @@ -958,6 +957,17 @@ rte_cryptodev_queue_pair_setup(uint8_t dev_id, uint16_t queue_pair_id, return -EINVAL; } + if (!qp_conf) { + CDEV_LOG_ERR("qp_conf cannot be NULL\n"); + return -EINVAL; + } + + if ((qp_conf->mp_session && !qp_conf->mp_session_private) || + (!qp_conf->mp_session && qp_conf->mp_session_private)) { + CDEV_LOG_ERR("Invalid mempools\n"); + return -EINVAL; + } + if (dev->data->dev_started) { CDEV_LOG_ERR( "device %d must be stopped to allow configuration", dev_id); @@ -967,7 +977,7 @@ rte_cryptodev_queue_pair_setup(uint8_t dev_id, uint16_t queue_pair_id, RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->queue_pair_setup, -ENOTSUP); return (*dev->dev_ops->queue_pair_setup)(dev, queue_pair_id, qp_conf, - socket_id, session_pool); + socket_id); }