From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 8BA84469DB for ; Tue, 17 Jun 2025 20:38:06 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 85E6B40F1A; Tue, 17 Jun 2025 20:38:06 +0200 (CEST) Received: from mx2.freebsd.org (mx2.freebsd.org [96.47.72.81]) by mails.dpdk.org (Postfix) with ESMTP id 0A62340F1A for ; Tue, 17 Jun 2025 20:38:06 +0200 (CEST) Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits)) (Client CN "mx1.freebsd.org", Issuer "R10" (verified OK)) by mx2.freebsd.org (Postfix) with ESMTPS id 4bMFx83nbWz3pNB; Tue, 17 Jun 2025 18:38:04 +0000 (UTC) (envelope-from jfree@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bMFx81PPmz3cW1; Tue, 17 Jun 2025 18:38:04 +0000 (UTC) (envelope-from jfree@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750185484; 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=MzglgDedUMPlDBfLZGHBa0jhmH4qkR37gtI5mqNf6lc=; b=TWsuJU797nFFMBqTyJCsZpKwq797bSExVyN+Yui0ETU0wIECTRTRgfOSYZpGrQyV4F9AFT 9p4sciWhGQ7wlYG9Iw4kc9PR1LQcS4krLCDl8N3QJNGXGX/FhdFAlazKiDoymzL9XOCZu2 4oG++gmxzyShazh6aobpuzhL/SffgYKYHxMhljgYRFgIoOoEXxDMNegVYRED936cOO1D47 eWK652cgy48AucJQQl8N/o2PfH6PTaeEcDNjhgUU2kSDSKNNDqtESTzIIrVPHuHiVigp2P WtF7XUr8t/Ps/FLxt6vuq87/Hfuw/bPIgaFB/f7fgOKqt7zoxhFSVuQhvSTJ7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750185484; 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=MzglgDedUMPlDBfLZGHBa0jhmH4qkR37gtI5mqNf6lc=; b=L/1YVHXvZCjCqHDkXa4VBVP5iExSsROpehXgsSfvPigqymWsE+StcMJh+WYnWjQINTMD7v 23qqO1nOwYHNJfCLGe1iTWWnD1MyH81ilY2sNG8HsrZTA5eseF5U9ixJHk4lyYd3Uk0wbl N1IvjexNsh1rvtD5VAwy9Pn83Koyr293vNWnRedXvB2IzICi+gzxlpgUZR3xElLdqnL6rs gY99qDRKEQT5mJ0xWRQtKxCaZJcsFUtB5DoJQHEPo7xn5ir1aDcXWCtDDItMVAycI9pKNZ TvJ+LQl0d0uXGwB7+jFQcJjkuC+wXqRMGXmM4GPKieRV5iBKFsJxJ5NeS7b5eQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750185484; a=rsa-sha256; cv=none; b=Wmjf2BWKGYsrP+HmX9dg2lF/CRo6FNRYoN1yXyyKs32W0zxlnEQCznW0RHM1biPN1VzrDu IOthPXezEbs9ezkrOzVqBj2Wmq/Rou+pXQA+vrvsVYjiXS3wiHqO6I4DsYtF65GoclqtNz 6ukW5bQZkcFNIePHjV5+GIYeGmfyGKRQVNX5CnA+Ues4istEbHUXeox785aFzVfrUIkxg8 YyEhn9N+g2f6buoOK9oCIbZ1zG/6MUciKlJnskLUdwwB2rDFak+sSlcDfU92VJqblMSH/s nk1b8QpUMn47rkV06t5pUceIHjiM8tvYqKbjc9Nm0gApMcVXT52xIUc9mGu/Eg== Received: from localhost (67-4-139-203.mpls.qwest.net [67.4.139.203]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: jfree) by smtp.freebsd.org (Postfix) with ESMTPSA id 4bMFx774Znz68t; Tue, 17 Jun 2025 18:38:03 +0000 (UTC) (envelope-from jfree@freebsd.org) Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Tue, 17 Jun 2025 13:38:03 -0500 Message-Id: Cc: "Anatoly Burakov" , "dpdk stable" Subject: Re: patch 'bus/pci/bsd: fix device existence check' has been queued to stable release 22.11.9 From: "Jake Freeland" To: X-Mailer: aerc 0.20.1 References: <20250612210733.2506558-1-luca.boccassi@gmail.com> <20250612210733.2506558-65-luca.boccassi@gmail.com> In-Reply-To: <20250612210733.2506558-65-luca.boccassi@gmail.com> X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org On Thu Jun 12, 2025 at 4:07 PM CDT, luca.boccassi wrote: > Hi, > > FYI, your patch has been queued to stable release 22.11.9 > > Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. > It will be pushed if I get no objections before 06/14/25. So please > shout if anyone has objections. > > Also note that after the patch there's a diff of the upstream commit vs t= he > patch applied to the branch. This will indicate if there was any rebasing > needed to apply to the stable branch. If there were code changes for reba= sing > (ie: not only metadata diffs), please double check that the rebase was > correctly done. I'm a little late, but the rebase diff looks good to me. Thanks, Jake Freeland > Queued patches are on a temporary branch at: > https://github.com/bluca/dpdk-stable > > This queued commit can be viewed at: > https://github.com/bluca/dpdk-stable/commit/605117a0ccd604b73b4de19fadd24= e228329a930 > > Thanks. > > Luca Boccassi > > --- > From 605117a0ccd604b73b4de19fadd24e228329a930 Mon Sep 17 00:00:00 2001 > From: Jake Freeland > Date: Tue, 6 May 2025 12:40:44 -0500 > Subject: [PATCH] bus/pci/bsd: fix device existence check > > [ upstream commit 6d4e6dbccc3bd965bfd5e5836d7cb21c1b1f9c6c ] > > Use open(2) instead of access(2) to check for the existence of the target > device. This avoids a possible race condition where the device file is > removed after a successful call to access(2) but before open(2). > > This also fixes any potential bugs associated with passing open(2)-style > flags into access(2). i.e. access(2) does not formally support the O_RDWR > flag. > > Fixes: 764bf26873b9 ("add FreeBSD support") > > Signed-off-by: Jake Freeland > Acked-by: Anatoly Burakov > --- > drivers/bus/pci/bsd/pci.c | 17 ++++++++++++----- > 1 file changed, 12 insertions(+), 5 deletions(-) > > diff --git a/drivers/bus/pci/bsd/pci.c b/drivers/bus/pci/bsd/pci.c > index 7459d15c7e..b11cfdd450 100644 > --- a/drivers/bus/pci/bsd/pci.c > +++ b/drivers/bus/pci/bsd/pci.c > @@ -105,20 +105,27 @@ pci_uio_alloc_resource(struct rte_pci_device *dev, > { > char devname[PATH_MAX]; /* contains the /dev/uioX */ > struct rte_pci_addr *loc; > + int fd; > =20 > loc =3D &dev->addr; > =20 > snprintf(devname, sizeof(devname), "/dev/uio@pci:%u:%u:%u", > dev->addr.bus, dev->addr.devid, dev->addr.function); > =20 > - if (access(devname, O_RDWR) < 0) { > - RTE_LOG(WARNING, EAL, " "PCI_PRI_FMT" not managed by UIO driver, " > - "skipping\n", loc->domain, loc->bus, loc->devid, loc->function); > - return 1; > + fd =3D open(devname, O_RDWR); > + if (fd < 0) { > + if (errno =3D=3D ENOENT) { > + RTE_LOG(WARNING, EAL, PCI_PRI_FMT" not managed by UIO driver, skippin= g\n", > + loc->domain, loc->bus, loc->devid, loc->function); > + return 1; > + } > + RTE_LOG(ERR, EAL, "Failed to open device file for " PCI_PRI_FMT " (%s)= \n", > + loc->domain, loc->bus, loc->devid, loc->function, devname); > + return -1; > } > =20 > /* save fd if in primary process */ > - if (rte_intr_fd_set(dev->intr_handle, open(devname, O_RDWR))) { > + if (rte_intr_fd_set(dev->intr_handle, fd)) { > RTE_LOG(WARNING, EAL, "Failed to save fd"); > goto error; > }