[dpdk-stable] patch 'vfio: check if group fd is already open' has been queued to stable release 18.08.1

Kevin Traynor ktraynor at redhat.com
Fri Nov 23 11:26:12 CET 2018


Hi,

FYI, your patch has been queued to stable release 18.08.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 11/29/18. 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. If the code is different (ie: not only metadata diffs), due for example to
a change in context or macro names, please double check it.

Thanks.

Kevin Traynor

---
>From 9e8a431408f3538e4853dbaef7db72771e639065 Mon Sep 17 00:00:00 2001
From: Dariusz Stojaczyk <dariuszx.stojaczyk at intel.com>
Date: Mon, 17 Sep 2018 15:46:42 +0200
Subject: [PATCH] vfio: check if group fd is already open

[ upstream commit db9d32b8b73e3fc9e16f8a38e5b7f66a5df0e36a ]

Always attempt to find already opened fd for an iommu
group as subsequent attempts to open it will fail.

There's no public API to check if a group was already
bound and has a container, so rte_vfio_container_group_bind()
shouldn't fail in such case.

Fixes: ea2dc1066870 ("vfio: add multi container support")

Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk at intel.com>
Acked-by: Xiao Wang <xiao.w.wang at intel.com>
Acked-by: Anatoly Burakov <anatoly.burakov at intel.com>
---
 lib/librte_eal/linuxapp/eal/eal_vfio.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/lib/librte_eal/linuxapp/eal/eal_vfio.c b/lib/librte_eal/linuxapp/eal/eal_vfio.c
index 68e862946..957844ad8 100644
--- a/lib/librte_eal/linuxapp/eal/eal_vfio.c
+++ b/lib/librte_eal/linuxapp/eal/eal_vfio.c
@@ -1688,4 +1688,9 @@ rte_vfio_container_group_bind(int container_fd, int iommu_group_num)
 	}
 
+	/* check if we already have the group descriptor open */
+	for (i = 0; i < VFIO_MAX_GROUPS; i++)
+		if (vfio_cfg->vfio_groups[i].group_num == iommu_group_num)
+			return vfio_cfg->vfio_groups[i].fd;
+
 	/* Check room for new group */
 	if (vfio_cfg->vfio_active_groups == VFIO_MAX_GROUPS) {
-- 
2.19.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2018-11-23 10:22:54.453462731 +0000
+++ 0008-vfio-check-if-group-fd-is-already-open.patch	2018-11-23 10:22:54.000000000 +0000
@@ -1,8 +1,10 @@
-From db9d32b8b73e3fc9e16f8a38e5b7f66a5df0e36a Mon Sep 17 00:00:00 2001
+From 9e8a431408f3538e4853dbaef7db72771e639065 Mon Sep 17 00:00:00 2001
 From: Dariusz Stojaczyk <dariuszx.stojaczyk at intel.com>
 Date: Mon, 17 Sep 2018 15:46:42 +0200
 Subject: [PATCH] vfio: check if group fd is already open
 
+[ upstream commit db9d32b8b73e3fc9e16f8a38e5b7f66a5df0e36a ]
+
 Always attempt to find already opened fd for an iommu
 group as subsequent attempts to open it will fail.
 
@@ -11,7 +13,6 @@
 shouldn't fail in such case.
 
 Fixes: ea2dc1066870 ("vfio: add multi container support")
-Cc: stable at dpdk.org
 
 Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk at intel.com>
 Acked-by: Xiao Wang <xiao.w.wang at intel.com>
@@ -21,10 +22,10 @@
  1 file changed, 5 insertions(+)
 
 diff --git a/lib/librte_eal/linuxapp/eal/eal_vfio.c b/lib/librte_eal/linuxapp/eal/eal_vfio.c
-index ebecde12c..04c8f2e9c 100644
+index 68e862946..957844ad8 100644
 --- a/lib/librte_eal/linuxapp/eal/eal_vfio.c
 +++ b/lib/librte_eal/linuxapp/eal/eal_vfio.c
-@@ -1703,4 +1703,9 @@ rte_vfio_container_group_bind(int container_fd, int iommu_group_num)
+@@ -1688,4 +1688,9 @@ rte_vfio_container_group_bind(int container_fd, int iommu_group_num)
  	}
  
 +	/* check if we already have the group descriptor open */


More information about the stable mailing list