DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/ifc: fix function name
@ 2018-09-25  3:10 Xiao Wang
  2018-10-10  9:41 ` Ye Xiaolong
  0 siblings, 1 reply; 3+ messages in thread
From: Xiao Wang @ 2018-09-25  3:10 UTC (permalink / raw)
  To: qi.z.zhang; +Cc: dev, xiaolong.ye, Xiao Wang

The address translation from user virtual address to guest physical
address should not be named as qva_to_gpa.

Fixes: a3f8150eac6d ("net/ifcvf: add ifcvf vDPA driver")

Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
---
 drivers/net/ifc/ifcvf_vdpa.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/net/ifc/ifcvf_vdpa.c b/drivers/net/ifc/ifcvf_vdpa.c
index 7d3085d8d..a26da8086 100644
--- a/drivers/net/ifc/ifcvf_vdpa.c
+++ b/drivers/net/ifc/ifcvf_vdpa.c
@@ -206,7 +206,7 @@ ifcvf_dma_map(struct ifcvf_internal *internal, int do_map)
 }
 
 static uint64_t
-qva_to_gpa(int vid, uint64_t qva)
+hva_to_gpa(int vid, uint64_t hva)
 {
 	struct rte_vhost_memory *mem = NULL;
 	struct rte_vhost_mem_region *reg;
@@ -219,9 +219,9 @@ qva_to_gpa(int vid, uint64_t qva)
 	for (i = 0; i < mem->nregions; i++) {
 		reg = &mem->regions[i];
 
-		if (qva >= reg->host_user_addr &&
-				qva < reg->host_user_addr + reg->size) {
-			gpa = qva - reg->host_user_addr + reg->guest_phys_addr;
+		if (hva >= reg->host_user_addr &&
+				hva < reg->host_user_addr + reg->size) {
+			gpa = hva - reg->host_user_addr + reg->guest_phys_addr;
 			break;
 		}
 	}
@@ -247,21 +247,21 @@ vdpa_ifcvf_start(struct ifcvf_internal *internal)
 
 	for (i = 0; i < nr_vring; i++) {
 		rte_vhost_get_vhost_vring(vid, i, &vq);
-		gpa = qva_to_gpa(vid, (uint64_t)(uintptr_t)vq.desc);
+		gpa = hva_to_gpa(vid, (uint64_t)(uintptr_t)vq.desc);
 		if (gpa == 0) {
 			DRV_LOG(ERR, "Fail to get GPA for descriptor ring.");
 			return -1;
 		}
 		hw->vring[i].desc = gpa;
 
-		gpa = qva_to_gpa(vid, (uint64_t)(uintptr_t)vq.avail);
+		gpa = hva_to_gpa(vid, (uint64_t)(uintptr_t)vq.avail);
 		if (gpa == 0) {
 			DRV_LOG(ERR, "Fail to get GPA for available ring.");
 			return -1;
 		}
 		hw->vring[i].avail = gpa;
 
-		gpa = qva_to_gpa(vid, (uint64_t)(uintptr_t)vq.used);
+		gpa = hva_to_gpa(vid, (uint64_t)(uintptr_t)vq.used);
 		if (gpa == 0) {
 			DRV_LOG(ERR, "Fail to get GPA for used ring.");
 			return -1;
-- 
2.15.1

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-dev] [PATCH] net/ifc: fix function name
  2018-09-25  3:10 [dpdk-dev] [PATCH] net/ifc: fix function name Xiao Wang
@ 2018-10-10  9:41 ` Ye Xiaolong
  2018-10-11  3:09   ` Zhang, Qi Z
  0 siblings, 1 reply; 3+ messages in thread
From: Ye Xiaolong @ 2018-10-10  9:41 UTC (permalink / raw)
  To: Xiao Wang; +Cc: qi.z.zhang, dev

Acked-by: Ye Xiaolong <xiaolong.ye@intel.com>

Thanks,
Xiaolong

On 09/25, Xiao Wang wrote:
>The address translation from user virtual address to guest physical
>address should not be named as qva_to_gpa.
>
>Fixes: a3f8150eac6d ("net/ifcvf: add ifcvf vDPA driver")
>
>Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
>---
> drivers/net/ifc/ifcvf_vdpa.c | 14 +++++++-------
> 1 file changed, 7 insertions(+), 7 deletions(-)
>
>diff --git a/drivers/net/ifc/ifcvf_vdpa.c b/drivers/net/ifc/ifcvf_vdpa.c
>index 7d3085d8d..a26da8086 100644
>--- a/drivers/net/ifc/ifcvf_vdpa.c
>+++ b/drivers/net/ifc/ifcvf_vdpa.c
>@@ -206,7 +206,7 @@ ifcvf_dma_map(struct ifcvf_internal *internal, int do_map)
> }
> 
> static uint64_t
>-qva_to_gpa(int vid, uint64_t qva)
>+hva_to_gpa(int vid, uint64_t hva)
> {
> 	struct rte_vhost_memory *mem = NULL;
> 	struct rte_vhost_mem_region *reg;
>@@ -219,9 +219,9 @@ qva_to_gpa(int vid, uint64_t qva)
> 	for (i = 0; i < mem->nregions; i++) {
> 		reg = &mem->regions[i];
> 
>-		if (qva >= reg->host_user_addr &&
>-				qva < reg->host_user_addr + reg->size) {
>-			gpa = qva - reg->host_user_addr + reg->guest_phys_addr;
>+		if (hva >= reg->host_user_addr &&
>+				hva < reg->host_user_addr + reg->size) {
>+			gpa = hva - reg->host_user_addr + reg->guest_phys_addr;
> 			break;
> 		}
> 	}
>@@ -247,21 +247,21 @@ vdpa_ifcvf_start(struct ifcvf_internal *internal)
> 
> 	for (i = 0; i < nr_vring; i++) {
> 		rte_vhost_get_vhost_vring(vid, i, &vq);
>-		gpa = qva_to_gpa(vid, (uint64_t)(uintptr_t)vq.desc);
>+		gpa = hva_to_gpa(vid, (uint64_t)(uintptr_t)vq.desc);
> 		if (gpa == 0) {
> 			DRV_LOG(ERR, "Fail to get GPA for descriptor ring.");
> 			return -1;
> 		}
> 		hw->vring[i].desc = gpa;
> 
>-		gpa = qva_to_gpa(vid, (uint64_t)(uintptr_t)vq.avail);
>+		gpa = hva_to_gpa(vid, (uint64_t)(uintptr_t)vq.avail);
> 		if (gpa == 0) {
> 			DRV_LOG(ERR, "Fail to get GPA for available ring.");
> 			return -1;
> 		}
> 		hw->vring[i].avail = gpa;
> 
>-		gpa = qva_to_gpa(vid, (uint64_t)(uintptr_t)vq.used);
>+		gpa = hva_to_gpa(vid, (uint64_t)(uintptr_t)vq.used);
> 		if (gpa == 0) {
> 			DRV_LOG(ERR, "Fail to get GPA for used ring.");
> 			return -1;
>-- 
>2.15.1
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-dev] [PATCH] net/ifc: fix function name
  2018-10-10  9:41 ` Ye Xiaolong
@ 2018-10-11  3:09   ` Zhang, Qi Z
  0 siblings, 0 replies; 3+ messages in thread
From: Zhang, Qi Z @ 2018-10-11  3:09 UTC (permalink / raw)
  To: Ye, Xiaolong, Wang, Xiao W; +Cc: dev



> -----Original Message-----
> From: Ye, Xiaolong
> Sent: Wednesday, October 10, 2018 2:42 AM
> To: Wang, Xiao W <xiao.w.wang@intel.com>
> Cc: Zhang, Qi Z <qi.z.zhang@intel.com>; dev@dpdk.org
> Subject: Re: [PATCH] net/ifc: fix function name
> 
> Acked-by: Ye Xiaolong <xiaolong.ye@intel.com>
> 
> Thanks,
> Xiaolong
> 
> On 09/25, Xiao Wang wrote:
> >The address translation from user virtual address to guest physical
> >address should not be named as qva_to_gpa.
> >
> >Fixes: a3f8150eac6d ("net/ifcvf: add ifcvf vDPA driver")
> >
> >Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>

Applied to dpdk-next-net-intel.

Thanks
Qi

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-10-11  3:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-25  3:10 [dpdk-dev] [PATCH] net/ifc: fix function name Xiao Wang
2018-10-10  9:41 ` Ye Xiaolong
2018-10-11  3:09   ` Zhang, Qi Z

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).