[PATCH net 1/2] vmxnet3: set the DMA mask before the first DMA map operation

2018-05-14 Thread hpreg
The DMA mask must be set before, not after, the first DMA map operation, or the first DMA map operation could in theory fail on some systems. Fixes: b0eb57cb97e78 ("VMXNET3: Add support for virtual IOMMU") Signed-off-by: Regis Duchesne Acked-by: Ronak Doshi --- drivers/net/vmxnet3/vmxnet3_drv.c

[PATCH net 1/2] vmxnet3: set the DMA mask before the first DMA map operation

2018-05-14 Thread hpreg
The DMA mask must be set before, not after, the first DMA map operation, or the first DMA map operation could in theory fail on some systems. Fixes: b0eb57cb97e78 ("VMXNET3: Add support for virtual IOMMU") Signed-off-by: Regis Duchesne Acked-by: Ronak Doshi --- drivers/net/vmxnet3/vmxnet3_drv.c

[PATCH net 2/2] vmxnet3: use DMA memory barriers where required

2018-05-14 Thread hpreg
The gen bits must be read first from (resp. written last to) DMA memory. The proper way to enforce this on Linux is to call dma_rmb() (resp. dma_wmb()). Signed-off-by: Regis Duchesne Acked-by: Ronak Doshi --- drivers/net/vmxnet3/vmxnet3_drv.c | 22 ++ drivers/net/vmxnet3/vmx