summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSantosh Shukla <santosh.shukla@caviumnetworks.com>2017-01-18 06:51:42 +0530
committerThomas Monjalon <thomas.monjalon@6wind.com>2017-01-18 17:18:27 +0100
commit635acf386acbfad7b5e56f84371404e3cecbf73b (patch)
treeffc443c809003e79478b4e8ca5465c9ca66fac46
parent631d4ee413b93499fc89e511ffa08075941f8ec7 (diff)
downloaddpdk-635acf386acbfad7b5e56f84371404e3cecbf73b.zip
dpdk-635acf386acbfad7b5e56f84371404e3cecbf73b.tar.gz
dpdk-635acf386acbfad7b5e56f84371404e3cecbf73b.tar.xz
net/vmxnet3: 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: Yong Wang <yongwang@vmware.com> Signed-off-by: Santosh Shukla <santosh.shukla@caviumnetworks.com> Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
-rw-r--r--drivers/net/vmxnet3/vmxnet3_ethdev.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/net/vmxnet3/vmxnet3_ethdev.h b/drivers/net/vmxnet3/vmxnet3_ethdev.h
index 469db71..348c840 100644
--- a/drivers/net/vmxnet3/vmxnet3_ethdev.h
+++ b/drivers/net/vmxnet3/vmxnet3_ethdev.h
@@ -34,6 +34,8 @@
#ifndef _VMXNET3_ETHDEV_H_
#define _VMXNET3_ETHDEV_H_
+#include <rte_io.h>
+
#define VMXNET3_MAX_MAC_ADDRS 1
/* UPT feature to negotiate */
@@ -120,7 +122,7 @@ struct vmxnet3_hw {
/* Config space read/writes */
-#define VMXNET3_PCI_REG(reg) (*((volatile uint32_t *)(reg)))
+#define VMXNET3_PCI_REG(reg) rte_read32(reg)
static inline uint32_t
vmxnet3_read_addr(volatile void *addr)
@@ -128,9 +130,7 @@ vmxnet3_read_addr(volatile void *addr)
return VMXNET3_PCI_REG(addr);
}
-#define VMXNET3_PCI_REG_WRITE(reg, value) do { \
- VMXNET3_PCI_REG((reg)) = (value); \
-} while(0)
+#define VMXNET3_PCI_REG_WRITE(reg, value) rte_write32((value), (reg))
#define VMXNET3_PCI_BAR0_REG_ADDR(hw, reg) \
((volatile uint32_t *)((char *)(hw)->hw_addr0 + (reg)))