* [PATCH v1] ring: correct the comment and figure description
@ 2022-04-08 12:40 Haiyue Wang
2022-11-15 16:41 ` Thomas Monjalon
0 siblings, 1 reply; 2+ messages in thread
From: Haiyue Wang @ 2022-04-08 12:40 UTC (permalink / raw)
To: dev; +Cc: Haiyue Wang, Honnappa Nagarahalli, Konstantin Ananyev
The index description isn't right, correct it as the Programmer's guide
said.
Also correct the guide's figure description about 'Dequeue First Step'.
Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>
---
doc/guides/prog_guide/ring_lib.rst | 2 +-
lib/ring/rte_ring_core.h | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/doc/guides/prog_guide/ring_lib.rst b/doc/guides/prog_guide/ring_lib.rst
index 54e0bb4b68..515a715266 100644
--- a/doc/guides/prog_guide/ring_lib.rst
+++ b/doc/guides/prog_guide/ring_lib.rst
@@ -172,7 +172,7 @@ If there are not enough objects in the ring (this is detected by checking prod_t
.. figure:: img/ring-dequeue1.*
- Dequeue last step
+ Dequeue first step
Dequeue Second Step
diff --git a/lib/ring/rte_ring_core.h b/lib/ring/rte_ring_core.h
index 1252ca9546..82b237091b 100644
--- a/lib/ring/rte_ring_core.h
+++ b/lib/ring/rte_ring_core.h
@@ -111,8 +111,8 @@ struct rte_ring_hts_headtail {
* An RTE ring structure.
*
* The producer and the consumer have a head and a tail index. The particularity
- * of these index is that they are not between 0 and size(ring). These indexes
- * are between 0 and 2^32, and we mask their value when we access the ring[]
+ * of these index is that they are not between 0 and size(ring)-1. These indexes
+ * are between 0 and 2^32 -1, and we mask their value when we access the ring[]
* field. Thanks to this assumption, we can do subtractions between 2 index
* values in a modulo-32bit base: that's why the overflow of the indexes is not
* a problem.
--
2.35.1
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-11-15 16:41 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-08 12:40 [PATCH v1] ring: correct the comment and figure description Haiyue Wang
2022-11-15 16:41 ` Thomas Monjalon
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).