From: Feifei Wang Date: Sun, 28 Jun 2020 06:23:47 +0000 (+0800) Subject: ring: fix tail in peek API for ST mode X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=708d904451c8f8e431cd783753812e1ffe7a92fc;p=dpdk.git ring: fix tail in 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") Signed-off-by: Feifei Wang Reviewed-by: Ruifeng Wang Acked-by: Konstantin Ananyev --- diff --git a/lib/librte_ring/rte_ring_peek_c11_mem.h b/lib/librte_ring/rte_ring_peek_c11_mem.h index 99321f1245..283c7e70b0 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; }