[dpdk-dev] [PATCH 0/3] net/sfc: fix power of 2 alignment macros

Andrew Rybchenko arybchenko at solarflare.com
Wed Jul 24 15:04:24 CEST 2019


On 7/24/19 3:59 PM, Andrew Rybchenko wrote:
> P2ROUNDUP() and P2ALIGN() macros are buggy when alignment type is smaller
> than type of the value to be aligned.
>
> IS_P2ALIGNED() has no the problem since it cast its arugments
> to uintptr_t inside, but fixed anyway to follow the same approach as
> new EFX_P2ROUNDUP() and EFX_P2ALIGN().
>
> Patches have checkpatches.sh warnings in base driver since space
> is required after sizeof.
>
> Andrew Rybchenko (3):
>    net/sfc: fix power of 2 round up when align has smaller type
>    net/sfc: fix align to power of 2 when align has smaller type
>    net/sfc: unify power of 2 alignment check macro
>
>   drivers/net/sfc/base/ef10_impl.h  |  9 +++---
>   drivers/net/sfc/base/ef10_nvram.c |  3 +-
>   drivers/net/sfc/base/ef10_rx.c    | 11 ++++---
>   drivers/net/sfc/base/efx.h        | 21 ++++++++++---
>   drivers/net/sfc/base/efx_mcdi.h   |  9 ++++--
>   drivers/net/sfc/base/efx_tx.c     |  4 +--
>   drivers/net/sfc/efsys.h           | 51 +++++++++++++++----------------
>   drivers/net/sfc/sfc_ethdev.c      |  2 +-
>   drivers/net/sfc/sfc_rx.c          |  2 +-
>   9 files changed, 64 insertions(+), 48 deletions(-)
>

Self NACK since the second patch fixes the first one. I'll send v2 shortly.


More information about the dev mailing list