Skip to contentSkip to conversation

lib/ring: fix the bug of HTS/RTS bulk enqueue

PATCH In review Feifei Wang 3 participants 5 messages Jun 10, 2020 – Jun 12, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 lib/ring: fix the bug of HTS/RTS bulk enqueue

Directly call "_rte_ring_do_enqueue_elem" function can result in the process skips the "switch" order and cannot call the APIs of RTS and HTS mode in "rte_ring_enqueue_bulk_elem" function.

To fix it, remove the unnecessary function and make "_rte_ring_do_enqueue_elem" consistent with "_rte_ring_do_dequeue_elem".

Fixes e6ba4731c0f3 ("ring: introduce RTS ring mode")
---
 lib/librte_ring/rte_ring_elem.h | 3 ---
 1 file changed, 3 deletions(-)
lib/librte_ring/rte_ring_elem.h +0 -3
index a5a4c46f9..469aee7da 100644
@@ -578,9 +578,6 @@ static __rte_always_inline unsigned int
 rte_ring_enqueue_bulk_elem(struct rte_ring *r, const void *obj_table,
 		unsigned int esize, unsigned int n, unsigned int *free_space)
 {
-	return __rte_ring_do_enqueue_elem(r, obj_table, esize, n,
-			RTE_RING_QUEUE_FIXED, r->prod.sync_type, free_space);
-
 	switch (r->prod.sync_type) {
 	case RTE_RING_SYNC_MT:
 		return rte_ring_mp_enqueue_bulk_elem(r, obj_table, esize, n,
Signature · 1 line
2.17.1
Acked-by on v1 1/1
#1 lore raw

Hi Feifei,
Thanks for the patch. Few nits inline.

Quoted 9 lines

-----Original Message-----
From: Feifei Wang <[email protected]>
Sent: Tuesday, June 9, 2020 10:39 PM
To: Honnappa Nagarahalli <[email protected]>; Konstantin Ananyev <[email protected]>
Cc: [email protected]; nd <[email protected]>; Feifei Wang <[email protected]>; [email protected]
Subject: [PATCH] lib/ring: fix the bug of HTS/RTS bulk enqueue

Quoted 3 lines

Directly call "_rte_ring_do_enqueue_elem" function can result in the process skips the "switch" order and cannot call the APIs of RTS and HTS mode in "rte_ring_enqueue_bulk_elem" function.

may be " lib/ring: fix bulk enqueue API to allow HTS/RTS modes"?

Quoted 4 lines

To fix it, remove the unnecessary function and make "_rte_ring_do_enqueue_elem" consistent with "_rte_ring_do_dequeue_elem".

How about something like:
Remove the unwanted call to "_rte_ring_do_enqueue_elem" to allow for correct handling of RTS/HTS modes.

Quoted 15 lines
Fixes e6ba4731c0f3 ("ring: introduce RTS ring mode")
---
 lib/librte_ring/rte_ring_elem.h | 3 ---
 1 file changed, 3 deletions(-)
lib/librte_ring/rte_ring_elem.h +0 -0
index a5a4c46f9..469aee7da 100644

lib/librte_ring/rte_ring_elem.h static __rte_always_inline unsigned int · line 583

Quoted 9 lines
lib/librte_ring/rte_ring_elem.h +0 -3
@@ -578,9 +578,6 @@ static __rte_always_inline unsigned int
 rte_ring_enqueue_bulk_elem(struct rte_ring *r, const void *obj_table,
 		unsigned int esize, unsigned int n, unsigned int *free_space)  {
-	return __rte_ring_do_enqueue_elem(r, obj_table, esize, n,
-			RTE_RING_QUEUE_FIXED, r->prod.sync_type,
 free_space);
-
 	switch (r->prod.sync_type) {
 	case RTE_RING_SYNC_MT:
 		return rte_ring_mp_enqueue_bulk_elem(r, obj_table, esize, n,

Otherwise,

Quoted 2 lines

--
2.17.1

#2 lore raw
Quoted 30 lines

-----邮件原件-----
发件人: Honnappa Nagarahalli <[email protected]> 发送时间: 2020年6月10日 11:57
收件人: Feifei Wang <[email protected]>; Konstantin Ananyev <[email protected]>
抄送: [email protected]; nd <[email protected]>; Feifei Wang <[email protected]>; [email protected]; Honnappa Nagarahalli <[email protected]>; nd <[email protected]>
主题: RE: [PATCH] lib/ring: fix the bug of HTS/RTS bulk enqueue

Hi Feifei,
Thanks for the patch. Few nits inline.

Quoted 6 lines

-----Original Message-----
From: Feifei Wang <[email protected]>
Sent: Tuesday, June 9, 2020 10:39 PM
To: Honnappa Nagarahalli <[email protected]>; Konstantin Ananyev <[email protected]>
Cc: [email protected]; nd <[email protected]>; Feifei Wang

<[email protected]>;

Quoted 6 lines

[email protected]
Subject: [PATCH] lib/ring: fix the bug of HTS/RTS bulk enqueue

Directly call "_rte_ring_do_enqueue_elem" function can result in the process skips the "switch" order and cannot call the APIs of RTS and HTS mode in "rte_ring_enqueue_bulk_elem" function.

may be " lib/ring: fix bulk enqueue API to allow HTS/RTS modes"?

Quoted 1 line
Quoted 7 lines
Quoted 3 lines

To fix it, remove the unnecessary function and make "_rte_ring_do_enqueue_elem" consistent with "_rte_ring_do_dequeue_elem".

How about something like:
Remove the unwanted call to "_rte_ring_do_enqueue_elem" to allow for correct handling of RTS/HTS modes.

That's all right. This is more clearly.

Quoted 27 lines
Quoted 15 lines
Fixes e6ba4731c0f3 ("ring: introduce RTS ring mode")
---
 lib/librte_ring/rte_ring_elem.h | 3 ---
 1 file changed, 3 deletions(-)
(quoted diff) +0 -0

b/lib/librte_ring/rte_ring_elem.h index a5a4c46f9..469aee7da 100644

lib/librte_ring/rte_ring_elem.h static __rte_always_inline unsigned int · line 579

Quoted 2 lines
lib/librte_ring/rte_ring_elem.h +0 -0
@@ -578,9 +578,6 @@ static __rte_always_inline unsigned int
 rte_ring_enqueue_bulk_elem(struct rte_ring *r, const void *obj_table,
 unsigned int esize, unsigned int n, unsigned int *free_space)

{

lib/librte_ring/rte_ring_elem.h static __rte_always_inline unsigned int

Quoted 7 lines
lib/librte_ring/rte_ring_elem.h +0 -3
-return __rte_ring_do_enqueue_elem(r, obj_table, esize, n,
-RTE_RING_QUEUE_FIXED, r->prod.sync_type,
 free_space);
-
 switch (r->prod.sync_type) {
 case RTE_RING_SYNC_MT:
 return rte_ring_mp_enqueue_bulk_elem(r, obj_table, esize,

n,
Otherwise,

Quoted 4 lines
Quoted 2 lines

--
2.17.1

IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.

Acked-by on v1 1/1
#3 lore raw
In reply to Feifei Wang
Quoted 22 lines

Directly call "_rte_ring_do_enqueue_elem" function can result in the process skips the "switch" order and cannot call the APIs of RTS and HTS mode in "rte_ring_enqueue_bulk_elem" function.

To fix it, remove the unnecessary function and make "_rte_ring_do_enqueue_elem" consistent with "_rte_ring_do_dequeue_elem".

Fixes e6ba4731c0f3 ("ring: introduce RTS ring mode")
---
 lib/librte_ring/rte_ring_elem.h | 3 ---
 1 file changed, 3 deletions(-)
lib/librte_ring/rte_ring_elem.h +0 -0
index a5a4c46f9..469aee7da 100644

lib/librte_ring/rte_ring_elem.h static __rte_always_inline unsigned int

Quoted 10 lines
lib/librte_ring/rte_ring_elem.h +0 -4
@@ -578,9 +578,6 @@ static __rte_always_inline unsigned int
 rte_ring_enqueue_bulk_elem(struct rte_ring *r, const void *obj_table,
 		unsigned int esize, unsigned int n, unsigned int *free_space)
 {
-	return __rte_ring_do_enqueue_elem(r, obj_table, esize, n,
-			RTE_RING_QUEUE_FIXED, r->prod.sync_type, free_space);
-
 	switch (r->prod.sync_type) {
 	case RTE_RING_SYNC_MT:
 		return rte_ring_mp_enqueue_bulk_elem(r, obj_table, esize, n,
--

Ouch, that was a nasty one from me.
Thanks for catching and fixing.

Quoted 1 line

2.17.1

#4 lore raw
Quoted 41 lines

-----邮件原件-----
发件人: Ananyev, Konstantin <[email protected]> 发送时间: 2020年6月10日 18:17
收件人: Feifei Wang <[email protected]>; Honnappa Nagarahalli <[email protected]>
抄送: [email protected]; nd <[email protected]>; [email protected] 主题: RE: [PATCH] lib/ring: fix the bug of HTS/RTS bulk enqueue

Quoted 6 lines

Directly call "_rte_ring_do_enqueue_elem" function can result in the process skips the "switch" order and cannot call the APIs of RTS and HTS mode in "rte_ring_enqueue_bulk_elem" function.

To fix it, remove the unnecessary function and make "_rte_ring_do_enqueue_elem" consistent with

"_rte_ring_do_dequeue_elem".

Quoted 15 lines
Fixes e6ba4731c0f3 ("ring: introduce RTS ring mode")
---
 lib/librte_ring/rte_ring_elem.h | 3 ---
 1 file changed, 3 deletions(-)
(quoted diff) +0 -0

b/lib/librte_ring/rte_ring_elem.h index a5a4c46f9..469aee7da 100644

lib/librte_ring/rte_ring_elem.h static __rte_always_inline unsigned int · line 579

Quoted 2 lines
lib/librte_ring/rte_ring_elem.h +0 -0
@@ -578,9 +578,6 @@ static __rte_always_inline unsigned int
 rte_ring_enqueue_bulk_elem(struct rte_ring *r, const void *obj_table,
 unsigned int esize, unsigned int n, unsigned int *free_space)

{

lib/librte_ring/rte_ring_elem.h static __rte_always_inline unsigned int · line 581

Quoted 2 lines
lib/librte_ring/rte_ring_elem.h +0 -2
-return __rte_ring_do_enqueue_elem(r, obj_table, esize, n,
-RTE_RING_QUEUE_FIXED, r->prod.sync_type,

free_space);

lib/librte_ring/rte_ring_elem.h static __rte_always_inline unsigned int

Quoted 4 lines
lib/librte_ring/rte_ring_elem.h +0 -1
-
 switch (r->prod.sync_type) {
 case RTE_RING_SYNC_MT:
 return rte_ring_mp_enqueue_bulk_elem(r, obj_table, esize,
Quoted 5 lines

n,

lib/librte_ring/rte_ring_elem.h static __rte_always_inline unsigned int · line 586

Quoted 1 line
lib/librte_ring/rte_ring_elem.h +0 -1
--

Ouch, that was a nasty one from me.
Thanks for catching and fixing.

That's all right. It is admirable to integrate RTS mode. And I think I need a lot of things to learn from you.

Quoted 3 lines
Quoted 1 line

2.17.1

IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.