};
EAL_REGISTER_TAILQ(rte_ring_tailq)
+/* mask of all valid flag values to ring_create() */
+#define RING_F_MASK (RING_F_SP_ENQ | RING_F_SC_DEQ | RING_F_EXACT_SZ | \
+ RING_F_MP_RTS_ENQ | RING_F_MC_RTS_DEQ | \
+ RING_F_MP_HTS_ENQ | RING_F_MC_HTS_DEQ)
+
/* true if x is a power of 2 */
#define POWEROF2(x) ((((x)-1) & (x)) == 0)
RTE_BUILD_BUG_ON(offsetof(struct rte_ring_headtail, tail) !=
offsetof(struct rte_ring_rts_headtail, tail.val.pos));
+ /* future proof flags, only allow supported values */
+ if (flags & ~RING_F_MASK) {
+ RTE_LOG(ERR, RING,
+ "Unsupported flags requested %#x\n", flags);
+ return -EINVAL;
+ }
+
/* init the ring structure */
memset(r, 0, sizeof(*r));
ret = strlcpy(r->name, name, sizeof(r->name));