From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id EC7021C741; Mon, 14 May 2018 12:16:33 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 14 May 2018 03:16:31 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,399,1520924400"; d="scan'208";a="40755630" Received: from silpixa00398673.ir.intel.com (HELO silpixa00398673.ger.corp.intel.com) ([10.237.223.54]) by orsmga007.jf.intel.com with ESMTP; 14 May 2018 03:16:30 -0700 From: Fan Zhang To: dev@dpdk.org Cc: roy.fan.zhang@intel.com, kirill.rybalchenko@intel.com, stable@dpdk.org, pablo.de.lara.guarch@intel.com Date: Mon, 14 May 2018 11:09:27 +0100 Message-Id: <20180514100927.78088-1-roy.fan.zhang@intel.com> X-Mailer: git-send-email 2.13.6 Subject: [dpdk-dev] [PATCH] crypto/scheduler: fix possible duplicated ring names X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 May 2018 10:16:34 -0000 Fixes: 4c07e0552f0a ("crypto/scheduler: add multicore scheduling mode") 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. Signed-off-by: Fan Zhang --- drivers/crypto/scheduler/scheduler_multicore.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/crypto/scheduler/scheduler_multicore.c b/drivers/crypto/scheduler/scheduler_multicore.c index 644426e93..cd71d18ee 100644 --- a/drivers/crypto/scheduler/scheduler_multicore.c +++ b/drivers/crypto/scheduler/scheduler_multicore.c @@ -347,14 +347,18 @@ 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", + sched_ctx->wc_pool[i]); mc_ctx->sched_enq_ring[i] = rte_ring_create(r_name, PER_SLAVE_BUFF_SIZE, rte_socket_id(), RING_F_SC_DEQ | RING_F_SP_ENQ); if (!mc_ctx->sched_enq_ring[i]) { CS_LOG_ERR("Cannot create ring for worker %u", i); 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", + sched_ctx->wc_pool[i]); mc_ctx->sched_deq_ring[i] = rte_ring_create(r_name, PER_SLAVE_BUFF_SIZE, rte_socket_id(), RING_F_SC_DEQ | RING_F_SP_ENQ); if (!mc_ctx->sched_deq_ring[i]) { -- 2.13.6