DPDK patches and discussions
 help / color / mirror / Atom feed
From: Haiyue Wang <haiyue.wang@intel.com>
To: dev@dpdk.org
Cc: Haiyue Wang <haiyue.wang@intel.com>,
	Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>,
	Konstantin Ananyev <konstantin.ananyev@intel.com>
Subject: [PATCH v1] ring: correct the comment and figure description
Date: Fri,  8 Apr 2022 20:40:42 +0800	[thread overview]
Message-ID: <20220408124042.272882-1-haiyue.wang@intel.com> (raw)

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


             reply	other threads:[~2022-04-08 13:13 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-08 12:40 Haiyue Wang [this message]
2022-11-15 16:41 ` Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220408124042.272882-1-haiyue.wang@intel.com \
    --to=haiyue.wang@intel.com \
    --cc=dev@dpdk.org \
    --cc=honnappa.nagarahalli@arm.com \
    --cc=konstantin.ananyev@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).