[dpdk-dev] [PATCH v2 0/6] implement common rte bit operation APIs in PMDs

Gavin Hu (Arm Technology China) Gavin.Hu at arm.com
Thu Oct 31 11:39:59 CET 2019


> -----Original Message-----
> From: Morten Brørup <mb at smartsharesystems.com>
> Sent: Wednesday, October 30, 2019 9:02 PM
> To: Jerin Jacob <jerinjacobk at gmail.com>; Gavin Hu (Arm Technology China)
> <Gavin.Hu at arm.com>
> Cc: thomas at monjalon.net; Joyce Kong (Arm Technology China)
> <Joyce.Kong at arm.com>; dev at dpdk.org; nd <nd at arm.com>;
> jerinj at marvell.com; stephen at networkplumber.org; Honnappa Nagarahalli
> <Honnappa.Nagarahalli at arm.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;
> adrien.mazarguil at 6wind.com
> Subject: RE: [dpdk-dev] [PATCH v2 0/6] implement common rte bit operation
> APIs in PMDs
> 
> > -----Original Message-----
> > From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Jerin Jacob
> > Sent: Wednesday, October 30, 2019 1:33 PM
> >
> > On Wed, Oct 30, 2019 at 3:25 PM Gavin Hu (Arm Technology China)
> > <Gavin.Hu at arm.com> wrote:
> > >
> > > Hi Thomas,
> > >
> > > > -----Original Message-----
> > > > From: Thomas Monjalon <thomas at monjalon.net>
> > > > Sent: Wednesday, October 30, 2019 12:43 AM
> > > >
> > > > 23/10/2019 04:54, Joyce Kong:
> > > > > There are a lot functions of bit operations scattered in PMDs,
> > > > > consolidate them into a common API family and applied in different
> > > > > PMDs to reduce code duplication.
> > > >
> > > > Please, could you look at what Adrien did in the Mellanox PMD?
> > > >
> > > >
> > http://code.dpdk.org/dpdk/latest/source/drivers/net/mlx5/mlx5_utils.h#L28
> > > The code has less duplication, but it requires a less natural declaration
> > of variables
> > > http://code.dpdk.org/dpdk/latest/source/drivers/net/mlx5/mlx5.h#L607
> > > Should we take this way?
> >
> >
> > IMO, We need to consider the MACRO based scheme only as of the last resort.
> >
> 
> I agree.
> 
> The EAL library already has an I/O device memory access API, i.e. with
> functionality closely related to the proposed I/O device bit operation API:
> http://code.dpdk.org/dpdk/latest/source/lib/librte_eal/common/include/gene
> ric/rte_io.h
> 
> I would prefer a similar approach, and API familiarity would be my strongest
> argument.
Yes, this is a more natural way, and engineers are more familiar with the APIs.
We will take this way as more people vote for this.
Thanks Thomas also for your comment, we are inspired by this code, we will add assert() also to guarantee the 'bit' argument is in the valid range.
We used this common API for some PMDs, but not extensively, the reason is we want to finalize the API firstly(with your comments coming) and then propagate later.
/Gavin   




More information about the dev mailing list