From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5E4D2606A31F for ; Sat, 24 Oct 2026 13:22:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key, unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=fmTJcsIG Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 38AC640658; Sat, 24 Oct 2026 15:22:08 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id DEBBF40663 for ; Sat, 24 Oct 2026 15:22:06 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1792848126; 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=lQbiSFc7dfbcjJkI6uNLx03SpEWH+bBrbbX3RDm8gFo=; b=fmTJcsIG/EdwG4v3nW5EdzGjZQvsUI+qNdrIGjtFrbdGLLlEsmetNP3n2RfB70dmA5Vhk6 z1sHMQqHmZPjeylF9dZx9KN9vqncHMB43GREijFrPX+eMM6b/6h/FnzKNK/bcyyngU53LF lgvUb0t5rk0yZ/ytWk7YKisgvYPtNZs= 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-619-jwQ3q2fWNKu1_-yKFUTDgA-1; Sat, 24 Oct 2026 09:22:02 -0400 X-MC-Unique: jwQ3q2fWNKu1_-yKFUTDgA-1 X-Mimecast-MFC-AGG-ID: jwQ3q2fWNKu1_-yKFUTDgA_1792848121 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 5BA8C1955F78; Sat, 24 Oct 2026 13:22:01 +0000 (UTC) Received: from dmarchan.redhat.corp (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 689841956087; Sat, 24 Oct 2026 13:21:59 +0000 (UTC) From: David Marchand To: dev@dpdk.org Cc: stephen@networkplumber.org, hkalra@marvell.com, anatoly.burakov@intel.com, Chenbo Xia , Nipun Gupta , Thomas Monjalon Subject: [PATCH v2 04/12] bus/pci: reset VFIO device FD after release Date: Sat, 24 Oct 2026 15:21:29 +0200 Message-ID: <20261024132138.7239-5-david.marchand@redhat.com> In-Reply-To: <20261024132138.7239-1-david.marchand@redhat.com> References: <20261021092318.1554295-1-david.marchand@redhat.com> <20261024132138.7239-1-david.marchand@redhat.com> X-Archived-By: 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: 71qg07mVfXVwYvidVFFQ8pdcjnmAyHzvUu3Mo913g-o_1792848121 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-Archive: List-Post: List-Help: List-Subscribe: , X-Spam-Status: No, score=-16.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 From: Stephen Hemminger The VFIO device fd is closed by dev_vfio_release_device() but is left in the interrupt handle, so freeing the handle on cleanup logs a bogus FD leak warning. Mark dev_fd invalid after release. In secondary process the request handle is unused and does not have to be set in the first place. Fixes: d770ee9caed0 ("interrupts: warn on leaked FDs") Signed-off-by: Stephen Hemminger Signed-off-by: David Marchand --- drivers/bus/pci/linux/pci_vfio.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/bus/pci/linux/pci_vfio.c b/drivers/bus/pci/linux/pci_vfio.c index fb35bc1d49..c81d20200d 100644 --- a/drivers/bus/pci/linux/pci_vfio.c +++ b/drivers/bus/pci/linux/pci_vfio.c @@ -998,8 +998,6 @@ 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_map; - if (rte_intr_dev_fd_set(dev->vfio_req_intr_handle, vfio_dev_fd)) - goto err_map; return 0; err_map: @@ -1103,6 +1101,7 @@ pci_vfio_unmap_resource_primary(struct rte_pci_device *dev) PCI_LOG(ERR, "Cannot release VFIO device"); return ret; } + rte_intr_dev_fd_set(dev->intr_handle, -1); vfio_res_list = RTE_TAILQ_CAST(dev_vfio_tailq.head, mapped_pci_res_list); @@ -1142,6 +1141,7 @@ pci_vfio_unmap_resource_secondary(struct rte_pci_device *dev) PCI_LOG(ERR, "Cannot release VFIO device"); return ret; } + rte_intr_dev_fd_set(dev->intr_handle, -1); vfio_res_list = RTE_TAILQ_CAST(dev_vfio_tailq.head, mapped_pci_res_list); -- 2.54.0