[dpdk-dev] [PATCH] eal: avoid side effects in RTE_ALIGN_MUL_NEAR(v, mul) for v and mul
David Marchand
david.marchand at redhat.com
Fri Mar 12 09:07:22 CET 2021
On Thu, Mar 11, 2021 at 10:08 PM Tyler Retzlaff
<roretzla at linux.microsoft.com> wrote:
>
> Avoid expanding v and mul parameters multiple times in the macro. based
> on usage of the macro it seems like side effects were not intended.
>
> For example:
> ``return RTE_ALIGN_MUL_NEAR(rte_rdtsc() - start, CYC_PER_10MHZ);''
That's the beauty of macros.
How about updating the unit tests so that this kind of issue is not
reintroduced?
Are other RTE_ALIGN_* macro affected with similar issues?
Like mul expression passed to RTE_ALIGN_MUL_FLOOR and RTE_ALIGN_MUL_CEIL.
--
David Marchand
More information about the dev
mailing list