net/ifc: fix function name
PATCH 1/1 net/ifc: fix function name
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 <[email protected]>
--- drivers/net/ifc/ifcvf_vdpa.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
drivers/net/ifc/ifcvf_vdpa.c +7 -7
@@ -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 ;
Signature · 1 line
2.15.1
Acked-by Ye Xiaolong <[email protected]>
Thanks,
Xiaolong
Quoted 64 lines · 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 <[email protected]>---
drivers/net/ifc/ifcvf_vdpa.c| 14 +++++++-------1 file changed, 7 insertions(+), 7 deletions(-)drivers/net/ifc/ifcvf_vdpa.c +0
-0@@ -206,7 +206,7 @@ ifcvf_dma_map(struct ifcvf_internal *internal, int do_map) }static
uint64_tdrivers/net/ifc/ifcvf_vdpa.c +1
-1-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;drivers/net/ifc/ifcvf_vdpa.c +6
-6@@ -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 ;Signature · 1 line
2.15.1
Zhang, Qi Z
AppliedQuoted 9 lines
-----Original Message-----
From: Ye, Xiaolong
Sent: Wednesday, October 10, 2018 2:42 AM
To: Wang, Xiao W <[email protected]>
Cc: Zhang, Qi Z <[email protected]>; [email protected]
Subject: Re: [PATCH] net/ifc: fix function name
Quoted 12 lines
Acked-by Ye Xiaolong <[email protected]>Thanks,
XiaolongQuoted 6 lines · 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 <[email protected]>
Applied to dpdk-next-net-intel.
Thanks
Qi