> -----Original Message----- > From: Jerin Jacob <[email protected]> > Sent: Wednesday, October 16, 2019 3:54 PM > To: Joyce Kong (Arm Technology China) <[email protected]> > Cc: dpdk-dev <[email protected]>; nd <[email protected]>; [email protected]; > [email protected]; [email protected]; Ziyang Xuan > <[email protected]>; Xiaoyun Wang > <[email protected]>; Guoyang Zhou > <[email protected]>; Rasesh Mody <[email protected]>; > Shahed Shaikh <[email protected]>; Honnappa Nagarahalli > <[email protected]>; Gavin Hu (Arm Technology China) > <[email protected]> > Subject: Re: [dpdk-dev] [PATCH v1 1/5] lib/eal: implement the family of rte > bit operation APIs > > On Tue, Oct 15, 2019 at 1:20 PM Joyce Kong <[email protected]> wrote: > > > > There are a lot functions of bit operations scattered and duplicated > > in PMDs, consolidating them into a common API family is necessary. > > Furthermore, the bit operation is mostly applied to the IO devices, so > > use __ATOMIC_ACQ_REL to ensure the ordering. > > > > Signed-off-by: Joyce Kong <[email protected]> > > --- > > lib/librte_eal/common/Makefile | 1 + > > lib/librte_eal/common/include/rte_bitops.h | 56 > ++++++++++++++++++++++++++++++ > > lib/librte_eal/common/meson.build | 1 + > > + > > +static inline void > > +rte_set_bit(unsigned int nr, unsigned long *addr) { > > + __atomic_fetch_or(addr, (1UL << nr), __ATOMIC_ACQ_REL); } > > If it is specific for IO the IMO, it makes sense call the API to > rte_io_set_bit() like rte_io_rmb > and change the header file to rte_io_bitops.h. > > The barries are only needed for IO operations. Explicitly is not conveying it > in > API name would call for using it for normal cases. > > Other option could be to introduce, generic and IO specific bit operations > operations separately.
Would do some related changes in next version.

