[dpdk-stable] patch 'vfio: set errno on unsupported OS' has been queued to stable release 20.11.4
Xueming Li
xuemingl at nvidia.com
Wed Nov 10 07:32:12 CET 2021
Hi,
FYI, your patch has been queued to stable release 20.11.4
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/12/21. 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/steevenlee/dpdk
This queued commit can be viewed at:
https://github.com/steevenlee/dpdk/commit/4298385935eef1e27cfcd12d75517a448d176be9
Thanks.
Xueming Li <xuemingl at nvidia.com>
---
>From 4298385935eef1e27cfcd12d75517a448d176be9 Mon Sep 17 00:00:00 2001
From: Anatoly Burakov <anatoly.burakov at intel.com>
Date: Thu, 28 Oct 2021 14:15:19 +0000
Subject: [PATCH] vfio: set errno on unsupported OS
Cc: Xueming Li <xuemingl at nvidia.com>
[ upstream commit 4fd15c6af0d4e065227a27cda9ec0ca1a563dc67 ]
Currently, when code is running on FreeBSD or Windows, there is no way
to distinguish between a geniune error and a "VFIO is unsupported"
error. Fix the dummy implementations to also set the rte_errno flag.
Fixes: 279b581c897d ("vfio: expose functions")
Fixes: c564a2a20093 ("vfio: expose clear group function for internal usages")
Fixes: 964b2f3bfb07 ("vfio: export some internal functions")
Fixes: ea2dc1066870 ("vfio: add multi container support")
Signed-off-by: Anatoly Burakov <anatoly.burakov at intel.com>
Acked-by: Chenbo Xia <chenbo.xia at intel.com>
Acked-by: Bruce Richardson <bruce.richardson at intel.com>
---
lib/librte_eal/freebsd/eal.c | 13 +++++++++++++
lib/librte_eal/windows/eal.c | 2 ++
2 files changed, 15 insertions(+)
diff --git a/lib/librte_eal/freebsd/eal.c b/lib/librte_eal/freebsd/eal.c
index 053ae65365..6f9f12911e 100644
--- a/lib/librte_eal/freebsd/eal.c
+++ b/lib/librte_eal/freebsd/eal.c
@@ -1014,6 +1014,7 @@ int rte_vfio_setup_device(__rte_unused const char *sysfs_base,
__rte_unused int *vfio_dev_fd,
__rte_unused struct vfio_device_info *device_info)
{
+ rte_errno = ENOTSUP;
return -1;
}
@@ -1021,11 +1022,13 @@ int rte_vfio_release_device(__rte_unused const char *sysfs_base,
__rte_unused const char *dev_addr,
__rte_unused int fd)
{
+ rte_errno = ENOTSUP;
return -1;
}
int rte_vfio_enable(__rte_unused const char *modname)
{
+ rte_errno = ENOTSUP;
return -1;
}
@@ -1041,6 +1044,7 @@ int rte_vfio_noiommu_is_enabled(void)
int rte_vfio_clear_group(__rte_unused int vfio_group_fd)
{
+ rte_errno = ENOTSUP;
return -1;
}
@@ -1049,30 +1053,35 @@ rte_vfio_get_group_num(__rte_unused const char *sysfs_base,
__rte_unused const char *dev_addr,
__rte_unused int *iommu_group_num)
{
+ rte_errno = ENOTSUP;
return -1;
}
int
rte_vfio_get_container_fd(void)
{
+ rte_errno = ENOTSUP;
return -1;
}
int
rte_vfio_get_group_fd(__rte_unused int iommu_group_num)
{
+ rte_errno = ENOTSUP;
return -1;
}
int
rte_vfio_container_create(void)
{
+ rte_errno = ENOTSUP;
return -1;
}
int
rte_vfio_container_destroy(__rte_unused int container_fd)
{
+ rte_errno = ENOTSUP;
return -1;
}
@@ -1080,6 +1089,7 @@ int
rte_vfio_container_group_bind(__rte_unused int container_fd,
__rte_unused int iommu_group_num)
{
+ rte_errno = ENOTSUP;
return -1;
}
@@ -1087,6 +1097,7 @@ int
rte_vfio_container_group_unbind(__rte_unused int container_fd,
__rte_unused int iommu_group_num)
{
+ rte_errno = ENOTSUP;
return -1;
}
@@ -1096,6 +1107,7 @@ rte_vfio_container_dma_map(__rte_unused int container_fd,
__rte_unused uint64_t iova,
__rte_unused uint64_t len)
{
+ rte_errno = ENOTSUP;
return -1;
}
@@ -1105,5 +1117,6 @@ rte_vfio_container_dma_unmap(__rte_unused int container_fd,
__rte_unused uint64_t iova,
__rte_unused uint64_t len)
{
+ rte_errno = ENOTSUP;
return -1;
}
diff --git a/lib/librte_eal/windows/eal.c b/lib/librte_eal/windows/eal.c
index abe4c4038d..892c69356d 100644
--- a/lib/librte_eal/windows/eal.c
+++ b/lib/librte_eal/windows/eal.c
@@ -446,6 +446,7 @@ rte_vfio_container_dma_map(__rte_unused int container_fd,
__rte_unused uint64_t iova,
__rte_unused uint64_t len)
{
+ rte_errno = ENOTSUP;
return -1;
}
@@ -455,5 +456,6 @@ rte_vfio_container_dma_unmap(__rte_unused int container_fd,
__rte_unused uint64_t iova,
__rte_unused uint64_t len)
{
+ rte_errno = ENOTSUP;
return -1;
}
--
2.33.0
---
Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- - 2021-11-10 14:17:12.800067594 +0800
+++ 0248-vfio-set-errno-on-unsupported-OS.patch 2021-11-10 14:17:02.090744291 +0800
@@ -1 +1 @@
-From 4fd15c6af0d4e065227a27cda9ec0ca1a563dc67 Mon Sep 17 00:00:00 2001
+From 4298385935eef1e27cfcd12d75517a448d176be9 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl at nvidia.com>
+
+[ upstream commit 4fd15c6af0d4e065227a27cda9ec0ca1a563dc67 ]
@@ -14 +16,0 @@
-Cc: stable at dpdk.org
@@ -20,2 +22,2 @@
- lib/eal/freebsd/eal.c | 13 +++++++++++++
- lib/eal/windows/eal.c | 2 ++
+ lib/librte_eal/freebsd/eal.c | 13 +++++++++++++
+ lib/librte_eal/windows/eal.c | 2 ++
@@ -24,5 +26,5 @@
-diff --git a/lib/eal/freebsd/eal.c b/lib/eal/freebsd/eal.c
-index 5cea368efe..a1cd2462db 100644
---- a/lib/eal/freebsd/eal.c
-+++ b/lib/eal/freebsd/eal.c
-@@ -1018,6 +1018,7 @@ int rte_vfio_setup_device(__rte_unused const char *sysfs_base,
+diff --git a/lib/librte_eal/freebsd/eal.c b/lib/librte_eal/freebsd/eal.c
+index 053ae65365..6f9f12911e 100644
+--- a/lib/librte_eal/freebsd/eal.c
++++ b/lib/librte_eal/freebsd/eal.c
+@@ -1014,6 +1014,7 @@ int rte_vfio_setup_device(__rte_unused const char *sysfs_base,
@@ -36 +38 @@
-@@ -1025,11 +1026,13 @@ int rte_vfio_release_device(__rte_unused const char *sysfs_base,
+@@ -1021,11 +1022,13 @@ int rte_vfio_release_device(__rte_unused const char *sysfs_base,
@@ -50 +52 @@
-@@ -1045,6 +1048,7 @@ int rte_vfio_noiommu_is_enabled(void)
+@@ -1041,6 +1044,7 @@ int rte_vfio_noiommu_is_enabled(void)
@@ -58 +60 @@
-@@ -1053,30 +1057,35 @@ rte_vfio_get_group_num(__rte_unused const char *sysfs_base,
+@@ -1049,30 +1053,35 @@ rte_vfio_get_group_num(__rte_unused const char *sysfs_base,
@@ -94 +96 @@
-@@ -1084,6 +1093,7 @@ int
+@@ -1080,6 +1089,7 @@ int
@@ -102 +104 @@
-@@ -1091,6 +1101,7 @@ int
+@@ -1087,6 +1097,7 @@ int
@@ -110 +112 @@
-@@ -1100,6 +1111,7 @@ rte_vfio_container_dma_map(__rte_unused int container_fd,
+@@ -1096,6 +1107,7 @@ rte_vfio_container_dma_map(__rte_unused int container_fd,
@@ -118 +120 @@
-@@ -1109,5 +1121,6 @@ rte_vfio_container_dma_unmap(__rte_unused int container_fd,
+@@ -1105,5 +1117,6 @@ rte_vfio_container_dma_unmap(__rte_unused int container_fd,
@@ -125,5 +127,5 @@
-diff --git a/lib/eal/windows/eal.c b/lib/eal/windows/eal.c
-index f7ce1b6671..67db7f099a 100644
---- a/lib/eal/windows/eal.c
-+++ b/lib/eal/windows/eal.c
-@@ -481,6 +481,7 @@ rte_vfio_container_dma_map(__rte_unused int container_fd,
+diff --git a/lib/librte_eal/windows/eal.c b/lib/librte_eal/windows/eal.c
+index abe4c4038d..892c69356d 100644
+--- a/lib/librte_eal/windows/eal.c
++++ b/lib/librte_eal/windows/eal.c
+@@ -446,6 +446,7 @@ rte_vfio_container_dma_map(__rte_unused int container_fd,
@@ -137 +139 @@
-@@ -490,6 +491,7 @@ rte_vfio_container_dma_unmap(__rte_unused int container_fd,
+@@ -455,5 +456,6 @@ rte_vfio_container_dma_unmap(__rte_unused int container_fd,
@@ -144 +145,0 @@
-
More information about the stable
mailing list