From 91b9c522d61c752708db7005452ebb4b05baff7a Mon Sep 17 00:00:00 2001 From: Fan Zhang Date: Wed, 16 May 2018 14:10:32 +0100 Subject: [PATCH] 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 --- drivers/crypto/scheduler/scheduler_multicore.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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, -- 2.20.1