patch 'eal/freebsd: fix use of newer cpuset macros' has been queued to stable release 20.11.6

Xueming Li xuemingl at nvidia.com
Tue Jun 21 10:02:02 CEST 2022


Hi,

FYI, your patch has been queued to stable release 20.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 06/23/22. 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/875e84259c1a9ac2f293e3d0345c0d7d1e04869a

Thanks.

Xueming Li <xuemingl at nvidia.com>

---
>From 875e84259c1a9ac2f293e3d0345c0d7d1e04869a Mon Sep 17 00:00:00 2001
From: David Marchand <david.marchand at redhat.com>
Date: Fri, 20 May 2022 19:10:50 +0100
Subject: [PATCH] eal/freebsd: fix use of newer cpuset macros
Cc: Xueming Li <xuemingl at nvidia.com>

[ upstream commit 2f51bc9c27a4f1da674d66499667155663dcc419 ]

FreeBSD has updated its CPU macros to align more with the definitions
used on Linux[1]. Unfortunately, while this makes compatibility better
in future, it means we need to have both legacy and newer definition
support. Use a meson check to determine which set of macros are used.

[1] https://cgit.freebsd.org/src/commit/?id=e2650af157bc

Bugzilla ID: 1014
Fixes: c3568ea37670 ("eal: restrict control threads to startup CPU affinity")
Fixes: b6be16acfeb1 ("eal: fix control thread affinity with --lcores")

Signed-off-by: David Marchand <david.marchand at redhat.com>
Signed-off-by: Bruce Richardson <bruce.richardson at intel.com>
Tested-by: Daxue Gao <daxuex.gao at intel.com>
---
 lib/librte_eal/freebsd/include/rte_os.h | 17 ++++++++++++++++-
 lib/librte_eal/freebsd/meson.build      | 11 +++++++++++
 2 files changed, 27 insertions(+), 1 deletion(-)

diff --git a/lib/librte_eal/freebsd/include/rte_os.h b/lib/librte_eal/freebsd/include/rte_os.h
index 81a32387a0..e3c9f80720 100644
--- a/lib/librte_eal/freebsd/include/rte_os.h
+++ b/lib/librte_eal/freebsd/include/rte_os.h
@@ -18,6 +18,8 @@ extern "C" {
 
 typedef cpuset_t rte_cpuset_t;
 #define RTE_HAS_CPUSET
+
+#ifdef RTE_EAL_FREEBSD_CPUSET_LEGACY
 #define RTE_CPU_AND(dst, src1, src2) do \
 { \
 	cpuset_t tmp; \
@@ -51,7 +53,20 @@ typedef cpuset_t rte_cpuset_t;
 	CPU_ANDNOT(&tmp, src); \
 	CPU_COPY(&tmp, dst); \
 } while (0)
-#endif
+#endif /* CPU_NAND */
+
+#else /* RTE_EAL_FREEBSD_CPUSET_LEGACY */
+
+#define RTE_CPU_AND CPU_AND
+#define RTE_CPU_OR CPU_OR
+#define RTE_CPU_FILL CPU_FILL
+#define RTE_CPU_NOT(dst, src) do { \
+	cpu_set_t tmp; \
+	CPU_FILL(&tmp); \
+	CPU_XOR(dst, src, &tmp); \
+} while (0)
+
+#endif /* RTE_EAL_FREEBSD_CPUSET_LEGACY */
 
 #ifdef __cplusplus
 }
diff --git a/lib/librte_eal/freebsd/meson.build b/lib/librte_eal/freebsd/meson.build
index e10fd8a16d..0b7e2ca4a1 100644
--- a/lib/librte_eal/freebsd/meson.build
+++ b/lib/librte_eal/freebsd/meson.build
@@ -19,3 +19,14 @@ sources += files(
 )
 
 deps += ['kvargs', 'telemetry']
+                                                                                                                                                                                                        
+# test for version of cpuset macros                                                                                                                                                                      
+cpuset_test_code = '''                                                                                                                                                                                   
+        #include <sys/types.h>                                                                                                                                                                           
+        #include <sys/cpuset.h>                                                                                                                                                                          
+        void cpu_test_or(cpuset_t *s) { CPU_OR(s, s, s); }                                                                                                                                               
+'''                                                                                                                                                                                                      
+                                                                                                                                                                                                         
+if not cc.compiles(cpuset_test_code, name: 'Detect argument count for CPU_OR')                                                                                                                           
+    dpdk_conf.set('RTE_EAL_FREEBSD_CPUSET_LEGACY', 1)                                                                                                                                                    
+endif   
-- 
2.35.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2022-06-21 15:37:51.858968151 +0800
+++ 0056-eal-freebsd-fix-use-of-newer-cpuset-macros.patch	2022-06-21 15:37:49.077784727 +0800
@@ -1 +1 @@
-From 2f51bc9c27a4f1da674d66499667155663dcc419 Mon Sep 17 00:00:00 2001
+From 875e84259c1a9ac2f293e3d0345c0d7d1e04869a Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl at nvidia.com>
+
+[ upstream commit 2f51bc9c27a4f1da674d66499667155663dcc419 ]
@@ -16 +18,0 @@
-Cc: stable at dpdk.org
@@ -22,2 +24,2 @@
- lib/eal/freebsd/include/rte_os.h | 17 ++++++++++++++++-
- lib/eal/freebsd/meson.build      | 11 +++++++++++
+ lib/librte_eal/freebsd/include/rte_os.h | 17 ++++++++++++++++-
+ lib/librte_eal/freebsd/meson.build      | 11 +++++++++++
@@ -26,5 +28,5 @@
-diff --git a/lib/eal/freebsd/include/rte_os.h b/lib/eal/freebsd/include/rte_os.h
-index b4afd45adc..003468caff 100644
---- a/lib/eal/freebsd/include/rte_os.h
-+++ b/lib/eal/freebsd/include/rte_os.h
-@@ -28,6 +28,8 @@ extern "C" {
+diff --git a/lib/librte_eal/freebsd/include/rte_os.h b/lib/librte_eal/freebsd/include/rte_os.h
+index 81a32387a0..e3c9f80720 100644
+--- a/lib/librte_eal/freebsd/include/rte_os.h
++++ b/lib/librte_eal/freebsd/include/rte_os.h
+@@ -18,6 +18,8 @@ extern "C" {
@@ -39 +41 @@
-@@ -61,7 +63,20 @@ typedef cpuset_t rte_cpuset_t;
+@@ -51,7 +53,20 @@ typedef cpuset_t rte_cpuset_t;
@@ -61,4 +63,4 @@
-diff --git a/lib/eal/freebsd/meson.build b/lib/eal/freebsd/meson.build
-index 398ceab71d..fe9097303a 100644
---- a/lib/eal/freebsd/meson.build
-+++ b/lib/eal/freebsd/meson.build
+diff --git a/lib/librte_eal/freebsd/meson.build b/lib/librte_eal/freebsd/meson.build
+index e10fd8a16d..0b7e2ca4a1 100644
+--- a/lib/librte_eal/freebsd/meson.build
++++ b/lib/librte_eal/freebsd/meson.build
@@ -69,11 +71,11 @@
-+
-+# test for version of cpuset macros
-+cpuset_test_code = '''
-+        #include <sys/types.h>
-+        #include <sys/cpuset.h>
-+        void cpu_test_or(cpuset_t *s) { CPU_OR(s, s, s); }
-+'''
-+
-+if not cc.compiles(cpuset_test_code, name: 'Detect argument count for CPU_OR')
-+    dpdk_conf.set('RTE_EAL_FREEBSD_CPUSET_LEGACY', 1)
-+endif
++                                                                                                                                                                                                        
++# test for version of cpuset macros                                                                                                                                                                      
++cpuset_test_code = '''                                                                                                                                                                                   
++        #include <sys/types.h>                                                                                                                                                                           
++        #include <sys/cpuset.h>                                                                                                                                                                          
++        void cpu_test_or(cpuset_t *s) { CPU_OR(s, s, s); }                                                                                                                                               
++'''                                                                                                                                                                                                      
++                                                                                                                                                                                                         
++if not cc.compiles(cpuset_test_code, name: 'Detect argument count for CPU_OR')                                                                                                                           
++    dpdk_conf.set('RTE_EAL_FREEBSD_CPUSET_LEGACY', 1)                                                                                                                                                    
++endif   


More information about the stable mailing list