]> git.droids-corp.org - dpdk.git/blobdiff - drivers/crypto/scheduler/scheduler_pmd_ops.c
crypto/scheduler: fix queue pair configuration
[dpdk.git] / drivers / crypto / scheduler / scheduler_pmd_ops.c
index 34e0cc921d0f47848d0b25f841ef6c81d8a5d684..725ba9dcda85afc7198ea08c903556fd1b44fca8 100644 (file)
@@ -367,14 +367,15 @@ scheduler_pmd_qp_setup(struct rte_cryptodev *dev, uint16_t qp_id,
                        return ret;
        }
 
-       sched_ctx->qp_conf.nb_descriptors = qp_conf->nb_descriptors;
-
        /* Allocate the queue pair data structure. */
        qp_ctx = rte_zmalloc_socket(name, sizeof(*qp_ctx), RTE_CACHE_LINE_SIZE,
                        socket_id);
        if (qp_ctx == NULL)
                return -ENOMEM;
 
+       /* The actual available object number = nb_descriptors - 1 */
+       qp_ctx->max_nb_objs = qp_conf->nb_descriptors - 1;
+
        dev->data->queue_pairs[qp_id] = qp_ctx;
 
        if (*sched_ctx->ops.config_queue_pair) {