diff mbox series

[c/azure,3/8] hv_uio_generic: map ringbuffer phys addr

Message ID 20190314183135.20235-4-marcelo.cerri@canonical.com
State New
Headers show
Series Upstream Commits Needed for DPDK on Azure | expand

Commit Message

Marcelo Henrique Cerri March 14, 2019, 6:31 p.m. UTC
From: Stephen Hemminger <stephen@networkplumber.org>

BugLink: http://bugs.launchpad.net/bugs/1812123

The ring buffer is contiguous IOVA and is mapped via phys addr
for sysfs file. Use same method for the UIO mapping.

Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 9da197f1df40c838f0f06abf94cd23b4ed81e522)
Signed-off-by: Marcelo Henrique Cerri <marcelo.cerri@canonical.com>
---
 drivers/uio/uio_hv_generic.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/drivers/uio/uio_hv_generic.c b/drivers/uio/uio_hv_generic.c
index 0e1e8cf89f34..da5c1496082c 100644
--- a/drivers/uio/uio_hv_generic.c
+++ b/drivers/uio/uio_hv_generic.c
@@ -227,10 +227,10 @@  hv_uio_probe(struct hv_device *dev,
 	/* mem resources */
 	pdata->info.mem[TXRX_RING_MAP].name = "txrx_rings";
 	pdata->info.mem[TXRX_RING_MAP].addr
-		= (uintptr_t)page_address(dev->channel->ringbuffer_page);
+		= (uintptr_t)virt_to_phys(page_address(dev->channel->ringbuffer_page));
 	pdata->info.mem[TXRX_RING_MAP].size
 		= dev->channel->ringbuffer_pagecount << PAGE_SHIFT;
-	pdata->info.mem[TXRX_RING_MAP].memtype = UIO_MEM_LOGICAL;
+	pdata->info.mem[TXRX_RING_MAP].memtype = UIO_MEM_IOVA;
 
 	pdata->info.mem[INT_PAGE_MAP].name = "int_page";
 	pdata->info.mem[INT_PAGE_MAP].addr