Skip to contentSkip to conversation

ring: fix error vlaue of tail in the peek API for ST mode

PATCH Applied Feifei Wang 3 participants 3 messages Jun 28, 2020 – Jul 1, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ring: fix error vlaue of tail in the peek API for ST mode

The value of *tail should be the prod->tail not prod->head. After modification, it can record 'tail' so head/tail can be updated accordingly.

Fixes 664ff4b1729b ("ring: introduce peek style API")
---
 lib/librte_ring/rte_ring_peek_c11_mem.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/librte_ring/rte_ring_peek_c11_mem.h +1 -1
index 99321f124..283c7e70b 100644
@@ -40,7 +40,7 @@ __rte_ring_st_get_tail(struct rte_ring_headtail *ht, uint32_t *tail,
 	RTE_ASSERT(n >= num);
 	num = (n >= num) ? num : 0;
 
-	*tail = h;
+	*tail = t;
 	return num;
 }
 
Signature · 1 line
2.17.1
Acked-by on v1 1/1
#1 lore raw
Quoted 27 lines

-----Original Message-----
From: Feifei Wang <[email protected]>
Sent: Sunday, June 28, 2020 7:24 AM
To: Honnappa Nagarahalli <[email protected]>; Ananyev, Konstantin <[email protected]>
Cc: [email protected]; [email protected]; Feifei Wang <[email protected]>; [email protected]
Subject: [PATCH] ring: fix error vlaue of tail in the peek API for ST mode

The value of *tail should be the prod->tail not prod->head. After modification, it can record 'tail' so head/tail can be updated accordingly.

Fixes 664ff4b1729b ("ring: introduce peek style API")
---
 lib/librte_ring/rte_ring_peek_c11_mem.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/librte_ring/rte_ring_peek_c11_mem.h +0 -0
index 99321f124..283c7e70b 100644

lib/librte_ring/rte_ring_peek_c11_mem.h __rte_ring_st_get_tail(struct rte_ring_headtail *ht, uint32_t *tail,

Quoted 9 lines
lib/librte_ring/rte_ring_peek_c11_mem.h +1 -2
@@ -40,7 +40,7 @@ __rte_ring_st_get_tail(struct rte_ring_headtail *ht, uint32_t *tail,
 	RTE_ASSERT(n >= num);
 	num = (n >= num) ? num : 0;
 
-	*tail = h;
+	*tail = t;
 	return num;
 }
 
--

Thanks for the fix.

Quoted 1 line

2.17.1

#2 lore raw
Quoted 11 lines · Konstantin
Quoted 11 lines

-----Original Message-----
From: Feifei Wang <[email protected]>
Sent: Sunday, June 28, 2020 7:24 AM
To: Honnappa Nagarahalli <[email protected]>; Ananyev, Konstantin <[email protected]>
Cc: [email protected]; [email protected]; Feifei Wang <[email protected]>; [email protected]
Subject: [PATCH] ring: fix error vlaue of tail in the peek API for ST mode

The value of *tail should be the prod->tail not prod->head. After modification, it can record 'tail' so head/tail can be updated accordingly.

Quoted 6 lines
Quoted 5 lines
Fixes 664ff4b1729b ("ring: introduce peek style API")

Applied, thanks.

Signature · 1 line
David Marchand