[dpdk-stable] patch 'bus/fslmc: fix VFIO group descriptor check' has been queued to stable release 19.11.6

luca.boccassi at gmail.com luca.boccassi at gmail.com
Wed Oct 28 11:44:20 CET 2020


Hi,

FYI, your patch has been queued to stable release 19.11.6

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 10/30/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 9bff5af5271ac690d2b5ca9640ce0cc2d9bcb3e6 Mon Sep 17 00:00:00 2001
From: Yunjian Wang <wangyunjian at huawei.com>
Date: Tue, 19 May 2020 11:42:12 +0800
Subject: [PATCH] bus/fslmc: fix VFIO group descriptor check

[ upstream commit 4b10ae80272b1bec113fbf5848065b66f030c327 ]

The issue is that a file descriptor at 0 is a valid one. Currently
the file not found, the return value will be set to 0. As a result,
it is impossible to distinguish between a correct descriptor and a
failed return value. Fix it to return -ENOENT instead of 0.

Fixes: a69f79300262 ("bus/fslmc: support multi VFIO group")

Signed-off-by: Yunjian Wang <wangyunjian at huawei.com>
Acked-by: Anatoly Burakov <anatoly.burakov at intel.com>
Acked-by: Hemant Agrawal <hemant.agrawal at nxp.com>
---
 drivers/bus/fslmc/fslmc_vfio.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/drivers/bus/fslmc/fslmc_vfio.c b/drivers/bus/fslmc/fslmc_vfio.c
index abf2338440..bf9e3e49a5 100644
--- a/drivers/bus/fslmc/fslmc_vfio.c
+++ b/drivers/bus/fslmc/fslmc_vfio.c
@@ -448,11 +448,14 @@ fslmc_vfio_setup_device(const char *sysfs_base, const char *dev_addr,
 
 	/* get the actual group fd */
 	vfio_group_fd = rte_vfio_get_group_fd(iommu_group_no);
-	if (vfio_group_fd < 0)
+	if (vfio_group_fd < 0 && vfio_group_fd != -ENOENT)
 		return -1;
 
-	/* if group_fd == 0, that means the device isn't managed by VFIO */
-	if (vfio_group_fd == 0) {
+	/*
+	 * if vfio_group_fd == -ENOENT, that means the device
+	 * isn't managed by VFIO
+	 */
+	if (vfio_group_fd == -ENOENT) {
 		RTE_LOG(WARNING, EAL, " %s not managed by VFIO driver, skipping\n",
 				dev_addr);
 		return 1;
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-10-28 10:35:14.917830698 +0000
+++ 0101-bus-fslmc-fix-VFIO-group-descriptor-check.patch	2020-10-28 10:35:11.656832261 +0000
@@ -1,15 +1,16 @@
-From 4b10ae80272b1bec113fbf5848065b66f030c327 Mon Sep 17 00:00:00 2001
+From 9bff5af5271ac690d2b5ca9640ce0cc2d9bcb3e6 Mon Sep 17 00:00:00 2001
 From: Yunjian Wang <wangyunjian at huawei.com>
 Date: Tue, 19 May 2020 11:42:12 +0800
 Subject: [PATCH] bus/fslmc: fix VFIO group descriptor check
 
+[ upstream commit 4b10ae80272b1bec113fbf5848065b66f030c327 ]
+
 The issue is that a file descriptor at 0 is a valid one. Currently
 the file not found, the return value will be set to 0. As a result,
 it is impossible to distinguish between a correct descriptor and a
 failed return value. Fix it to return -ENOENT instead of 0.
 
 Fixes: a69f79300262 ("bus/fslmc: support multi VFIO group")
-Cc: stable at dpdk.org
 
 Signed-off-by: Yunjian Wang <wangyunjian at huawei.com>
 Acked-by: Anatoly Burakov <anatoly.burakov at intel.com>
@@ -19,10 +20,10 @@
  1 file changed, 6 insertions(+), 3 deletions(-)
 
 diff --git a/drivers/bus/fslmc/fslmc_vfio.c b/drivers/bus/fslmc/fslmc_vfio.c
-index 9134ec5527..2e1803a185 100644
+index abf2338440..bf9e3e49a5 100644
 --- a/drivers/bus/fslmc/fslmc_vfio.c
 +++ b/drivers/bus/fslmc/fslmc_vfio.c
-@@ -457,11 +457,14 @@ fslmc_vfio_setup_device(const char *sysfs_base, const char *dev_addr,
+@@ -448,11 +448,14 @@ fslmc_vfio_setup_device(const char *sysfs_base, const char *dev_addr,
  
  	/* get the actual group fd */
  	vfio_group_fd = rte_vfio_get_group_fd(iommu_group_no);


More information about the stable mailing list