[dpdk-dev] [PATCH v9 1/6] lib/eal: implement the family of common bit operation APIs

Thomas Monjalon thomas at monjalon.net
Sun Apr 26 11:23:03 CEST 2020


26/04/2020 09:18, Joyce Kong:
> From: Thomas Monjalon <thomas at monjalon.net>
> > 24/04/2020 05:21, Joyce Kong:
> > > Bitwise operation APIs are defined and used in a lot of PMDs, which
> > > caused a huge code duplication. To reduce duplication, this patch
> > > consolidates them into a common API family.
> > [...]
> > > +rte_get_bit32_relaxed(unsigned int nr, volatile uint32_t *addr)
> > > +rte_set_bit32_relaxed(unsigned int nr, volatile uint32_t *addr)
> > > +rte_clear_bit32_relaxed(unsigned int nr, volatile uint32_t *addr)
> > > +rte_test_and_set_bit32_relaxed(unsigned int nr, volatile uint32_t
> > > +*addr) rte_test_and_clear_bit32_relaxed(unsigned int nr, volatile
> > > +uint32_t *addr) rte_get_bit64_relaxed(unsigned int nr, volatile
> > > +uint64_t *addr) rte_set_bit64_relaxed(unsigned int nr, volatile
> > > +uint64_t *addr) rte_clear_bit64_relaxed(unsigned int nr, volatile
> > > +uint64_t *addr) rte_test_and_set_bit64_relaxed(unsigned int nr,
> > > +volatile uint64_t *addr) rte_test_and_clear_bit64_relaxed(unsigned
> > > +int nr, volatile uint64_t *addr)
> > 
> > Sorry, I have one more naming concern with this series.
> > I prefer a common namespace for bit operations.
> > Would you be OK to prefix all function names with rte_bit_relaxed_?
> > 
> Hi Thomas,
> Do you mean to rename the functions as 'rte_bit_relaxed_get_bit32'?
> If the example is ok, I will modify as this in v10.

Yes, thank you.




More information about the dev mailing list