ring: fix tail in peek API for ST mode
authorFeifei Wang <feifei.wang2@arm.com>
Sun, 28 Jun 2020 06:23:47 +0000 (14:23 +0800)
committerDavid Marchand <david.marchand@redhat.com>
Wed, 1 Jul 2020 08:41:19 +0000 (10:41 +0200)
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 <feifei.wang2@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
lib/librte_ring/rte_ring_peek_c11_mem.h

index 99321f1..283c7e7 100644 (file)
@@ -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;
 }