Bug 297093 - net/ucx: ucx_vfs doesn't start
Summary: net/ucx: ucx_vfs doesn't start
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Laurent Chardon
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2026-07-27 17:08 UTC by Laurent Chardon
Modified: 2026-08-06 19:13 UTC (History)
2 users (show)

See Also:
bugzilla: maintainer-feedback? (rikka.goering)


Attachments
v1 net/ucx: Fix FreeBSD FUSE integration (13.45 KB, patch)
2026-08-04 17:03 UTC, Generic Rikka
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Laurent Chardon freebsd_committer freebsd_triage 2026-07-27 17:08:18 UTC
ucx_vfs doesn't work it uses a hardcoded Linux-only utility:

ucx_vfs -f -v start
[1785171913.300025] [freebsd:22349:0]        vfs_main.c:91   UCX  ERROR failed to execute 'fusermount3 -V': No such file or directory
[1785171913.300341] [freebsd:22348:0]        vfs_main.c:100  UCX  ERROR 'fusermount3 -V' exited with status 1

fuseremount3 needs to be replaced with the FreeBSD equivalent (probably a combination of /sbin/mount_fusefs and /sbin/umount).
Comment 1 Generic Rikka 2026-07-31 23:44:35 UTC
Thanks for reporting the issue and for the guidance on how to approach this.
Will start working on a patch to implement this and attach it as soon as I am done!
Comment 2 Generic Rikka 2026-08-04 17:03:57 UTC
Created attachment 273455 [details]
v1 net/ucx: Fix FreeBSD FUSE integration

I implemented the FreeBSD ucx_vfs support according to your suggestions.

Besides replacing the Linux-specific fusermount3 calls with mount_fusefs and umount, the patch fixes two socket portability issues exposed by FreeBSD: control data was attached to messages without a valid cmsghdr, and SCM_RIGHTS buffers were larger than the actual file descriptor payload. The FreeBSD path now also uses LOCAL_PEERCRED to obtain the client credentials and PID.

For the VFS socket path, the FreeBSD implementation now prefers XDG_RUNTIME_DIR when available and falls back to /tmp/ucx-%i/vfs.sock otherwise, removing the need for the port's /var/run/user path rewrite.

Tested on FreeBSD without InfiniBand hardware:

 - ucx_vfs starts and stops successfully
 - ucx_info communicates with the VFS daemon successfully
 - FUSE file descriptor passing succeeds
 - full UCX test suite passes: 6864/6864 tests
Comment 3 Laurent Chardon freebsd_committer freebsd_triage 2026-08-05 01:16:34 UTC
(In reply to Generic Rikka from comment #2)

Thanks! It looks good to me. I'll also increment PORTREVISION since we're changing the binaries.

Thierry, do you approve this commit with the bumped PORTREVISION?
Comment 4 Thierry Thomas freebsd_committer freebsd_triage 2026-08-05 08:40:46 UTC
Great job guys!

@laurent: approved.
Comment 5 commit-hook freebsd_committer freebsd_triage 2026-08-06 11:21:29 UTC
A commit in branch main references this bug:

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

commit c596dc64da6d3142ba5c9a6ea1fdbebc4e9bf3e1
Author:     GenericRikka <rikka.goering@outlook.de>
AuthorDate: 2026-08-06 11:09:06 +0000
Commit:     Laurent Chardon <laurent@FreeBSD.org>
CommitDate: 2026-08-06 11:19:32 +0000

    net/ucx: Improve FreeBSD ucx_vfs support

    - replace Linux-specific fusermount3 with mount_fusefs/umount
    - use FreeBSD-compatible FUSE capability detection
    - fix UNIX socket ancillary data handling for SCM_RIGHTS and peer
      credentials on FreeBSD

    This allows ucx_vfs to start and communicate correctly on FreeBSD.

    PR:             297093
    Reported-by:    Laurent Chardon <laurent@FreeBSD.org>
    Reviewed by:    thierry (mentor)
    Approved by:    thierry (mentor)

 net/ucx/Makefile                                   |   4 +-
 .../files/patch-src_tools_vfs_vfs__daemon.h (new)  |  17 ++
 .../files/patch-src_tools_vfs_vfs__main.c (new)    |  75 +++++++++
 net/ucx/files/patch-src_ucs_vfs_sock_vfs__sock.c   | 178 ++++++++++++++++-----
 .../files/patch-src_ucs_vfs_sock_vfs__sock.h (new) |  14 ++
 5 files changed, 245 insertions(+), 43 deletions(-)
Comment 6 Laurent Chardon freebsd_committer freebsd_triage 2026-08-06 11:22:04 UTC
Done. Thank you both!
Comment 7 Generic Rikka 2026-08-06 19:13:03 UTC
Thank you both for the review, guidance and great cooperation on this! I really enjoyed working through the remaining FreeBSD ucx_vfs issues together.

If you uncover any further issues, feel free to open another PR or email me. I'd be happy to look into them.