diff mbox series

[02/14] drivers: change the deprecated memseg physaddr to iova

Message ID 1512710487-32388-3-git-send-email-hemant.agrawal@nxp.com
State Accepted
Commit 2aab833725cced38cd2596940f58c89857f7ec03
Headers show
Series DPAA2 PMD fixes and enhancements | expand

Commit Message

Hemant Agrawal Dec. 8, 2017, 5:21 a.m. UTC
DPAA and DPAA2 drivers were using memseg physaddr, which
has been deprecated.

Fixes: 7ba49d39f14c ("mem: rename segment address from physical to IOVA")
Cc: Santosh Shukla <santosh.shukla@caviumnetworks.com>
Cc: stable@dpdk.org

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>

---
 drivers/bus/dpaa/rte_dpaa_bus.h         | 6 +++---
 drivers/bus/fslmc/fslmc_vfio.c          | 2 +-
 drivers/bus/fslmc/portal/dpaa2_hw_pvt.h | 8 ++++----
 drivers/crypto/dpaa_sec/dpaa_sec.c      | 8 ++++----
 4 files changed, 12 insertions(+), 12 deletions(-)

-- 
2.7.4

Comments

santosh Dec. 8, 2017, 5:29 a.m. UTC | #1
On Friday 08 December 2017 10:51 AM, Hemant Agrawal wrote:
> DPAA and DPAA2 drivers were using memseg physaddr, which

> has been deprecated.

>

> Fixes: 7ba49d39f14c ("mem: rename segment address from physical to IOVA")

> Cc: Santosh Shukla <santosh.shukla@caviumnetworks.com>

> Cc: stable@dpdk.org

>

> Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>

> ---


LGTM:

Acked-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>


Thanks.
diff mbox series

Patch

diff --git a/drivers/bus/dpaa/rte_dpaa_bus.h b/drivers/bus/dpaa/rte_dpaa_bus.h
index eafc944..bc933af 100644
--- a/drivers/bus/dpaa/rte_dpaa_bus.h
+++ b/drivers/bus/dpaa/rte_dpaa_bus.h
@@ -113,10 +113,10 @@  static inline void *rte_dpaa_mem_ptov(phys_addr_t paddr)
 	int i;
 
 	for (i = 0; i < RTE_MAX_MEMSEG && memseg[i].addr != NULL; i++) {
-		if (paddr >= memseg[i].phys_addr && paddr <
-			memseg[i].phys_addr + memseg[i].len)
+		if (paddr >= memseg[i].iova && paddr <
+			memseg[i].iova + memseg[i].len)
 			return (uint8_t *)(memseg[i].addr) +
-			       (paddr - memseg[i].phys_addr);
+			       (paddr - memseg[i].iova);
 	}
 
 	return NULL;
diff --git a/drivers/bus/fslmc/fslmc_vfio.c b/drivers/bus/fslmc/fslmc_vfio.c
index 25c87ad..e47215c 100644
--- a/drivers/bus/fslmc/fslmc_vfio.c
+++ b/drivers/bus/fslmc/fslmc_vfio.c
@@ -249,7 +249,7 @@  int rte_fslmc_vfio_dmamap(void)
 		dma_map.size = memseg[i].len;
 		dma_map.vaddr = memseg[i].addr_64;
 #ifdef RTE_LIBRTE_DPAA2_USE_PHYS_IOVA
-		dma_map.iova = memseg[i].phys_addr;
+		dma_map.iova = memseg[i].iova;
 #else
 		dma_map.iova = dma_map.vaddr;
 #endif
diff --git a/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h b/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h
index c1b842f..ece1a7d 100644
--- a/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h
+++ b/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h
@@ -284,10 +284,10 @@  static void *dpaa2_mem_ptov(phys_addr_t paddr)
 	int i;
 
 	for (i = 0; i < RTE_MAX_MEMSEG && memseg[i].addr_64 != 0; i++) {
-		if (paddr >= memseg[i].phys_addr &&
-		   (char *)paddr < (char *)memseg[i].phys_addr + memseg[i].len)
+		if (paddr >= memseg[i].iova &&
+		   (char *)paddr < (char *)memseg[i].iova + memseg[i].len)
 			return (void *)(memseg[i].addr_64
-				+ (paddr - memseg[i].phys_addr));
+				+ (paddr - memseg[i].iova));
 	}
 	return NULL;
 }
@@ -301,7 +301,7 @@  static phys_addr_t dpaa2_mem_vtop(uint64_t vaddr)
 	for (i = 0; i < RTE_MAX_MEMSEG && memseg[i].addr_64 != 0; i++) {
 		if (vaddr >= memseg[i].addr_64 &&
 		    vaddr < memseg[i].addr_64 + memseg[i].len)
-			return memseg[i].phys_addr
+			return memseg[i].iova
 				+ (vaddr - memseg[i].addr_64);
 	}
 	return (phys_addr_t)(NULL);
diff --git a/drivers/crypto/dpaa_sec/dpaa_sec.c b/drivers/crypto/dpaa_sec/dpaa_sec.c
index 16155b1..438dd3b 100644
--- a/drivers/crypto/dpaa_sec/dpaa_sec.c
+++ b/drivers/crypto/dpaa_sec/dpaa_sec.c
@@ -121,7 +121,7 @@  dpaa_mem_vtop(void *vaddr)
 	for (i = 0; i < RTE_MAX_MEMSEG && memseg[i].addr_64 != 0; i++) {
 		if (vaddr_64 >= memseg[i].addr_64 &&
 		    vaddr_64 < memseg[i].addr_64 + memseg[i].len) {
-			paddr = memseg[i].phys_addr +
+			paddr = memseg[i].iova +
 				(vaddr_64 - memseg[i].addr_64);
 
 			return (rte_iova_t)paddr;
@@ -137,10 +137,10 @@  dpaa_mem_ptov(rte_iova_t paddr)
 	int i;
 
 	for (i = 0; i < RTE_MAX_MEMSEG && memseg[i].addr_64 != 0; i++) {
-		if (paddr >= memseg[i].phys_addr &&
-		    (char *)paddr < (char *)memseg[i].phys_addr + memseg[i].len)
+		if (paddr >= memseg[i].iova &&
+		    (char *)paddr < (char *)memseg[i].iova + memseg[i].len)
 			return (void *)(memseg[i].addr_64 +
-					(paddr - memseg[i].phys_addr));
+					(paddr - memseg[i].iova));
 	}
 	return NULL;
 }