git: 1b13427e48ed - main - net/dpdk-20.11: fix build on -CURRENT

From: Stefan Eßer <se_at_FreeBSD.org>
Date: Mon, 03 Jan 2022 10:27:15 UTC
The branch main has been updated by se:

URL: https://cgit.FreeBSD.org/ports/commit/?id=1b13427e48ed448f68a7d67a694da31b2d57104d

commit 1b13427e48ed448f68a7d67a694da31b2d57104d
Author:     Stefan Eßer <se@FreeBSD.org>
AuthorDate: 2022-01-03 10:21:10 +0000
Commit:     Stefan Eßer <se@FreeBSD.org>
CommitDate: 2022-01-03 10:21:10 +0000

    net/dpdk-20.11: 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
---
 ...patch-lib_librte__eal_freebsd_include_rte__os.h | 41 ++++++++++++++++++++++
 1 file changed, 41 insertions(+)

diff --git a/net/dpdk-20.11/files/patch-lib_librte__eal_freebsd_include_rte__os.h b/net/dpdk-20.11/files/patch-lib_librte__eal_freebsd_include_rte__os.h
new file mode 100644
index 000000000000..c48d4a55c9a2
--- /dev/null
+++ b/net/dpdk-20.11/files/patch-lib_librte__eal_freebsd_include_rte__os.h
@@ -0,0 +1,41 @@
+--- lib/librte_eal/freebsd/include/rte_os.h.orig	2021-03-08 17:40:08 UTC
++++ lib/librte_eal/freebsd/include/rte_os.h
+@@ -14,6 +14,28 @@
+ #include <pthread_np.h>
+ 
+ typedef cpuset_t rte_cpuset_t;
++
++/* 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; \
+@@ -47,6 +69,8 @@ typedef cpuset_t rte_cpuset_t;
+ 	CPU_ANDNOT(&tmp, src); \
+ 	CPU_COPY(&tmp, dst); \
+ } while (0)
+-#endif
++#endif /* CPU_NAND */
++
++#endif /* CPU_ALLOC */
+ 
+ #endif /* _RTE_OS_H_ */