aboutsummaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorStefan Eßer <se@FreeBSD.org>2022-01-03 10:26:15 +0000
committerStefan Eßer <se@FreeBSD.org>2022-01-03 10:26:15 +0000
commitc3e19584524281d37fe92868e5c3582fcd7d7d28 (patch)
tree83d226405fcf8a8b0340fcaea5a455e7681a0dba /net
parent1b13427e48ed448f68a7d67a694da31b2d57104d (diff)
downloadports-c3e19584524281d37fe92868e5c3582fcd7d7d28.tar.gz
ports-c3e19584524281d37fe92868e5c3582fcd7d7d28.zip
net/dpdk: fix build on -CURRENT
The CPU_SET macros in -CURRENT have been made compatible with GLIBC. A simple test for the new signature of CPU_AND, CPU_OR, ... is the existence of a CPU_ALLOC macro. Approved by: portmgr (implicit) MFH: 2022Q1
Diffstat (limited to 'net')
-rw-r--r--net/dpdk/files/patch-lib_librte__eal_freebsd_eal_include_rte__os.h42
1 files changed, 38 insertions, 4 deletions
diff --git a/net/dpdk/files/patch-lib_librte__eal_freebsd_eal_include_rte__os.h b/net/dpdk/files/patch-lib_librte__eal_freebsd_eal_include_rte__os.h
index ede8d170de6e..6e63d49836ac 100644
--- a/net/dpdk/files/patch-lib_librte__eal_freebsd_eal_include_rte__os.h
+++ b/net/dpdk/files/patch-lib_librte__eal_freebsd_eal_include_rte__os.h
@@ -1,6 +1,38 @@
---- lib/librte_eal/freebsd/eal/include/rte_os.h.orig 2020-01-03 12:22:03 UTC
+--- lib/librte_eal/freebsd/eal/include/rte_os.h.orig 2021-03-17 16:43:15 UTC
+++ lib/librte_eal/freebsd/eal/include/rte_os.h
-@@ -29,6 +29,9 @@ typedef cpuset_t rte_cpuset_t;
+@@ -14,8 +14,30 @@
+ #include <pthread_np.h>
+
+ typedef cpuset_t rte_cpuset_t;
+-#define RTE_CPU_AND(dst, src1, src2) do \
++
++/* FreeBSD 14 uses GLIBC compatible CPU_AND, CPU_OR, ... */
++#ifdef CPU_ALLOC
++
++#define RTE_CPU_AND(dst, src1, src2) CPU_AND(dst, src1, src2)
++#define RTE_CPU_OR(dst, src1, src2) CPU_OR(dst, src1, src2)
++#define RTE_CPU_FILL(set) do \
+ { \
++ unsigned int i; \
++ CPU_ZERO(set); \
++ for (i = 0; i < CPU_SETSIZE; i++) \
++ CPU_SET(i, set); \
++} while (0)
++#define RTE_CPU_NOT(dst, src) do \
++{ \
++ cpu_set_t tmp; \
++ RTE_CPU_FILL(&tmp); \
++ CPU_XOR(dst, &tmp, src); \
++} while (0)
++
++#else
++
++#define RTE_CPU_AND(dst, src1, src2) do \
++{ \
+ cpuset_t tmp; \
+ CPU_COPY(src1, &tmp); \
+ CPU_AND(&tmp, src2); \
+@@ -29,6 +51,9 @@ typedef cpuset_t rte_cpuset_t;
CPU_COPY(&tmp, dst); \
} while (0)
#define RTE_CPU_FILL(set) CPU_FILL(set)
@@ -10,7 +42,7 @@
#define RTE_CPU_NOT(dst, src) do \
{ \
cpuset_t tmp; \
-@@ -36,5 +39,14 @@ typedef cpuset_t rte_cpuset_t;
+@@ -36,5 +61,16 @@ typedef cpuset_t rte_cpuset_t;
CPU_NAND(&tmp, src); \
CPU_COPY(&tmp, dst); \
} while (0)
@@ -22,6 +54,8 @@
+ CPU_ANDNOT(&tmp, src); \
+ CPU_COPY(&tmp, dst); \
+} while (0)
-+#endif
++#endif /* CPU_NAND */
++
++#endif /* CPU_ALLOC */
#endif /* _RTE_OS_H_ */