From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id EC4D3A0522 for ; Sun, 28 Jun 2020 08:24:21 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 0728D1BFFA; Sun, 28 Jun 2020 08:24:21 +0200 (CEST) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by dpdk.org (Postfix) with ESMTP id 5B7A01C12D; Sun, 28 Jun 2020 08:24:18 +0200 (CEST) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id C160B30E; Sat, 27 Jun 2020 23:24:17 -0700 (PDT) Received: from net-arm-c2400.shanghai.arm.com (net-arm-c2400.shanghai.arm.com [10.169.40.212]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id A38613F6CF; Sat, 27 Jun 2020 23:24:15 -0700 (PDT) From: Feifei Wang To: Honnappa Nagarahalli , Konstantin Ananyev Cc: dev@dpdk.org, nd@arm.com, Feifei Wang , stable@dpdk.org Date: Sun, 28 Jun 2020 14:23:47 +0800 Message-Id: <20200628062348.23063-1-feifei.wang2@arm.com> X-Mailer: git-send-email 2.17.1 Subject: [dpdk-stable] [PATCH] ring: fix error vlaue of tail in the peek API for ST mode X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" 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") Cc: stable@dpdk.org Signed-off-by: Feifei Wang Reviewed-by: Ruifeng Wang --- lib/librte_ring/rte_ring_peek_c11_mem.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/librte_ring/rte_ring_peek_c11_mem.h b/lib/librte_ring/rte_ring_peek_c11_mem.h index 99321f124..283c7e70b 100644 --- a/lib/librte_ring/rte_ring_peek_c11_mem.h +++ b/lib/librte_ring/rte_ring_peek_c11_mem.h @@ -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; } -- 2.17.1