DPDK patches and discussions
 help / color / mirror / Atom feed
From: Fan Zhang <roy.fan.zhang@intel.com>
To: dev@dpdk.org
Cc: roy.fan.zhang@intel.com, kirill.rybalchenko@intel.com,
	stable@dpdk.org, pablo.de.lara.guarch@intel.com
Subject: [dpdk-dev] [PATCH v2] crypto/scheduler: fix possible duplicated ring names
Date: Wed, 16 May 2018 14:10:32 +0100	[thread overview]
Message-ID: <20180516131032.77082-1-roy.fan.zhang@intel.com> (raw)

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")

Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
---
v2:
- changed fix line location
- used device id and index to generate unique pool name

 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 644426e93..d49e53681 100644
--- a/drivers/crypto/scheduler/scheduler_multicore.c
+++ b/drivers/crypto/scheduler/scheduler_multicore.c
@@ -347,14 +347,16 @@ 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_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_%u", dev->data->dev_id, 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

             reply	other threads:[~2018-05-16 13:17 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-16 13:10 Fan Zhang [this message]
2018-05-16 13:56 ` De Lara Guarch, Pablo
2018-05-17 16:15   ` [dpdk-dev] [dpdk-stable] " De Lara Guarch, Pablo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180516131032.77082-1-roy.fan.zhang@intel.com \
    --to=roy.fan.zhang@intel.com \
    --cc=dev@dpdk.org \
    --cc=kirill.rybalchenko@intel.com \
    --cc=pablo.de.lara.guarch@intel.com \
    --cc=stable@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).