diff --git a/net/ucx/Makefile b/net/ucx/Makefile index 59ef00cb8662..6c67495d9c7e 100644 --- a/net/ucx/Makefile +++ b/net/ucx/Makefile @@ -1,73 +1,73 @@ PORTNAME= ucx DISTVERSION= 1.20.1 -PORTREVISION= 2 +PORTREVISION= 3 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 LICENSE_FILE= ${WRKSRC}/LICENSE 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= bash:shells/bash \ ${LOCALBASE}/share/aclocal/ax_c_float_words_bigendian.m4:devel/autoconf-archive USES= autoreconf dos2unix gmake libtool pkgconfig USE_LDCONFIG= yes GNU_CONFIGURE= yes CONFIGURE_SHELL= ${LOCALBASE}/bin/bash CONFIGURE_ARGS= --disable-doxygen-doc \ --enable-compiler-opt=0 \ --enable-gtest \ --enable-mt \ --with-go=no CONFIGURE_ENV= GIT=/usr/bin/false INSTALL_TARGET= install-strip TEST_ENV+= LD_LIBRARY_PATH=${STAGEDIR}${PREFIX}/lib TESTING_UNSAFE= yes LDFLAGS+= -lexecinfo -lprocstat -lutil PORTDOCS= * PORTEXAMPLES= * OPTIONS_DEFINE= DOCS EXAMPLES FUSE IBVERBS IODEMO PERFTEST UMAD OPTIONS_DEFAULT= FUSE IODEMO PERFTEST 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-patch: ${REINPLACE_CMD} 's|^examplesdir = $$(pkgdatadir)/examples$$|examplesdir = ${EXAMPLESDIR}|' \ ${WRKSRC}/examples/Makefile.am ${REINPLACE_CMD} 's|/run/user|/var/run/user|' \ ${WRKSRC}/src/ucs/vfs/sock/vfs_sock.h post-install: ${MV} ${STAGEDIR}${ETCDIR}/ucx.conf ${STAGEDIR}${ETCDIR}/ucx.conf.sample do-test: cd ${WRKSRC}/test/gtest && \ ${SETENV} ${TEST_ENV} ${MAKE_CMD} && \ ${SETENV} ${TEST_ENV} ./gtest --gtest_filter=-malloc_hook*:sysv/*:test_rcache*:test_rcache_pfn*:test_vfs_sock*:test_datatype.hlist_for_each_extract_if:tcp/test_uct_pending.pending_fairness*:tcp/test_uct_peer_failure.purge_failed_peer*:tcp/test_uct_pending.pending_purge*:tcp/test_uct_iface.is_reachable*:tcp/test_uct_perf*:tcp/test_uct_loopback*:tcp/test_uct_tcp.listener_flood_connect_and_send_large*:tcp/test_uct_tcp.listener_flood_connect_and_send_small*:tcp/test_uct_tcp.check_addr_len*:shm*/*:mm_tcp/*:ib_shm/*:ud_tcp/*:all/*:*/test_ucp_loopback*:tcp/test_ucp_perf*:*/test_ucp_proto_mock_self.rkey_ptr*:test_config.test_config_file:test_config.test_config_file_parse_files:signal/*:*/test_async.many_timers*:*/test_ucp_peer_failure_keepalive*:self/test_ucp_wakeup.signal*:tcp/test_ucp_wakeup.signal*:tcp/test_proto_reset.am_eager_multi_bcopy*:tcp/test_uct_sockaddr.err_handle*:tcp/test_ucp_sockaddr_protocols_diff_net_devices*:tcp/test_ucp_sockaddr_iface_activate*:*/test_ucp_atomic*:*/test_ucp_mmap*:*/test_ucp_tag_match_rndv_align*:*/test_ucp_tag_probe*:tcp/test_ucp_sockaddr.*close_during_rndv*:tcp/test_ucp_sockaddr_protocols_err*:*test_ucp_wireup_1sided.stress_connect*:*/test_event_set.ucs_event_set_trig_modes* .include diff --git a/net/ucx/files/patch-src_ucs_vfs_fuse_vfs__fuse.c b/net/ucx/files/patch-src_ucs_vfs_fuse_vfs__fuse.c index c3486228cc23..1a4a2cfc8be4 100644 --- a/net/ucx/files/patch-src_ucs_vfs_fuse_vfs__fuse.c +++ b/net/ucx/files/patch-src_ucs_vfs_fuse_vfs__fuse.c @@ -1,125 +1,118 @@ ---- src/ucs/vfs/fuse/vfs_fuse.c.orig 2026-06-26 16:34:01 UTC +--- src/ucs/vfs/fuse/vfs_fuse.c.orig 2026-07-27 15:46:30 UTC +++ src/ucs/vfs/fuse/vfs_fuse.c @@ -37,6 +37,7 @@ static struct { static struct { pthread_t thread_id; + int thread_started; pthread_mutex_t mutex; struct fuse *fuse; int fuse_fd; @@ -44,15 +45,20 @@ static struct { int inotify_fd; int watch_desc; } ucs_vfs_fuse_context = { - .thread_id = -1, - .mutex = PTHREAD_MUTEX_INITIALIZER, - .fuse = NULL, - .fuse_fd = -1, - .stop = 0, - .inotify_fd = -1, - .watch_desc = -1 + .thread_started = 0, + .mutex = PTHREAD_MUTEX_INITIALIZER, + .fuse = NULL, + .fuse_fd = -1, + .stop = 0, + .inotify_fd = -1, + .watch_desc = -1 }; +static void ucs_vfs_sigusr1_handler(int signo) +{ + (void)signo; +} + static void ucs_vfs_enum_dir_cb(const char *name, void *arg) { ucs_vfs_enum_dir_context_t *ctx = arg; -@@ -302,9 +308,15 @@ static ucs_status_t ucs_vfs_fuse_wait_for_path(const c +@@ -300,7 +306,7 @@ static ucs_status_t ucs_vfs_fuse_wait_for_path(const c + * deleted explicitly or implicitly */ + ucs_vfs_fuse_context.watch_desc = inotify_add_watch( ucs_vfs_fuse_context.inotify_fd, watch_dirname, - IN_CREATE | IN_IGNORED); +- IN_CREATE | IN_IGNORED); ++ IN_CREATE); if (ucs_vfs_fuse_context.watch_desc < 0) { -+#ifdef __FreeBSD__ -+ ucs_warn("inotify_add_watch(%s) failed: %m. Disabling VFS live updates.", watch_dirname); -+ status = UCS_OK; -+ goto out_close_inotify_fd; -+#else ucs_error("inotify_add_watch(%s) failed: %m", watch_dirname); status = UCS_ERR_IO_ERROR; - goto out_close_inotify_fd; -+#endif - } - - /* Read events from inotify channel and exit when either the main thread set -@@ -492,10 +504,10 @@ static void ucs_fuse_thread_stop() +@@ -492,10 +498,10 @@ static void ucs_fuse_thread_stop() static void ucs_fuse_thread_stop() { - sighandler_t orig_handler; + sig_t orig_handler; int ret; - orig_handler = signal(SIGUSR1, (sighandler_t)ucs_empty_function); + orig_handler = signal(SIGUSR1, ucs_vfs_sigusr1_handler); pthread_mutex_lock(&ucs_vfs_fuse_context.mutex); -@@ -518,15 +530,20 @@ static void ucs_fuse_thread_stop() +@@ -518,15 +524,20 @@ static void ucs_fuse_thread_stop() if (ucs_vfs_fuse_context.fuse != NULL) { fuse_exit(ucs_vfs_fuse_context.fuse); ucs_fuse_replace_fd_devnull(); - pthread_kill(ucs_vfs_fuse_context.thread_id, SIGUSR1); + if (ucs_vfs_fuse_context.thread_started) { + pthread_kill(ucs_vfs_fuse_context.thread_id, SIGUSR1); + } } pthread_mutex_unlock(&ucs_vfs_fuse_context.mutex); - ret = pthread_join(ucs_vfs_fuse_context.thread_id, NULL); - if (ret != 0) { - ucs_warn("pthread_join(0x%lx) failed: %m", - ucs_vfs_fuse_context.thread_id); + if (ucs_vfs_fuse_context.thread_started) { + ret = pthread_join(ucs_vfs_fuse_context.thread_id, NULL); + if (ret != 0) { + ucs_warn("pthread_join(0x%lx) failed: %m", + ucs_vfs_fuse_context.thread_id); + } + ucs_vfs_fuse_context.thread_started = 0; } signal(SIGUSR1, orig_handler); -@@ -536,11 +553,11 @@ static void ucs_vfs_fuse_atfork_child() +@@ -536,11 +547,11 @@ static void ucs_vfs_fuse_atfork_child() { /* Reset thread context at fork, since doing inotify_rm_watch() from child will prevent doing it later from the parent */ - ucs_vfs_fuse_context.thread_id = -1; - ucs_vfs_fuse_context.fuse = NULL; - ucs_vfs_fuse_context.fuse_fd = -1; - ucs_vfs_fuse_context.inotify_fd = -1; - ucs_vfs_fuse_context.watch_desc = -1; + ucs_vfs_fuse_context.thread_started = 0; + ucs_vfs_fuse_context.fuse = NULL; + ucs_vfs_fuse_context.fuse_fd = -1; + ucs_vfs_fuse_context.inotify_fd = -1; + ucs_vfs_fuse_context.watch_desc = -1; } void UCS_F_CTOR ucs_vfs_fuse_init() -@@ -549,12 +566,13 @@ void UCS_F_CTOR ucs_vfs_fuse_init() +@@ -549,12 +560,13 @@ void UCS_F_CTOR ucs_vfs_fuse_init() pthread_atfork(NULL, NULL, ucs_vfs_fuse_atfork_child); ucs_pthread_create(&ucs_vfs_fuse_context.thread_id, ucs_vfs_fuse_thread_func, NULL, "fuse"); + ucs_vfs_fuse_context.thread_started = 1; } } void UCS_F_DTOR ucs_vfs_fuse_cleanup() { - if (ucs_vfs_fuse_context.thread_id != -1) { + if (ucs_vfs_fuse_context.thread_started) { ucs_fuse_thread_stop(); } }