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 43DF6A0093 for ; Tue, 19 May 2020 15:00:38 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 3C8301D620; Tue, 19 May 2020 15:00:38 +0200 (CEST) Received: from mail-wr1-f67.google.com (mail-wr1-f67.google.com [209.85.221.67]) by dpdk.org (Postfix) with ESMTP id 113EA1D620 for ; Tue, 19 May 2020 15:00:37 +0200 (CEST) Received: by mail-wr1-f67.google.com with SMTP id k13so13722270wrx.3 for ; Tue, 19 May 2020 06:00:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ltKcXd3abnB+W9VGiIvGGLbLbNpBIxNVArxuYeHhDBc=; b=E2zp4BQnsAI8kYs67iNeBcotVUH+PXGb3UTRTEwRq+TQbAVAL4MIlrSLmuXY7VYnWo 9z49AvNCURAnzgSqcmRZENIJ/QUWQI77VOAiBi+2fzrT0s5IpFglEg4FH5NKYyvBAQST 4sG4htMt9kKK0Ipg0u2SiWfBHkKxlhjauBnxQh9qd24zxreqUtrWNnfXUxZPgQMcdCX+ R/OOFWdXhYNK0AEBGVrOfnQKKHmbaH9+VDRRr2An//gLZ+jbc+7sV5svJOLKgPf1E0b0 WHJ0iQfPPAa9ElYccYtAq1Lc0AFMBzeiIhUTmAjdMVPaHbXqnFtnYl6S3LQhrljFd2lZ 4K0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ltKcXd3abnB+W9VGiIvGGLbLbNpBIxNVArxuYeHhDBc=; b=W+EK+bvrUrSEELwXygvrupMgwJKPF/0ApVC1NvFKLvXyzSDBJYrAuUeNss9r1WjyhL nPAo1j5KkjDp2IMas1xtYVuTuDCSHozdi71NA2ce6m50sxmO06m8qlNUD+joxPF1jxpK ShjTkF2uM9sUDx9PM66wzrP072AAn8EUDQkSqyNsJhitzaBQ/WKb7YDSjcmtlDOxzd/B uugWj5sm3rR/VGdoLgHLfpl9peg00P8BlPXhA6HUFBziN9xHPh7Tm9emYgfg8z+3UAlw zTXQDpsCazQQeLF+l/ipm9iOGBbAZFo3HIcl78bie3V997LPLlZyb56q2o15/MLHk5CG j4hg== X-Gm-Message-State: AOAM533aUtM3jIwYtmg75sEmc4Xgqw+brcRQkcsjPNvQw0opT2pJtj5o yws5UwG9JA5GRD5aeGzHQj6ozePhU7K9Xn2X X-Google-Smtp-Source: ABdhPJyuj+kJOc8JpyIN8MDa2Arh54Wwl6fSjjV5wyCF2kV6JDAio6bnKVq+tzoo7w6W+L3inPx9dQ== X-Received: by 2002:adf:dcc8:: with SMTP id x8mr25374689wrm.404.1589893236791; Tue, 19 May 2020 06:00:36 -0700 (PDT) Received: from localhost ([88.98.246.218]) by smtp.gmail.com with ESMTPSA id w18sm21080674wro.33.2020.05.19.06.00.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 May 2020 06:00:36 -0700 (PDT) From: luca.boccassi@gmail.com To: Michael Haeuptle Cc: Darek Stojaczyk , Anatoly Burakov , dpdk stable Date: Tue, 19 May 2020 13:54:23 +0100 Message-Id: <20200519125804.104349-73-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200519125804.104349-1-luca.boccassi@gmail.com> References: <20200519125804.104349-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'vfio: fix race condition with sysfs' has been queued to stable release 19.11.3 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 stable release 19.11.3 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 05/21/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. Thanks. Luca Boccassi --- >From 5732151922c287abf7c21b92291d041ef1cc0cdb 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/linux/eal/eal_vfio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/librte_eal/linux/eal/eal_vfio.c b/lib/librte_eal/linux/eal/eal_vfio.c index 01b5ef3f42..b82a5018bf 100644 --- a/lib/librte_eal/linux/eal/eal_vfio.c +++ b/lib/librte_eal/linux/eal/eal_vfio.c @@ -379,7 +379,7 @@ 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.20.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2020-05-19 13:56:21.770577448 +0100 +++ 0073-vfio-fix-race-condition-with-sysfs.patch 2020-05-19 13:56:18.299503260 +0100 @@ -1,8 +1,10 @@ -From b758423bc4fe412941a289f3181849669c02b904 Mon Sep 17 00:00:00 2001 +From 5732151922c287abf7c21b92291d041ef1cc0cdb 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. @@ -13,19 +15,18 @@ NVMe devices (>=4). Fixes: 340b7bb8d583 ("vfio: extend data structure for multi container") -Cc: stable@dpdk.org Signed-off-by: Michael Haeuptle Acked-by: Darek Stojaczyk Acked-by: Anatoly Burakov --- - lib/librte_eal/linux/eal_vfio.c | 2 +- + lib/librte_eal/linux/eal/eal_vfio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -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 +diff --git a/lib/librte_eal/linux/eal/eal_vfio.c b/lib/librte_eal/linux/eal/eal_vfio.c +index 01b5ef3f42..b82a5018bf 100644 +--- a/lib/librte_eal/linux/eal/eal_vfio.c ++++ b/lib/librte_eal/linux/eal/eal_vfio.c @@ -379,7 +379,7 @@ vfio_get_group_fd(struct vfio_config *vfio_cfg, }