From 2ead29e1d6fca678a4e29245710d02fab038b810 Mon Sep 17 00:00:00 2001 From: David Marchand Date: Mon, 27 Apr 2020 15:23:39 +0200 Subject: [PATCH] ring: fix build with -Wswitch-enum Some popular vswitch implementation might use a gcc option that complains about missing enums in switch statements. Fix this by listing all possible values. Fixes: 664ff4b1729b ("ring: introduce peek style API") Signed-off-by: David Marchand Acked-by: Konstantin Ananyev --- lib/librte_ring/rte_ring_peek.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/librte_ring/rte_ring_peek.h b/lib/librte_ring/rte_ring_peek.h index 9e7f4db323..d5e6ea1cf3 100644 --- a/lib/librte_ring/rte_ring_peek.h +++ b/lib/librte_ring/rte_ring_peek.h @@ -68,6 +68,8 @@ __rte_ring_do_enqueue_start(struct rte_ring *r, uint32_t n, n = __rte_ring_hts_move_prod_head(r, n, behavior, &head, &free); break; + case RTE_RING_SYNC_MT: + case RTE_RING_SYNC_MT_RTS: default: /* unsupported mode, shouldn't be here */ RTE_ASSERT(0); @@ -217,6 +219,8 @@ rte_ring_enqueue_elem_finish(struct rte_ring *r, const void *obj_table, __rte_ring_enqueue_elems(r, tail, obj_table, esize, n); __rte_ring_hts_set_head_tail(&r->hts_prod, tail, n, 1); break; + case RTE_RING_SYNC_MT: + case RTE_RING_SYNC_MT_RTS: default: /* unsupported mode, shouldn't be here */ RTE_ASSERT(0); @@ -263,6 +267,8 @@ __rte_ring_do_dequeue_start(struct rte_ring *r, void *obj_table, n = __rte_ring_hts_move_cons_head(r, n, behavior, &head, &avail); break; + case RTE_RING_SYNC_MT: + case RTE_RING_SYNC_MT_RTS: default: /* unsupported mode, shouldn't be here */ RTE_ASSERT(0); @@ -414,6 +420,8 @@ rte_ring_dequeue_elem_finish(struct rte_ring *r, unsigned int n) n = __rte_ring_hts_get_tail(&r->hts_cons, &tail, n); __rte_ring_hts_set_head_tail(&r->hts_cons, tail, n, 0); break; + case RTE_RING_SYNC_MT: + case RTE_RING_SYNC_MT_RTS: default: /* unsupported mode, shouldn't be here */ RTE_ASSERT(0); -- 2.39.5