From patchwork Wed Oct 10 13:22:35 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xiaolong Ye X-Patchwork-Id: 46456 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 7626C1B203; Wed, 10 Oct 2018 08:35:26 +0200 (CEST) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by dpdk.org (Postfix) with ESMTP id AEE821B203 for ; Wed, 10 Oct 2018 08:35:24 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 09 Oct 2018 23:35:23 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,363,1534834800"; d="scan'208";a="90728858" Received: from yexl-server.sh.intel.com ([10.67.110.207]) by orsmga003.jf.intel.com with ESMTP; 09 Oct 2018 23:35:22 -0700 From: Xiaolong Ye To: dev@dpdk.org, Zhang Qi Z Cc: xiao.w.wang@intel.com, Xiaolong Ye Date: Wed, 10 Oct 2018 21:22:35 +0800 Message-Id: <20181010132235.70579-1-xiaolong.ye@intel.com> X-Mailer: git-send-email 2.17.1 Subject: [dpdk-dev] [PATCH] net/ifc: invoke ifcvf HW init function in probe 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" As ifcvf_init_hw is independent with ifcvf_vfio_setup, it's better to invoke it directly in probe func. Signed-off-by: Xiaolong Ye Acked-by: Xiao Wang --- drivers/net/ifc/ifcvf_vdpa.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/net/ifc/ifcvf_vdpa.c b/drivers/net/ifc/ifcvf_vdpa.c index 9d5594678..adc8f4166 100644 --- a/drivers/net/ifc/ifcvf_vdpa.c +++ b/drivers/net/ifc/ifcvf_vdpa.c @@ -112,7 +112,6 @@ ifcvf_vfio_setup(struct ifcvf_internal *internal) struct rte_pci_device *dev = internal->pdev; char devname[RTE_DEV_NAME_MAX_LEN] = {0}; int iommu_group_num; - int ret = 0; int i; internal->vfio_dev_fd = -1; @@ -146,9 +145,8 @@ ifcvf_vfio_setup(struct ifcvf_internal *internal) internal->hw.mem_resource[i].len = internal->pdev->mem_resource[i].len; } - ret = ifcvf_init_hw(&internal->hw, internal->pdev); - return ret; + return 0; err: rte_vfio_container_destroy(internal->vfio_container_fd); @@ -758,6 +756,9 @@ ifcvf_pci_probe(struct rte_pci_driver *pci_drv __rte_unused, if (ifcvf_vfio_setup(internal) < 0) return -1; + if (ifcvf_init_hw(&internal->hw, internal->pdev) < 0) + return -1; + internal->max_queues = IFCVF_MAX_QUEUES; features = ifcvf_get_features(&internal->hw); internal->features = (features &