From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by smtp.lore.kernel.org (Postfix) with ESMTP id ABB41C79FB9 for ; Thu, 10 Sep 2026 12:54:27 +0000 (UTC) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C642842D2E; Thu, 10 Sep 2026 14:53:37 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.21]) by mails.dpdk.org (Postfix) with ESMTP id 33B0540F1A for ; Thu, 10 Sep 2026 14:53:35 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1789044815; x=1820580815; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=glmbyHUhSZ6caaMa6MeZ6gTBds6KN3bGQQubqgI2hhM=; b=PCqSHJJGIZAozmHWlNVvy+P+XWg6vcR3eQyk84r8YeqXFCBw/7n27aQs 0ejzqsFK8ok67sgSfEFJDnmBSnWt8ZkOnjQ5WEN4OicVWieB2twMxp+sO gpKJ73MFSq7Mlf/Bf/mEgDkQmCTu9oIX6EyhkitEeAvhTM6+s0D1Uo14R Pmj/HTVJuqD/u8DHS9CHZptMiHRif+HRZ0Jcfq3bVrE3SOyP1aaNUbUEn +7zOPJDak2ci01tWA2nMkH/BQsVI4/prNddeD6j82a3Pk0KC+UBwv4Vy+ gp4HJn5c99NOveXa6UF1mKqWLgbuAVtw/Vs7BG5kp4UdMRZh02T7QJUm7 g==; X-CSE-ConnectionGUID: khkZn0mhTbqEAdlv4RA5Zg== X-CSE-MsgGUID: vGejLDneSIK86QhwnVwz6w== X-IronPort-AV: E=McAfee;i="6800,10657,11900"; a="89334047" X-IronPort-AV: E=Sophos;i="6.27,95,1787036400"; d="scan'208";a="89334047" Received: from fmviesa003.fm.intel.com ([10.60.135.143]) by orvoesa113.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Sep 2026 05:53:34 -0700 X-CSE-ConnectionGUID: xiBt0qEyTHWRxlQcyt+mtw== X-CSE-MsgGUID: K9dSdnV8SJiqBtL9N5x/8g== X-ExtLoop1: 1 Received: from silpixa00401119.ir.intel.com ([10.20.224.206]) by fmviesa003.fm.intel.com with ESMTP; 10 Sep 2026 05:53:34 -0700 From: Anatoly Burakov To: dev@dpdk.org, Chenbo Xia , Nipun Gupta Subject: [PATCH v17 09/26] bus/pci: rename mismatching error labels Date: Thu, 10 Sep 2026 13:52:53 +0100 Message-ID: <7b349e7695d7e01224377f815616eda34a01b641.1789044747.git.anatoly.burakov@intel.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Currently, there are two VFIO map functions - primary and secondary - that use a very similar goto error pattern. However, the label names are confusing. Specifically, for primary, we have three error labels: vfio_res (release VFIO resource), vfio_dev_fd (close the fd), and map (unmap all the mapped regions). For secondary, there is vfio_dev (close the fd), and vfio_dev_fd (unmap all mapped regions). For consistency, align secondary process function's error labels to match semantics of how they work in primary process function. Signed-off-by: Anatoly Burakov --- drivers/bus/pci/linux/pci_vfio.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/bus/pci/linux/pci_vfio.c b/drivers/bus/pci/linux/pci_vfio.c index 71afc383e6..3e87e759f5 100644 --- a/drivers/bus/pci/linux/pci_vfio.c +++ b/drivers/bus/pci/linux/pci_vfio.c @@ -968,7 +968,7 @@ pci_vfio_map_resource_secondary(struct rte_pci_device *dev) ret = pci_vfio_fill_regions(dev, vfio_dev_fd, &device_info); if (ret) - goto err_vfio_dev; + goto err_vfio_dev_fd; /* map BARs */ maps = vfio_res->maps; @@ -979,14 +979,14 @@ pci_vfio_map_resource_secondary(struct rte_pci_device *dev) if (ret < 0) { PCI_LOG(ERR, "%s sparse mapping BAR%i failed: %s", pci_addr, i, strerror(errno)); - goto err_vfio_dev_fd; + goto err_map; } } else { ret = pci_vfio_mmap_bar(vfio_dev_fd, vfio_res, i, MAP_FIXED); if (ret < 0) { PCI_LOG(ERR, "%s mapping BAR%i failed: %s", pci_addr, i, strerror(errno)); - goto err_vfio_dev_fd; + goto err_map; } } @@ -995,17 +995,17 @@ pci_vfio_map_resource_secondary(struct rte_pci_device *dev) /* we need save vfio_dev_fd, so it can be used during release */ if (rte_intr_dev_fd_set(dev->intr_handle, vfio_dev_fd)) - goto err_vfio_dev_fd; + goto err_map; if (rte_intr_dev_fd_set(dev->vfio_req_intr_handle, vfio_dev_fd)) - goto err_vfio_dev_fd; + goto err_map; return 0; -err_vfio_dev_fd: +err_map: for (j = 0; j < i; j++) { if (maps[j].addr) pci_unmap_resource(maps[j].addr, maps[j].size); } -err_vfio_dev: +err_vfio_dev_fd: dev_vfio_release_device(rte_pci_get_sysfs_path(), pci_addr, vfio_dev_fd); return -1; -- 2.52.0