From: Fan Zhang Date: Wed, 16 May 2018 13:10:32 +0000 (+0100) Subject: crypto/scheduler: fix possible duplicated ring names X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=91b9c522d61c752708db7005452ebb4b05baff7a;p=dpdk.git crypto/scheduler: fix possible duplicated ring names This patch fixes the possible duplicated ring names in multi-core scheduler. Originally two or more multi-core schedulers may have same worker ring names thus will cause initialization error. Fixes: 4c07e0552f0a ("crypto/scheduler: add multicore scheduling mode") Cc: stable@dpdk.org Signed-off-by: Fan Zhang Acked-by: Pablo de Lara --- diff --git a/drivers/crypto/scheduler/scheduler_multicore.c b/drivers/crypto/scheduler/scheduler_multicore.c index 555c405c10..b4c29d72f3 100644 --- a/drivers/crypto/scheduler/scheduler_multicore.c +++ b/drivers/crypto/scheduler/scheduler_multicore.c @@ -347,7 +347,8 @@ scheduler_create_private_ctx(struct rte_cryptodev *dev) for (i = 0; i < sched_ctx->nb_wc; i++) { char r_name[16]; - snprintf(r_name, sizeof(r_name), MC_SCHED_ENQ_RING_NAME_PREFIX "%u", i); + snprintf(r_name, sizeof(r_name), MC_SCHED_ENQ_RING_NAME_PREFIX + "%u_%u", dev->data->dev_id, i); mc_ctx->sched_enq_ring[i] = rte_ring_lookup(r_name); if (!mc_ctx->sched_enq_ring[i]) { mc_ctx->sched_enq_ring[i] = rte_ring_create(r_name, @@ -360,7 +361,8 @@ scheduler_create_private_ctx(struct rte_cryptodev *dev) goto exit; } } - snprintf(r_name, sizeof(r_name), MC_SCHED_DEQ_RING_NAME_PREFIX "%u", i); + snprintf(r_name, sizeof(r_name), MC_SCHED_DEQ_RING_NAME_PREFIX + "%u_%u", dev->data->dev_id, i); mc_ctx->sched_deq_ring[i] = rte_ring_lookup(r_name); if (!mc_ctx->sched_deq_ring[i]) { mc_ctx->sched_deq_ring[i] = rte_ring_create(r_name,