summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSantosh Shukla <santosh.shukla@caviumnetworks.com>2017-01-18 06:51:38 +0530
committerThomas Monjalon <thomas.monjalon@6wind.com>2017-01-18 17:18:27 +0100
commit7b0983c26c0257b0a4627c31621dab14b1898598 (patch)
treee0d399d26348a3c52f12aa25eb3214cc437b83d4
parentdd7862ba58b28bd3aa01874c20f21d73321b062c (diff)
downloaddpdk-7b0983c26c0257b0a4627c31621dab14b1898598.zip
dpdk-7b0983c26c0257b0a4627c31621dab14b1898598.tar.gz
dpdk-7b0983c26c0257b0a4627c31621dab14b1898598.tar.xz
net/nfp: 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. CC: Alejandro Lucero <alejandro.lucero@netronome.com> Signed-off-by: Santosh Shukla <santosh.shukla@caviumnetworks.com> Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com> Acked-by: Alejandro Lucero <alejandro.lucero@netronome.com>
-rw-r--r--drivers/net/nfp/nfp_net_pmd.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/net/nfp/nfp_net_pmd.h b/drivers/net/nfp/nfp_net_pmd.h
index 4df2275..eec56bc 100644
--- a/drivers/net/nfp/nfp_net_pmd.h
+++ b/drivers/net/nfp/nfp_net_pmd.h
@@ -121,25 +121,26 @@ struct nfp_net_adapter;
#define NFD_CFG_MINOR_VERSION_of(x) (((x) >> 0) & 0xff)
#include <linux/types.h>
+#include <rte_io.h>
static inline uint8_t nn_readb(volatile const void *addr)
{
- return *((volatile const uint8_t *)(addr));
+ return rte_read8(addr);
}
static inline void nn_writeb(uint8_t val, volatile void *addr)
{
- *((volatile uint8_t *)(addr)) = val;
+ rte_write8(val, addr);
}
static inline uint32_t nn_readl(volatile const void *addr)
{
- return *((volatile const uint32_t *)(addr));
+ return rte_read32(addr);
}
static inline void nn_writel(uint32_t val, volatile void *addr)
{
- *((volatile uint32_t *)(addr)) = val;
+ rte_write32(val, addr);
}
static inline uint64_t nn_readq(volatile void *addr)