Commit b0eb57cb authored by Andy King's avatar Andy King Committed by David S. Miller

VMXNET3: Add support for virtual IOMMU

This patch adds support for virtual IOMMU to the vmxnet3 module.  We
switch to DMA consistent mappings for anything we pass to the device.
There were a few places where we already did this, but using pci_blah();
these have been fixed to use dma_blah(), along with all new occurrences
where we've replaced kmalloc() and friends.

Also fix two small bugs:
1) use after free of rq->buf_info in vmxnet3_rq_destroy()
2) a cpu_to_le32() that should have been a cpu_to_le64()
Acked-by: default avatarGeorge Zhang <georgezhang@vmware.com>
Acked-by: default avatarAditya Sarwade <asarwade@vmware.com>
Signed-off-by: default avatarAndy King <acking@vmware.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 68d7bdcb
This diff is collapsed.
...@@ -70,10 +70,10 @@ ...@@ -70,10 +70,10 @@
/* /*
* Version numbers * Version numbers
*/ */
#define VMXNET3_DRIVER_VERSION_STRING "1.1.30.0-k" #define VMXNET3_DRIVER_VERSION_STRING "1.2.0.0-k"
/* a 32-bit int, each byte encode a verion number in VMXNET3_DRIVER_VERSION */ /* a 32-bit int, each byte encode a verion number in VMXNET3_DRIVER_VERSION */
#define VMXNET3_DRIVER_VERSION_NUM 0x01011E00 #define VMXNET3_DRIVER_VERSION_NUM 0x01020000
#if defined(CONFIG_PCI_MSI) #if defined(CONFIG_PCI_MSI)
/* RSS only makes sense if MSI-X is supported. */ /* RSS only makes sense if MSI-X is supported. */
...@@ -229,6 +229,7 @@ struct vmxnet3_tx_queue { ...@@ -229,6 +229,7 @@ struct vmxnet3_tx_queue {
spinlock_t tx_lock; spinlock_t tx_lock;
struct vmxnet3_cmd_ring tx_ring; struct vmxnet3_cmd_ring tx_ring;
struct vmxnet3_tx_buf_info *buf_info; struct vmxnet3_tx_buf_info *buf_info;
dma_addr_t buf_info_pa;
struct vmxnet3_tx_data_ring data_ring; struct vmxnet3_tx_data_ring data_ring;
struct vmxnet3_comp_ring comp_ring; struct vmxnet3_comp_ring comp_ring;
struct Vmxnet3_TxQueueCtrl *shared; struct Vmxnet3_TxQueueCtrl *shared;
...@@ -277,6 +278,7 @@ struct vmxnet3_rx_queue { ...@@ -277,6 +278,7 @@ struct vmxnet3_rx_queue {
u32 qid; /* rqID in RCD for buffer from 1st ring */ u32 qid; /* rqID in RCD for buffer from 1st ring */
u32 qid2; /* rqID in RCD for buffer from 2nd ring */ u32 qid2; /* rqID in RCD for buffer from 2nd ring */
struct vmxnet3_rx_buf_info *buf_info[2]; struct vmxnet3_rx_buf_info *buf_info[2];
dma_addr_t buf_info_pa;
struct Vmxnet3_RxQueueCtrl *shared; struct Vmxnet3_RxQueueCtrl *shared;
struct vmxnet3_rq_driver_stats stats; struct vmxnet3_rq_driver_stats stats;
} __attribute__((__aligned__(SMP_CACHE_BYTES))); } __attribute__((__aligned__(SMP_CACHE_BYTES)));
...@@ -353,6 +355,10 @@ struct vmxnet3_adapter { ...@@ -353,6 +355,10 @@ struct vmxnet3_adapter {
unsigned long state; /* VMXNET3_STATE_BIT_xxx */ unsigned long state; /* VMXNET3_STATE_BIT_xxx */
int share_intr; int share_intr;
dma_addr_t adapter_pa;
dma_addr_t pm_conf_pa;
dma_addr_t rss_conf_pa;
}; };
#define VMXNET3_WRITE_BAR0_REG(adapter, reg, val) \ #define VMXNET3_WRITE_BAR0_REG(adapter, reg, val) \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment