From: Fan Zhang Date: Thu, 9 Feb 2017 18:49:59 +0000 (+0000) Subject: crypto/scheduler: fix initialization X-Git-Tag: spdx-start~4500 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=f106eb44c0e50e0113a7da3da02cb196a09f3f3c;p=dpdk.git crypto/scheduler: fix initialization Fixes the wrong slave initialization issue on start-up Fixes: 100e4f7e44ab ("crypto/scheduler: add round-robin mode") Signed-off-by: Fan Zhang Acked-by: Pablo de Lara --- diff --git a/drivers/crypto/scheduler/scheduler_roundrobin.c b/drivers/crypto/scheduler/scheduler_roundrobin.c index 7abdd29d72..1f5448e900 100644 --- a/drivers/crypto/scheduler/scheduler_roundrobin.c +++ b/drivers/crypto/scheduler/scheduler_roundrobin.c @@ -350,7 +350,6 @@ static int scheduler_start(struct rte_cryptodev *dev) { struct scheduler_ctx *sched_ctx = dev->data->dev_private; - uint16_t i; for (i = 0; i < dev->data->nb_queue_pairs; i++) { @@ -358,14 +357,13 @@ scheduler_start(struct rte_cryptodev *dev) struct rr_scheduler_qp_ctx *rr_qp_ctx = qp_ctx->private_qp_ctx; uint32_t j; - uint16_t qp_id = rr_qp_ctx->slaves[0].qp_id; memset(rr_qp_ctx->slaves, 0, MAX_SLAVES_NUM * sizeof(struct scheduler_slave)); for (j = 0; j < sched_ctx->nb_slaves; j++) { rr_qp_ctx->slaves[j].dev_id = - sched_ctx->slaves[i].dev_id; - rr_qp_ctx->slaves[j].qp_id = qp_id; + sched_ctx->slaves[j].dev_id; + rr_qp_ctx->slaves[j].qp_id = i; } rr_qp_ctx->nb_slaves = sched_ctx->nb_slaves;