[dpdk-dev] [PATCH] ethdev: replace bit shifts with macros
Thomas Monjalon
thomas at monjalon.net
Thu Sep 16 10:55:04 CEST 2021
16/09/2021 08:52, Andrew Rybchenko:
> On 9/16/21 12:04 AM, Thomas Monjalon wrote:
> > The macros RTE_BIT32 and RTE_BIT64 are used to replace bit shifts.
> > The macro UINT64C is also used to replace remaining occurrences of ULL.
> >
> > Only bit shifts of ETH_RSS_LEVEL_* are kept for aesthetic reason.
> >
> > Signed-off-by: Thomas Monjalon <thomas at monjalon.net>
>
> Good cleanup, many thanks.
>
> > diff --git a/lib/ethdev/rte_mtr.h b/lib/ethdev/rte_mtr.h
> > index dc246dd7af..babc9968d0 100644
> > --- a/lib/ethdev/rte_mtr.h
> > +++ b/lib/ethdev/rte_mtr.h
> > @@ -60,28 +60,28 @@ extern "C" {
> > */
> > enum rte_mtr_stats_type {
> > /** Number of packets passed as green by the policer. */
> > - RTE_MTR_STATS_N_PKTS_GREEN = 1 << 0,
> > + RTE_MTR_STATS_N_PKTS_GREEN = RTE_BIT64(0),
>
> I think it is a bad idea to initialize enum members to
> uint64_t value.
Yes probably.
The targets are 64-bit wide so there is an inconsistency in the API I think.
More information about the dev
mailing list