diff --git a/benchmarks/stress-ng/files/patch-stress-tlb-shootdown.c b/benchmarks/stress-ng/files/patch-stress-tlb-shootdown.c index 0beb2950f2b2..d54609e2fc7f 100644 --- a/benchmarks/stress-ng/files/patch-stress-tlb-shootdown.c +++ b/benchmarks/stress-ng/files/patch-stress-tlb-shootdown.c @@ -1,11 +1,14 @@ ---- stress-tlb-shootdown.c.orig 2021-12-28 15:45:13 UTC +--- stress-tlb-shootdown.c.orig 2021-12-19 20:49:35 UTC +++ stress-tlb-shootdown.c -@@ -64,7 +64,7 @@ static int stress_tlb_shootdown(const stress_args_t *a +@@ -64,7 +64,11 @@ static int stress_tlb_shootdown(const stress_args_t *a const int32_t max_cpus = stress_get_processors_configured(); CPU_ZERO(&proc_mask); -- CPU_OR(&proc_mask, &proc_mask_initial, &proc_mask); ++#ifdef CPU_ALLOC + CPU_OR(&proc_mask, &proc_mask_initial, &proc_mask); ++#else + CPU_OR(&proc_mask, &proc_mask_initial); ++#endif tlb_procs = max_cpus; if (tlb_procs > MAX_TLB_PROCS) 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 + + 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_ */ 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,27 +1,61 @@ ---- 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 + + 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) + +/* In FreeBSD 13 CPU_NAND macro is CPU_ANDNOT */ +#ifdef CPU_NAND #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) +#else +#define RTE_CPU_NOT(dst, src) do \ +{ \ + cpuset_t tmp; \ + CPU_FILL(&tmp); \ + CPU_ANDNOT(&tmp, src); \ + CPU_COPY(&tmp, dst); \ +} while (0) -+#endif ++#endif /* CPU_NAND */ ++ ++#endif /* CPU_ALLOC */ #endif /* _RTE_OS_H_ */ diff --git a/net/haproxy-devel/files/patch-src_cpuset.c b/net/haproxy-devel/files/patch-src_cpuset.c new file mode 100644 index 000000000000..42f04b37e6f6 --- /dev/null +++ b/net/haproxy-devel/files/patch-src_cpuset.c @@ -0,0 +1,14 @@ +--- src/cpuset.c.orig 2021-12-23 16:47:51 UTC ++++ src/cpuset.c +@@ -53,7 +53,11 @@ void ha_cpuset_and(struct hap_cpuset *dst, const struc + CPU_AND(&dst->cpuset, &dst->cpuset, &src->cpuset); + + #elif defined(CPUSET_USE_FREEBSD_CPUSET) ++#if defined(CPU_ALLOC) ++ CPU_AND(&dst->cpuset, &dst->cpuset, &src->cpuset); ++#else + CPU_AND(&dst->cpuset, &src->cpuset); ++#endif + + #elif defined(CPUSET_USE_ULONG) + dst->cpuset &= src->cpuset; diff --git a/net/haproxy/files/patch-src_cpuset.c b/net/haproxy/files/patch-src_cpuset.c new file mode 100644 index 000000000000..42f04b37e6f6 --- /dev/null +++ b/net/haproxy/files/patch-src_cpuset.c @@ -0,0 +1,14 @@ +--- src/cpuset.c.orig 2021-12-23 16:47:51 UTC ++++ src/cpuset.c +@@ -53,7 +53,11 @@ void ha_cpuset_and(struct hap_cpuset *dst, const struc + CPU_AND(&dst->cpuset, &dst->cpuset, &src->cpuset); + + #elif defined(CPUSET_USE_FREEBSD_CPUSET) ++#if defined(CPU_ALLOC) ++ CPU_AND(&dst->cpuset, &dst->cpuset, &src->cpuset); ++#else + CPU_AND(&dst->cpuset, &src->cpuset); ++#endif + + #elif defined(CPUSET_USE_ULONG) + dst->cpuset &= src->cpuset; diff --git a/sysutils/slurm-wlm/Makefile b/sysutils/slurm-wlm/Makefile index 517b38320bd3..f3dd6e9c9b11 100644 --- a/sysutils/slurm-wlm/Makefile +++ b/sysutils/slurm-wlm/Makefile @@ -1,134 +1,135 @@ PORTNAME= slurm DISTVERSION= 20.02.7 CATEGORIES= sysutils python MASTER_SITES= https://download.schedmd.com/slurm/ PKGNAMESUFFIX= -wlm MAINTAINER= ports@FreeBSD.org COMMENT= Simple Linux Utility for Resource Management LICENSE= GPLv2+ LICENSE_FILE= ${WRKSRC}/COPYING NOT_FOR_ARCHS= armv6 armv7 i386 mips powerpc powerpcspe NOT_FOR_ARCHS_REASON= 32-bit support is deprecated LIB_DEPENDS= libjson-c.so:devel/json-c \ libsysinfo.so:devel/libsysinfo \ libmunge.so:security/munge \ liblz4.so:archivers/liblz4 USES= compiler:c11 cpe gmake gnome libtool localbase lua pkgconfig \ python:build readline shebangfix ssl tar:bz2 CPE_VENDOR= schedmd USE_LDCONFIG= yes USE_RC_SUBR= slurmctld slurmd USERS= slurm GROUPS= ${USERS} GNU_CONFIGURE= yes INSTALL_TARGET= install-strip PLIST_SUB= PORTVERSION="${PORTVERSION}" SHEBANG_FILES= doc/html/shtml2html.py doc/man/man2html.py OPTIONS_DEFINE= CURL DOCS GUI HDF5 HWLOC IPMI MYSQL RRD OPTIONS_DEFAULT= HDF5 HWLOC OPTIONS_SUB= yes CURL_DESC= Require cURL for elasticsearch plugins GUI_DESC= Build sview GUI config tool HDF5_DESC= Job profiling using HDF5 HWLOC_DESC= Portable hardware locality IPMI_DESC= IPMI energy consumption accounting RRD_DESC= RRD external sensor data collection DOCS_BUILD_DEPENDS= man2html:textproc/man2html CURL_LIB_DEPENDS= libcurl.so:ftp/curl CURL_CONFIGURE_WITH= libcurl GUI_USE= GNOME=cairo,gdkpixbuf2,glib20,gtk20 GUI_LIB_DEPENDS= libfontconfig.so:x11-fonts/fontconfig \ libfreetype.so:print/freetype2 GUI_USES= gettext GUI_CONFIGURE_ENABLE= glibtest gtktest x11 # Neither of these work. See post-patch below. #GTK2_CONFIGURE_ENV_OFF= ac_gtk_test=no #GTK2_CONFIGURE_OFF= --disable-gtktest HDF5_LIB_DEPENDS= libhdf5_cpp.so:science/hdf5 \ libsz.so:science/szip HDF5_CONFIGURE_WITH= hdf5 HDF5_CONFIGURE_ENV= H5CC=${LOCALBASE}/bin/h5cc HWLOC_LIB_DEPENDS= libhwloc.so.15:devel/hwloc2 HWLOC_CONFIGURE_WITH= hwloc IPMI_LIB_DEPENDS= libfreeipmi.so:sysutils/freeipmi IPMI_CONFIGURE_WITH= freeipmi MYSQL_USES= mysql MYSQL_CONFIGURE_OFF= --with-mysql_config=/nonexistent RRD_LIB_DEPENDS= librrd.so:databases/rrdtool RRD_CONFIGURE_WITH= rrdtool # --docdir is non-functional # CONFIGURE_ARGS= --docdir=${DOCSDIR} # FreeBSD Infiniband support is still experimental -CONFIGURE_ARGS= --without-ofed +# slurmrestd does not build on FreeBSD +CONFIGURE_ARGS= --without-ofed --disable-slurmrestd DOCSDIR= ${PREFIX}/share/doc/${PORTNAME}-${DISTVERSION} CFLAGS+= -I${WRKSRC}/slurm -I${LOCALBASE}/include -fcommon LDFLAGS+= -L${LOCALBASE}/lib -lsysinfo -lprocstat -fcommon # Hack around nonfunctional --disable-gtktest flag pre-configure-GUI-off: @${REINPLACE_CMD} -e 's|min_gtk_version=.*|min_gtk_version=2000.0.0|' \ ${WRKSRC}/configure # SLURM's configure enables interactive jobs if pty.h exists. Replacing # #include with appropriate headers will therefore not work, so instead # add a pty.h for the build. pre-configure: @${CP} ${FILESDIR}/pty.h ${WRKSRC}/slurm @${REINPLACE_CMD} -e 's|sched_setaffinity|cpuset_setaffinity|g' \ -e 's|%%LOCALBASE%%|${LOCALBASE}|' ${WRKSRC}/configure @${REINPLACE_CMD} -e 's|"/proc|"/compat/linux/proc|g' \ -e 's|(/proc)|(/compat/linux/proc)|g' \ ${WRKSRC}/src/slurmd/slurmstepd/req.c \ ${WRKSRC}/src/slurmd/slurmstepd/pdebug.c \ ${WRKSRC}/src/slurmd/common/xcpuinfo.c \ ${WRKSRC}/src/slurmd/common/xcgroup.c \ ${WRKSRC}/src/slurmd/common/set_oomadj.c \ ${WRKSRC}/src/slurmd/common/proctrack.c \ ${WRKSRC}/src/common/callerid.c \ ${WRKSRC}/src/plugins/task/affinity/affinity.c \ ${WRKSRC}/src/plugins/acct_gather_energy/rapl/acct_gather_energy_rapl.c \ ${WRKSRC}/src/plugins/jobacct_gather/cgroup/jobacct_gather_cgroup.c \ ${WRKSRC}/src/plugins/jobacct_gather/common/common_jag.c \ ${WRKSRC}/src/plugins/jobacct_gather/linux/jobacct_gather_linux.c \ ${WRKSRC}/src/plugins/switch/cray_aries/scaling.c \ ${WRKSRC}/src/plugins/proctrack/cray_aries/proctrack_cray_aries.c \ ${WRKSRC}/src/plugins/proctrack/cgroup/proctrack_cgroup.c \ ${WRKSRC}/src/plugins/proctrack/pgid/proctrack_pgid.c \ ${WRKSRC}/src/plugins/proctrack/linuxproc/kill_tree.c \ ${WRKSRC}/src/plugins/acct_gather_filesystem/lustre/acct_gather_filesystem_lustre.c \ ${WRKSRC}/src/plugins/node_features/knl_generic/node_features_knl_generic.c \ ${WRKSRC}/contribs/cray/pam_job.c @if ${WHICH} sbatch > /dev/null; then \ ${ECHO_CMD} "********************************************"; \ ${ECHO_CMD} "Build may fail while slurm-wlm is installed."; \ ${ECHO_CMD} "Deinstall slurm-wlm and run make again."; \ ${ECHO_CMD} "********************************************"; \ false; \ fi post-install: ${INSTALL_DATA} ${WRKSRC}/etc/slurm.conf.example \ ${STAGEDIR}${PREFIX}/etc/slurm.conf.sample .include diff --git a/sysutils/slurm-wlm/files/patch-src_plugins_task_affinity_affinity.c b/sysutils/slurm-wlm/files/patch-src_plugins_task_affinity_affinity.c new file mode 100644 index 000000000000..cf09d539002c --- /dev/null +++ b/sysutils/slurm-wlm/files/patch-src_plugins_task_affinity_affinity.c @@ -0,0 +1,11 @@ +--- src/plugins/task/affinity/affinity.c.orig 2021-05-12 20:23:20 UTC ++++ src/plugins/task/affinity/affinity.c +@@ -297,7 +297,7 @@ void reset_cpuset(cpu_set_t *new_mask, cpu_set_t *cur_ + if (slurm_getaffinity(1, sizeof(full_mask), &full_mask)) { + /* Try to get full CPU mask from process init */ + CPU_ZERO(&full_mask); +-#ifdef __FreeBSD__ ++#if defined(__FreeBSD__) && !defined(CPU_ALLOC) + CPU_OR(&full_mask, cur_mask); + #else + CPU_OR(&full_mask, &full_mask, cur_mask);