On Tue, 18 Apr 2023 11:32:50 +0000
Wisam Monther <[email protected]> wrote:

> Hi,
> 
> > >  
> > > > -----Original Message-----
> > > > From: Harold Huang <[email protected]>
> > > > Sent: Sunday, March 12, 2023 4:00 AM
> > > > To: [email protected]
> > > > Cc: Harold Huang <[email protected]>; Wisam Monther
> > > > <[email protected]>
> > > > 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 <[email protected]>  
> 
> Acked-by: Wisam Jaddo <[email protected]>

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 <[email protected]>

Reply via email to