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

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


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.

v3:
    - add lost [2/3]

v2:
    - fix [1/3] in accordance with [2/3] changes to be correct from the
      very beginning

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(-)

-- 
2.17.1



More information about the dev mailing list