summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJerin Jacob <jerin.jacob@caviumnetworks.com>2017-01-18 06:51:34 +0530
committerThomas Monjalon <thomas.monjalon@6wind.com>2017-01-18 17:18:27 +0100
commitfcbf1e14de4812829550c3413e622fa48401e483 (patch)
tree115d5313b9de091b5399ca9f01a167824690136d
parent94ce07962a0cd6432ea9c67d54f3017bd75dab0f (diff)
downloaddpdk-fcbf1e14de4812829550c3413e622fa48401e483.zip
dpdk-fcbf1e14de4812829550c3413e622fa48401e483.tar.gz
dpdk-fcbf1e14de4812829550c3413e622fa48401e483.tar.xz
net/ena: use I/O device memory read/write API
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. Suggested-by: Jan Medala <jan@semihalf.com> Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com> Acked-by: Jan Medala <jan@semihalf.com>
-rw-r--r--drivers/net/ena/base/ena_plat_dpdk.h15
1 files changed, 3 insertions, 12 deletions
diff --git a/drivers/net/ena/base/ena_plat_dpdk.h b/drivers/net/ena/base/ena_plat_dpdk.h
index 87c3bf1..7eaebf4 100644
--- a/drivers/net/ena/base/ena_plat_dpdk.h
+++ b/drivers/net/ena/base/ena_plat_dpdk.h
@@ -44,6 +44,7 @@
#include <rte_atomic.h>
#include <rte_branch_prediction.h>
#include <rte_cycles.h>
+#include <rte_io.h>
#include <rte_log.h>
#include <rte_malloc.h>
#include <rte_memzone.h>
@@ -224,18 +225,8 @@ typedef uint64_t dma_addr_t;
#define ENA_MEM_ALLOC(dmadev, size) rte_zmalloc(NULL, size, 1)
#define ENA_MEM_FREE(dmadev, ptr) ({ENA_TOUCH(dmadev); rte_free(ptr); })
-static inline void writel(u32 value, volatile void *addr)
-{
- *(volatile u32 *)addr = value;
-}
-
-static inline u32 readl(const volatile void *addr)
-{
- return *(const volatile u32 *)addr;
-}
-
-#define ENA_REG_WRITE32(value, reg) writel((value), (reg))
-#define ENA_REG_READ32(reg) readl((reg))
+#define ENA_REG_WRITE32(value, reg) rte_write32_relaxed((value), (reg))
+#define ENA_REG_READ32(reg) rte_read32_relaxed((reg))
#define ATOMIC32_INC(i32_ptr) rte_atomic32_inc(i32_ptr)
#define ATOMIC32_DEC(i32_ptr) rte_atomic32_dec(i32_ptr)