From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 2F16BA0509; Fri, 8 Apr 2022 15:13:06 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D055240689; Fri, 8 Apr 2022 15:13:04 +0200 (CEST) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mails.dpdk.org (Postfix) with ESMTP id 51CBB4003F for ; Fri, 8 Apr 2022 15:13:03 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1649423583; x=1680959583; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=sw6iK5lCEPRz+mcVPJYAD2eTmzhtB/7/nKv4Mlo90Rw=; b=TUW9mAFZGKnI0Jbu/CCJYNk/0gLNUuAfOzWWbGr9QkAsBRpGdCHjINqA f6tyNVEjZ6uCxgahmlPf0YE4Sao/Lk9Z46jVVdvEkGdgSz2FNN2Gsgeo2 17TEmi4a3Vg4Ag+f1x8MBcrPig1498EPBto+l+d5xv+bdCH0aTlTsTYIO n3+ibqPSzum6jT5SQ3nCZ+EcFfcPtbuMzMkkiygl+dXWysI3KDVWEvxCj R7QONVlQNF8UpdgzTbq/oIoxSPOOu0kAmfqwoAqUlvT2ya5B22HSlWPuN /cpu7DEC5OihWmzAr2QH7Wr5x+UzNqPesfqnsATbXs/LANpURQapxT5ww A==; X-IronPort-AV: E=McAfee;i="6400,9594,10310"; a="242183017" X-IronPort-AV: E=Sophos;i="5.90,245,1643702400"; d="scan'208";a="242183017" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Apr 2022 06:13:02 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.90,245,1643702400"; d="scan'208";a="550496811" Received: from npg-dpdk-haiyue-1.sh.intel.com ([10.67.110.251]) by orsmga007.jf.intel.com with ESMTP; 08 Apr 2022 06:13:00 -0700 From: Haiyue Wang To: dev@dpdk.org Cc: Haiyue Wang , Honnappa Nagarahalli , Konstantin Ananyev Subject: [PATCH v1] ring: correct the comment and figure description Date: Fri, 8 Apr 2022 20:40:42 +0800 Message-Id: <20220408124042.272882-1-haiyue.wang@intel.com> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org 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 --- 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