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 0F730CA5FF1 for ; Wed, 7 Oct 2026 07:32:33 +0000 (UTC) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 39BB8427C1; Wed, 7 Oct 2026 09:32:29 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id CFCE142D66 for ; Wed, 7 Oct 2026 09:32:27 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1791358347; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=6boipLWKg3BBx9yEaqLVnO7KBpmd8t6bf1FFUV86D8Y=; b=UIAWpNj/vAigoCQMKQCjm96R7Q9qZsCoPLe85vPtU6tqlrlv+5zMQMilCFQsaTCjI8CKQp Y1rNUouEwZYunOd2e4YvmEgLOH5uPlUHM6NT2j7UVT5+CuYniYZkDkKIgn78yb0XtMpRqR 53t2kOel5LtPNcx/KIghpPF4QO/t7hc= Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-96-44AptzwBNSeRptWQf6UlKw-1; Wed, 7 Oct 2026 07:32:23 +0000 X-MC-Unique: 44AptzwBNSeRptWQf6UlKw-1 X-Mimecast-MFC-AGG-ID: 44AptzwBNSeRptWQf6UlKw_1791358341 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id C5F02195FCEC; Wed, 7 Oct 2026 07:32:21 +0000 (UTC) Received: from dmarchan.redhat.corp (headnet03.pony-001.prod.iad2.dc.redhat.com [10.2.32.114]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 9A0391956087; Wed, 7 Oct 2026 07:32:20 +0000 (UTC) From: David Marchand To: dev@dpdk.org Cc: Anatoly Burakov , Chenbo Xia , Nipun Gupta Subject: [PATCH v19 03/26] bus/pci: rename mismatching error labels Date: Wed, 7 Oct 2026 09:31:41 +0200 Message-ID: <20261007073206.567001-4-david.marchand@redhat.com> In-Reply-To: <20261007073206.567001-1-david.marchand@redhat.com> References: <20261007073206.567001-1-david.marchand@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: 8O0_-3GAPEzuqejVGxSYJhM3SdrFWnj44n6oaIEJQ8U_1791358341 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit content-type: text/plain; charset="US-ASCII"; x-default=true 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 From: Anatoly Burakov 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 bc5c5c2499..a67de6ea02 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: rte_vfio_release_device(rte_pci_get_sysfs_path(), pci_addr, vfio_dev_fd); return -1; -- 2.54.0