X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=lib%2Flibrte_cryptodev%2Frte_cryptodev.c;h=33ced00e475427d1e65d6254a91455ba43569d8a;hb=21b6a35171cc5b1ea22f65a34ce8c74666c4e664;hp=9ea4ece65e6e780688a6759ca13422bad0ef3059;hpb=12e4f2b7197d54fe358c98f633b9c4fdacfaa67e;p=dpdk.git diff --git a/lib/librte_cryptodev/rte_cryptodev.c b/lib/librte_cryptodev/rte_cryptodev.c index 9ea4ece65e..33ced00e47 100644 --- a/lib/librte_cryptodev/rte_cryptodev.c +++ b/lib/librte_cryptodev/rte_cryptodev.c @@ -1079,6 +1079,35 @@ rte_cryptodev_close(uint8_t dev_id) return 0; } +int +rte_cryptodev_get_qp_status(uint8_t dev_id, uint16_t queue_pair_id) +{ + struct rte_cryptodev *dev; + + if (!rte_cryptodev_pmd_is_valid_dev(dev_id)) { + CDEV_LOG_ERR("Invalid dev_id=%" PRIu8, dev_id); + return -EINVAL; + } + + dev = &rte_crypto_devices[dev_id]; + if (queue_pair_id >= dev->data->nb_queue_pairs) { + CDEV_LOG_ERR("Invalid queue_pair_id=%d", queue_pair_id); + return -EINVAL; + } + void **qps = dev->data->queue_pairs; + + if (qps[queue_pair_id]) { + CDEV_LOG_DEBUG("qp %d on dev %d is initialised", + queue_pair_id, dev_id); + return 1; + } + + CDEV_LOG_DEBUG("qp %d on dev %d is not initialised", + queue_pair_id, dev_id); + + return 0; +} + 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)