Skip to contentSkip to conversation

crypto/scheduler: fix possible duplicated ring names

PATCH Applied Fan Zhang 2 participants 3 messages May 16, 2018 – May 17, 2018 Crypto API

lore
Share & tools
lore

Fan Zhang

author
#0 lore raw

PATCH v2 1/1 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")

---
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(-)
drivers/crypto/scheduler/scheduler_multicore.c +4 -2
index 644426e93..d49e53681 100644
@@ -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]) {
Signature · 1 line
2.13.6
Acked-by on v2 1/1
#1 lore raw
Quoted 11 lines

-----Original Message-----
From: Zhang, Roy Fan
Sent: Wednesday, May 16, 2018 2:11 PM
To: [email protected]
Cc: Zhang, Roy Fan <[email protected]>; Rybalchenko, Kirill <[email protected]>; [email protected]; De Lara Guarch, Pablo <[email protected]>
Subject: [PATCH v2] crypto/scheduler: fix possible duplicated ring names

Quoted 7 lines

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")
#2 lore raw
Quoted 29 lines

-----Original Message-----
From: stable [mailto:[email protected]] On Behalf Of De Lara Guarch, Pablo
Sent: Wednesday, May 16, 2018 2:56 PM
To: Zhang, Roy Fan <[email protected]>; [email protected]
Cc: Rybalchenko, Kirill <[email protected]>; [email protected]
Subject: Re: [dpdk-stable] [PATCH v2] crypto/scheduler: fix possible duplicated ring names

Quoted 16 lines

-----Original Message-----
From: Zhang, Roy Fan
Sent: Wednesday, May 16, 2018 2:11 PM
To: [email protected]
Cc: Zhang, Roy Fan <[email protected]>; Rybalchenko, Kirill <[email protected]>; [email protected]; De Lara Guarch, Pablo <[email protected]>
Subject: [PATCH v2] 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")

Added Cc: [email protected]

Quoted 4 lines
Quoted 2 lines

Applied to dpdk-next-crypto.
Thanks,

Pablo