crypto/scheduler: fix multicore rings re-use
PATCH 1/1 crypto/scheduler: fix multicore rings re-use
When scheduler mode changed from multicore to roundrobin and back to multicore, scheduler tries to create memory rings with the same name and fails. The fix allows to lookup and re-use previously allocated memory rings.
--- drivers/crypto/scheduler/scheduler_multicore.c | 28 ++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-)
drivers/crypto/scheduler/scheduler_multicore.c +20 -8
@@ -346,18 +346,30 @@ scheduler_create_private_ctx(struct rte_cryptodev *dev)char r_name[16 ];snprintf (r_name,sizeof (r_name),MC_SCHED_ENQ_RING_NAME_PREFIX "%u" , 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 ); + mc_ctx->sched_enq_ring[i] =rte_ring_lookup (r_name);if (!mc_ctx->sched_enq_ring[i]) { -CS_LOG_ERR ("Cannot create ring for worker %u" , i); -return -1 ; + 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); +return -1 ; + } }snprintf (r_name,sizeof (r_name),MC_SCHED_DEQ_RING_NAME_PREFIX "%u" , 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 ); + mc_ctx->sched_deq_ring[i] =rte_ring_lookup (r_name);if (!mc_ctx->sched_deq_ring[i]) { -CS_LOG_ERR ("Cannot create ring for worker %u" , i); -return -1 ; + 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]) { +CS_LOG_ERR ("Cannot create ring for worker %u" , + i); +return -1 ; + } } }
Signature · 1 line
2.5.5
Thanks a lot!
Quoted 8 lines
-----Original Message-----
From: Rybalchenko, Kirill
Sent: Monday, May 14, 2018 7:53 AM
To: [email protected]
Cc: [email protected]; Rybalchenko, Kirill <[email protected]>; Zhang, Roy Fan <[email protected]>
Subject: [PATCH]crypto/scheduler: fix multicore rings re-use
Quoted 8 lines
When scheduler mode changed from multicore to roundrobin and back to multicore, scheduler tries to create memory rings with the same name and fails. The fix allows to lookup and re-use previously allocated memory rings.
Fixes 4c07e0552f0a ("crypto/scheduler: add multicore scheduling mode")Signed-off-by Kirill Rybalchenko <[email protected]>
Quoted 10 lines
-----Original Message-----
From: stable [mailto:[email protected]] On Behalf Of Kirill Rybalchenko
Sent: Monday, May 14, 2018 7:53 AM
To: [email protected]
Cc: [email protected]; Rybalchenko, Kirill <[email protected]>; Zhang, Roy Fan <[email protected]>
Subject: [dpdk-stable] [PATCH]crypto/scheduler: fix multicore rings re-use
Quoted 7 lines
When scheduler mode changed from multicore to roundrobin and back to multicore, scheduler tries to create memory rings with the same name and fails. The fix allows to lookup and re-use previously allocated memory rings.
Fixes 4c07e0552f0a ("crypto/scheduler: add multicore scheduling mode")Signed-off-by Kirill Rybalchenko <[email protected]>
Missing Cc: [email protected] in commit message.
Hi Kirill
Not able to apply this patch cleanly either on dpdk.org or crypto next tree. Can you check if you have to rebase it?
Thanks,
Reshma
PATCH v2 1/1 crypto/scheduler: fix multicore rings re-use
In reply to Kirill RybalchenkoWhen scheduler mode changed from multicore to roundrobin and back to multicore, scheduler tries to create memory rings with the same name and fails. The fix allows to lookup and re-use previously allocated memory rings.
v2:
Rebase to head of dpdk-dev master branch
--- drivers/crypto/scheduler/scheduler_multicore.c | 28 ++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-)
drivers/crypto/scheduler/scheduler_multicore.c +20 -8
@@ -348,18 +348,30 @@ scheduler_create_private_ctx(struct rte_cryptodev *dev)char r_name[16 ];snprintf (r_name,sizeof (r_name),MC_SCHED_ENQ_RING_NAME_PREFIX "%u" , 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 ); + mc_ctx->sched_enq_ring[i] =rte_ring_lookup (r_name);if (!mc_ctx->sched_enq_ring[i]) { -CS_LOG_ERR ("Cannot create ring for worker %u" , i); - goto exit; + 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); - 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 ); + mc_ctx->sched_deq_ring[i] =rte_ring_lookup (r_name);if (!mc_ctx->sched_deq_ring[i]) { -CS_LOG_ERR ("Cannot create ring for worker %u" , i); - goto exit; + 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]) { +CS_LOG_ERR ("Cannot create ring for worker %u" , + i); + goto exit; + } } }
Signature · 1 line
2.5.5
Quoted 14 lines
-----Original Message-----
From: stable [mailto:[email protected]] On Behalf Of Kirill Rybalchenko
Sent: Wednesday, May 16, 2018 3:25 PM
To: [email protected]
Cc: [email protected]; Rybalchenko, Kirill <[email protected]>; Zhang, Roy Fan <[email protected]>
Subject: [dpdk-stable] [PATCH v2]crypto/scheduler: fix multicore rings re-useWhen scheduler mode changed from multicore to roundrobin and back to multicore, scheduler tries to create memory rings with the same name and fails. The fix allows to lookup and re-use previously allocated memory rings.
Quoted 5 lines
Fixes 4c07e0552f0a ("crypto/scheduler: add multicore scheduling mode")v2:
Rebase to head of dpdk-dev master branch
The changelog should go after the three dashes, so it is not a part of the commit when merged.
Quoted 2 lines
Signed-off-by Kirill Rybalchenko <[email protected]>
You forgot to include the two previous acks (if you send another revision, add them).
Pablo
Hi,
Quoted 12 lines
-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of Kirill Rybalchenko
Sent: Wednesday, May 16, 2018 3:25 PM
To: [email protected]
Cc: [email protected]; Rybalchenko, Kirill <[email protected]>; Zhang, Roy Fan <[email protected]>
Subject: [dpdk-dev] [PATCH v2]crypto/scheduler: fix multicore rings re-useWhen scheduler mode changed from multicore to roundrobin and back to multicore, scheduler tries to create memory rings with the same name and fails. The fix allows to lookup and re-use previously allocated memory rings.
Quoted 7 lines
Fixes 4c07e0552f0a ("crypto/scheduler: add multicore scheduling mode")v2:
Rebase to head of dpdk-dev master branchSigned-off-by Kirill Rybalchenko <[email protected]>
De Lara Guarch, Pablo
AppliedQuoted 24 lines
-----Original Message-----
From: stable [mailto:[email protected]] On Behalf Of Pattan, Reshma
Sent: Thursday, May 17, 2018 12:24 PM
To: Rybalchenko, Kirill <[email protected]>; [email protected]
Cc: [email protected]; Rybalchenko, Kirill <[email protected]>; Zhang, Roy Fan <[email protected]>
Subject: Re: [dpdk-stable] [dpdk-dev] [PATCH v2]crypto/scheduler: fix multicore rings re-useHi,
Quoted 11 lines
-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of Kirill Rybalchenko
Sent: Wednesday, May 16, 2018 3:25 PM
To: [email protected]
Cc: [email protected]; Rybalchenko, Kirill <[email protected]>; Zhang, Roy Fan <[email protected]>
Subject: [dpdk-dev] [PATCH v2]crypto/scheduler: fix multicore rings re-use
Quoted 11 lines
Quoted 3 lines
When scheduler mode changed from multicore to roundrobin and back to multicore, scheduler tries to create memory rings with the same name and fails. The fix allows to lookup and re-use previously allocated memory
rings.
Quoted 7 lines
Fixes 4c07e0552f0a ("crypto/scheduler: add multicore schedulingmode")
Cc: [email protected]v2:
Rebase to head of dpdk-dev master branch
Removed this changelog.
Quoted 4 lines
Quoted 2 lines
Signed-off-by Kirill Rybalchenko <[email protected]>Tested-by Reshma Pattan <[email protected]>
Applied to dpdk-next-crypto.
Thanks,
Pablo