[dpdk-dev] [PATCH v2 1/4] ring: future proof flag settings

Stephen Hemminger stephen at networkplumber.org
Fri Apr 24 21:02:12 CEST 2020


On Fri, 24 Apr 2020 18:07:15 +0000
Honnappa Nagarahalli <Honnappa.Nagarahalli at arm.com> wrote:

> <snip>
> 
> > 
> > All API's should check that they support the flag values passed.
> > These checks ensure that the extra bits can safely be used without risk of ABI
> > breakage.
> > 
> > Signed-off-by: Stephen Hemminger <stephen at networkplumber.org>
> > ---
> >  lib/librte_ring/rte_ring.c | 10 ++++++++++
> >  1 file changed, 10 insertions(+)
> > 
> > diff --git a/lib/librte_ring/rte_ring.c b/lib/librte_ring/rte_ring.c index
> > ebe5ccf0de68..70685121581f 100644
> > --- a/lib/librte_ring/rte_ring.c
> > +++ b/lib/librte_ring/rte_ring.c
> > @@ -42,6 +42,9 @@ static struct rte_tailq_elem rte_ring_tailq = {  };
> >  EAL_REGISTER_TAILQ(rte_ring_tailq)
> > 
> > +/* mask of all valid flag values to ring_create() */
> > +#define RING_F_MASK	0x007F  
> Is it better to construct this using the actual flag #defines?

sure, but it gets long



More information about the dev mailing list