From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id C49FDA0093 for ; Thu, 28 May 2020 18:25:10 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id BA4D81DC13; Thu, 28 May 2020 18:25:10 +0200 (CEST) Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) by dpdk.org (Postfix) with ESMTP id 86FD31DC1D for ; Thu, 28 May 2020 18:25:07 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1590683106; 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=fJi87qs4AfkDMO3ZNPDuDsvwSXjwoQP7bOjMrv8srJo=; b=BMz4GL1LYqzB8NYMOBFg4nm1ZOmbEf6zABtxZ1ZwCl8+2QUntILgzHCd+uMCim7NticJm+ CbHirEVyDQbzRFkMRDniouJ0SDBo2XO68Vy9AB+C6IddQ0j7z8ZS57C8FnbnQcFDYzXn9M oksZkTkEofPICrC80bImqy9wkYbVLcA= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-500-SpMhvqf1McuUYBOkWkNT6w-1; Thu, 28 May 2020 12:25:03 -0400 X-MC-Unique: SpMhvqf1McuUYBOkWkNT6w-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 11C3018FE864; Thu, 28 May 2020 16:25:02 +0000 (UTC) Received: from rh.redhat.com (unknown [10.33.36.235]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0403F60C05; Thu, 28 May 2020 16:25:00 +0000 (UTC) From: Kevin Traynor To: Michael Haeuptle Cc: Darek Stojaczyk , Anatoly Burakov , dpdk stable Date: Thu, 28 May 2020 17:22:21 +0100 Message-Id: <20200528162322.7863-34-ktraynor@redhat.com> In-Reply-To: <20200528162322.7863-1-ktraynor@redhat.com> References: <20200528162322.7863-1-ktraynor@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'vfio: fix race condition with sysfs' has been queued to LTS release 18.11.9 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 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 Sender: "stable" Hi, FYI, your patch has been queued to LTS release 18.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/03/20. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the 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 rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Queued patches are on a temporary branch at: https://github.com/kevintraynor/dpdk-stable-queue This queued commit can be viewed at: https://github.com/kevintraynor/dpdk-stable-queue/commit/7deb7d41ace0b9cb9122ade23d5846340a042257 Thanks. Kevin. --- >From 7deb7d41ace0b9cb9122ade23d5846340a042257 Mon Sep 17 00:00:00 2001 From: Michael Haeuptle Date: Mon, 6 Apr 2020 22:23:23 +0000 Subject: [PATCH] vfio: fix race condition with sysfs [ upstream commit b758423bc4fe412941a289f3181849669c02b904 ] This fix treats a 0 return value from vfio_open_group_fd in vfio_get_group_fd as the intended error condition instead of putting an incorrect 0 file descriptor in the vfio_group table. Sometimes, the creation of device files in sysfs is not instantaneously causing vfio_open_groupfd to return 0. This has been observed when hot removing/adding multiple NVMe devices (>=4). Fixes: 340b7bb8d583 ("vfio: extend data structure for multi container") Signed-off-by: Michael Haeuptle Acked-by: Darek Stojaczyk Acked-by: Anatoly Burakov --- lib/librte_eal/linuxapp/eal/eal_vfio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/librte_eal/linuxapp/eal/eal_vfio.c b/lib/librte_eal/linuxapp/eal/eal_vfio.c index 48d2abafaa..4a995e11b3 100644 --- a/lib/librte_eal/linuxapp/eal/eal_vfio.c +++ b/lib/librte_eal/linuxapp/eal/eal_vfio.c @@ -379,5 +379,5 @@ vfio_get_group_fd(struct vfio_config *vfio_cfg, vfio_group_fd = vfio_open_group_fd(iommu_group_num); - if (vfio_group_fd < 0) { + if (vfio_group_fd <= 0) { RTE_LOG(ERR, EAL, "Failed to open group %d\n", iommu_group_num); return -1; -- 2.21.3 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2020-05-28 17:13:00.915360883 +0100 +++ 0034-vfio-fix-race-condition-with-sysfs.patch 2020-05-28 17:12:59.094556559 +0100 @@ -1 +1 @@ -From b758423bc4fe412941a289f3181849669c02b904 Mon Sep 17 00:00:00 2001 +From 7deb7d41ace0b9cb9122ade23d5846340a042257 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit b758423bc4fe412941a289f3181849669c02b904 ] + @@ -16 +17,0 @@ -Cc: stable@dpdk.org @@ -22 +23 @@ - lib/librte_eal/linux/eal_vfio.c | 2 +- + lib/librte_eal/linuxapp/eal/eal_vfio.c | 2 +- @@ -25,5 +26,5 @@ -diff --git a/lib/librte_eal/linux/eal_vfio.c b/lib/librte_eal/linux/eal_vfio.c -index 4502aefed3..1979f6fdd8 100644 ---- a/lib/librte_eal/linux/eal_vfio.c -+++ b/lib/librte_eal/linux/eal_vfio.c -@@ -380,5 +380,5 @@ vfio_get_group_fd(struct vfio_config *vfio_cfg, +diff --git a/lib/librte_eal/linuxapp/eal/eal_vfio.c b/lib/librte_eal/linuxapp/eal/eal_vfio.c +index 48d2abafaa..4a995e11b3 100644 +--- a/lib/librte_eal/linuxapp/eal/eal_vfio.c ++++ b/lib/librte_eal/linuxapp/eal/eal_vfio.c +@@ -379,5 +379,5 @@ vfio_get_group_fd(struct vfio_config *vfio_cfg,