diff --git a/net/ucx/Makefile b/net/ucx/Makefile index f7cdf5e1385b..0df5bef86db1 100644 --- a/net/ucx/Makefile +++ b/net/ucx/Makefile @@ -1,66 +1,67 @@ PORTNAME= ucx DISTVERSION= 1.20.0 +PORTREVISION= 1 CATEGORIES= net MASTER_SITES= https://github.com/openucx/ucx/releases/download/v${DISTVERSION}/ MAINTAINER= rikka.goering@outlook.de COMMENT= Unified Communication X framework (UCX) WWW= https://openucx.org/ LICENSE= BSD3CLAUSE ONLY_FOR_ARCHS= aarch64 amd64 powerpc64le ONLY_FOR_ARCHS_REASON= uses arch-specific CPU backends; armv7 is not supported upstream and does not build on FreeBSD BUILD_DEPENDS= ${LOCALBASE}/share/aclocal/ax_c_float_words_bigendian.m4:devel/autoconf-archive USES= autoreconf gmake libtool pkgconfig USE_LDCONFIG= yes GNU_CONFIGURE= yes CONFIGURE_ARGS= --enable-mt \ --with-go=no \ --enable-compiler-opt=0 \ --disable-doxygen-doc CONFIGURE_ENV+= GIT=/usr/bin/false INSTALL_TARGET= install-strip TEST_ENV+= LD_LIBRARY_PATH=${STAGEDIR}${PREFIX}/lib CFLAGS+= -Wno-error CXXFLAGS+= -Wno-error LDFLAGS+= -lexecinfo PORTDOCS= * PORTEXAMPLES= * OPTIONS_DEFINE= DOCS EXAMPLES FUSE IBVERBS IODEMO UMAD PERFTEST OPTIONS_DEFAULT= IODEMO PERFTEST FUSE OPTIONS_SUB= yes IBVERBS_DESC= Enable InfiniBand/RDMA (verbs) transport IODEMO_DESC= Install io_demo test application PERFTEST_DESC= Install ucx_perftest benchmarks UMAD_DESC= Build/install perftest MAD plugin (umad) FUSE_LIB_DEPENDS= libfuse3.so:filesystems/fusefs-libs3 FUSE_CONFIGURE_ON= --with-fuse3=${LOCALBASE} FUSE_CONFIGURE_OFF= --with-fuse3=no IBVERBS_CONFIGURE_ON= --with-verbs=${LOCALBASE} IBVERBS_CONFIGURE_OFF= --with-verbs=no UMAD_IMPLIES= IBVERBS PERFTEST UMAD_CONFIGURE_ON= --with-mad=${LOCALBASE} UMAD_CONFIGURE_OFF= --with-mad=no post-install: ${MV} ${STAGEDIR}${ETCDIR}/ucx.conf ${STAGEDIR}${ETCDIR}/ucx.conf.sample do-test: @${ECHO_MSG} "===> Running UCX smoke tests (ucx_info)" ${SETENVI} ${TEST_ENV} ${STAGEDIR}${PREFIX}/bin/ucx_info -v >/dev/null ${SETENVI} ${TEST_ENV} ${STAGEDIR}${PREFIX}/bin/ucx_info -d >/dev/null .include diff --git a/net/ucx/files/patch-src_uct_sm_mm_base_mm__iface.c b/net/ucx/files/patch-src_uct_sm_mm_base_mm__iface.c new file mode 100644 index 000000000000..000376248199 --- /dev/null +++ b/net/ucx/files/patch-src_uct_sm_mm_base_mm__iface.c @@ -0,0 +1,87 @@ +--- src/uct/sm/mm/base/mm_iface.c.orig 2026-03-14 22:02:10 UTC ++++ src/uct/sm/mm/base/mm_iface.c +@@ -19,6 +19,9 @@ + #include + #include + #include ++#include ++#include ++#include + + + /* Maximal number of events to clear from the signaling pipe in single call */ +@@ -681,6 +684,10 @@ static ucs_status_t uct_mm_iface_create_signal_fd(uct_ + ucs_status_t status; + socklen_t addrlen; + struct sockaddr_un bind_addr; ++#if defined(__FreeBSD__) ++ const char *tmpdir; ++ int path_len; ++#endif + int ret; + + /* Create a UNIX domain socket to send and receive wakeup signal from remote processes */ +@@ -700,10 +707,33 @@ static ucs_status_t uct_mm_iface_create_signal_fd(uct_ + /* Bind the signal socket to automatic address */ + bind_addr.sun_family = AF_UNIX; + memset(bind_addr.sun_path, 0, sizeof(bind_addr.sun_path)); ++#if defined(__FreeBSD__) ++ tmpdir = ucs_get_tmpdir(); ++ path_len = snprintf(bind_addr.sun_path, sizeof(bind_addr.sun_path), ++ "%s/ucx_mm.%ld.%p", ++ tmpdir, (long)getpid(), (void*)iface); ++ if ((path_len < 0) || ((size_t)path_len >= sizeof(bind_addr.sun_path))) { ++ ucs_error("Failed to generate unix domain socket path"); ++ status = UCS_ERR_IO_ERROR; ++ goto err_close; ++ } ++ ++ unlink(bind_addr.sun_path); ++ ++ addrlen = offsetof(struct sockaddr_un, sun_path) + path_len + 1; ++ ret = bind(iface->signal_fd, (struct sockaddr*)&bind_addr, addrlen); ++#else ++ /* Linux autobind behavior */ + ret = bind(iface->signal_fd, (struct sockaddr*)&bind_addr, sizeof(sa_family_t)); ++#endif + if (ret < 0) { + ucs_error("Failed to auto-bind unix domain socket: %m"); + status = UCS_ERR_IO_ERROR; ++#if defined(__FreeBSD__) ++ if (bind_addr.sun_path[0] != '\0') { ++ unlink(bind_addr.sun_path); ++ } ++#endif + goto err_close; + } + +@@ -718,6 +748,11 @@ static ucs_status_t uct_mm_iface_create_signal_fd(uct_ + if (ret < 0) { + ucs_error("Failed to retrieve unix domain socket address: %m"); + status = UCS_ERR_IO_ERROR; ++#if defined(__FreeBSD__) ++ if (bind_addr.sun_path[0] != '\0') { ++ unlink(bind_addr.sun_path); ++ } ++#endif + goto err_close; + } + +@@ -904,6 +939,17 @@ static UCS_CLASS_CLEANUP_FUNC(uct_mm_iface_t) + + ucs_mpool_put(self->last_recv_desc); + ucs_mpool_cleanup(&self->recv_desc_mp, 1); ++ ++#if defined(__FreeBSD__) ++ { ++ const struct sockaddr_un *sun = ++ (const struct sockaddr_un *)ucs_unaligned_ptr(&self->recv_fifo_ctl->signal_sockaddr); ++ if ((self->recv_fifo_ctl->signal_addrlen > offsetof(struct sockaddr_un, sun_path)) && ++ (sun->sun_path[0] != '\0')) { ++ unlink(sun->sun_path); ++ } ++ } ++#endif + close(self->signal_fd); + uct_iface_mem_free(&self->recv_fifo_mem); + ucs_arbiter_cleanup(&self->arbiter);