ring: add reset function for flushing
authorGavin Hu <gavin.hu@arm.com>
Tue, 16 Jul 2019 19:23:55 +0000 (03:23 +0800)
committerThomas Monjalon <thomas@monjalon.net>
Wed, 17 Jul 2019 17:51:56 +0000 (19:51 +0200)
commit272d87b01bda5728f6b6d472a34361673b67c05d
tree6b73bf1283baa765cbe9e22b9da26e976c17a2dd
parent46418d25f79ed6c59a981798beeda652f079e3dd
ring: add reset function for flushing

Currently, the flush is done by dequeuing the ring in a while loop. It is
much simpler to flush the queue by resetting the head and tail indices.

Signed-off-by: Gavin Hu <gavin.hu@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
lib/librte_ring/rte_ring.c
lib/librte_ring/rte_ring.h
lib/librte_ring/rte_ring_version.map