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

Joyce Kong Joyce.Kong at arm.com
Sun Apr 26 09:18:37 CEST 2020


> -----Original Message-----
> From: Thomas Monjalon <thomas at monjalon.net>
> Sent: Sunday, April 26, 2020 3:59 AM
> To: Joyce Kong <Joyce.Kong at arm.com>
> Cc: stephen at networkplumber.org; david.marchand at redhat.com;
> mb at smartsharesystems.com; jerinj at marvell.com;
> bruce.richardson at intel.com; ravi1.kumar at amd.com; rmody at marvell.com;
> shshaikh at marvell.com; xuanziyang2 at huawei.com;
> cloud.wangxiaoyun at huawei.com; zhouguoyang at huawei.com; Honnappa
> Nagarahalli <Honnappa.Nagarahalli at arm.com>; Gavin Hu
> <Gavin.Hu at arm.com>; Phil Yang <Phil.Yang at arm.com>; dev at dpdk.org; nd
> <nd at arm.com>
> Subject: Re: [dpdk-dev] [PATCH v9 1/6] lib/eal: implement the family of
> common bit operation APIs
> 
> 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.
Thanks, Joyce


More information about the dev mailing list