[PATCH] app/flow-perf: replace RTE_BE32/16 with rte_cpu_to_be_32/16 for variables
Stephen Hemminger
stephen at networkplumber.org
Mon Oct 7 21:36:19 CEST 2024
On Tue, 18 Apr 2023 11:32:50 +0000
Wisam Monther <wisamm at nvidia.com> wrote:
> Hi,
>
> > >
> > > > -----Original Message-----
> > > > From: Harold Huang <baymaxhuang at gmail.com>
> > > > Sent: Sunday, March 12, 2023 4:00 AM
> > > > To: dev at dpdk.org
> > > > Cc: Harold Huang <baymaxhuang at gmail.com>; Wisam Monther
> > > > <wisamm at 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 <baymaxhuang at gmail.com>
>
> Acked-by: Wisam Jaddo <wisamm at 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 <stephen at networkplumber.org>
More information about the dev
mailing list