From patchwork Tue Sep 25 03:10:01 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xiao Wang X-Patchwork-Id: 45281 X-Patchwork-Delegate: qi.z.zhang@intel.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id B19591B3A7; Tue, 25 Sep 2018 05:17:56 +0200 (CEST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id 433A51B396 for ; Tue, 25 Sep 2018 05:17:55 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 24 Sep 2018 20:17:54 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,300,1534834800"; d="scan'208";a="75650471" Received: from dpdk-xiao-1.sh.intel.com ([10.67.111.123]) by orsmga007.jf.intel.com with ESMTP; 24 Sep 2018 20:17:46 -0700 From: Xiao Wang To: qi.z.zhang@intel.com Cc: dev@dpdk.org, xiaolong.ye@intel.com, Xiao Wang Date: Tue, 25 Sep 2018 11:10:01 +0800 Message-Id: <20180925031001.164277-1-xiao.w.wang@intel.com> X-Mailer: git-send-email 2.15.1 Subject: [dpdk-dev] [PATCH] net/ifc: fix function name X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 Acked-by: Ye Xiaolong --- 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;