On Tue, 18 Apr 2023 11:32:50 +0000
Wisam Monther <wis...@nvidia.com> wrote:

> Hi,
> 
> > >  
> > > > -----Original Message-----
> > > > From: Harold Huang <baymaxhu...@gmail.com>
> > > > Sent: Sunday, March 12, 2023 4:00 AM
> > > > To: dev@dpdk.org
> > > > Cc: Harold Huang <baymaxhu...@gmail.com>; Wisam Monther
> > > > <wis...@nvidia.com>
> > > > Subject: [PATCH] app/flow-perf: replace RTE_BE32/16 with
> > > > rte_cpu_to_be_32/16 for variables
> > > >
> > > > In DPDK, the macros RTE_BE32 or RTE_BE16 are usually used for
> > > > constant values. And functions such as rte_cpu_to_be_32 or
> > > > rte_cpu_to_be_16 are optimized for variables.
> > > >
> > > > Signed-off-by: Harold Huang <baymaxhu...@gmail.com>  
> 
> Acked-by: Wisam Jaddo <wis...@nvidia.com>

Make sense.

Really doesn't make much difference and I wounder why the macro version
is necessary at all. Since the function already compiles to:


#define rte_bswap32(x) ((uint32_t)(__builtin_constant_p(x) ?            \
                                   rte_constant_bswap32(x) :            \
                                   rte_arch_bswap32(x)))


Acked-by: Stephen Hemminger <step...@networkplumber.org>

Reply via email to