[dpdk-dev] [PATCH 19/28] net/ena: use eal I/O device memory read/write API

Jan Mędala jan at semihalf.com
Wed Dec 14 15:36:02 CET 2016


Despite the issue with naming convention (either it will be writel or
write32), I'm fine with this change and new API.

Acked-by: Jan Medala <jan at semihalf.com>

  Jan

2016-12-14 2:55 GMT+01:00 Jerin Jacob <jerin.jacob at caviumnetworks.com>:

> From: Santosh Shukla <santosh.shukla at caviumnetworks.com>
>
> Replace the raw I/O device memory read/write access with eal
> abstraction for I/O device memory read/write access to fix
> portability issues across different architectures.
>
> Signed-off-by: Santosh Shukla <santosh.shukla at caviumnetworks.com>
> Signed-off-by: Jerin Jacob <jerin.jacob at caviumnetworks.com>
> CC: Jan Medala <jan at semihalf.com>
> CC: Jakub Palider <jpa at semihalf.com>
> ---
>  drivers/net/ena/base/ena_plat_dpdk.h | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/ena/base/ena_plat_dpdk.h
> b/drivers/net/ena/base/ena_plat_dpdk.h
> index 87c3bf1..4db07c7 100644
> --- a/drivers/net/ena/base/ena_plat_dpdk.h
> +++ b/drivers/net/ena/base/ena_plat_dpdk.h
> @@ -50,6 +50,7 @@
>  #include <rte_spinlock.h>
>
>  #include <sys/time.h>
> +#include <rte_io.h>
>
>  typedef uint64_t u64;
>  typedef uint32_t u32;
> @@ -226,12 +227,12 @@ typedef uint64_t dma_addr_t;
>
>  static inline void writel(u32 value, volatile void  *addr)
>  {
> -       *(volatile u32 *)addr = value;
> +       rte_writel(value, addr);
>  }
>
>  static inline u32 readl(const volatile void *addr)
>  {
> -       return *(const volatile u32 *)addr;
> +       return rte_readl(addr);
>  }
>
>  #define ENA_REG_WRITE32(value, reg) writel((value), (reg))
> --
> 2.5.5
>
>


More information about the dev mailing list