Skip to content

FreeBSD port - #1778

Open
kostikbel wants to merge 33 commits into
linux-rdma:masterfrom
kostikbel:freebsd
Open

FreeBSD port#1778
kostikbel wants to merge 33 commits into
linux-rdma:masterfrom
kostikbel:freebsd

Conversation

@kostikbel

Copy link
Copy Markdown

This PR adds the FreeBSD build infrastructure allowing rdma-core to be built and used on FreeBSD.
There were several kernel fixes that are already in FreeBSD main and stable/15.

I tried to do as little of the source code modifications as possible. For some cases, I added the glibc API to the FreeBSD base.
Significant number of portability issues are handled by providing the compat shims in freebsd-headers, implementing
Linux-specific features using the FreeBSD native way.

In some cases it was not possible, so there are quite limited number of the direct code patches.

Since FreeBSD mimics the Linux' /sysfs with the sys hierarchy of the sysctl tree, I split the sysfs code into real sysfs for Linux, and wrappers around sysctl for FreeBSD. This again avoid modifying the Linux code, but renames the source file name.

I was told to create a cumulative PR instead of pushing by single commmit.

Please consider.

@kostikbel
kostikbel force-pushed the freebsd branch 10 times, most recently from 4c422c5 to a207c6f Compare July 24, 2026 05:42
Comment thread librdmacm/CMakeLists.txt Outdated
@kostikbel
kostikbel force-pushed the freebsd branch 5 times, most recently from 69929aa to 102be74 Compare August 5, 2026 08:19
@kostikbel
kostikbel force-pushed the freebsd branch 2 times, most recently from a6eadf0 to 7737029 Compare August 11, 2026 19:37
Signed-off-by: Konstantin Belousov <kib@FreeBSD.org>
Signed-off-by: Konstantin Belousov <kib@FreeBSD.org>
Signed-off-by: Konstantin Belousov <kib@FreeBSD.org>
This seems to be unneeded Linuxism

Signed-off-by: Konstantin Belousov <kib@FreeBSD.org>
Signed-off-by: Konstantin Belousov <kib@FreeBSD.org>
…FreeBSD

Signed-off-by: Konstantin Belousov <kib@FreeBSD.org>
Signed-off-by: Konstantin Belousov <kib@FreeBSD.org>
Signed-off-by: Konstantin Belousov <kib@FreeBSD.org>
for struct sockaddr_in and struct in6_addr.

Signed-off-by: Konstantin Belousov <kib@FreeBSD.org>
… friends

Signed-off-by: Konstantin Belousov <kib@FreeBSD.org>
On FreeBSD, the conflicting macro comes from sys/param.h.
This is non-standard header, but it is needed for other target-specific
headers.  Just #undef system-provided ALIGN() before redefining the
local one.

Signed-off-by: Konstantin Belousov <kib@FreeBSD.org>
Signed-off-by: Konstantin Belousov <kib@FreeBSD.org>
Signed-off-by: Konstantin Belousov <kib@FreeBSD.org>
Signed-off-by: Konstantin Belousov <kib@FreeBSD.org>
Signed-off-by: Konstantin Belousov <kib@FreeBSD.org>
Signed-off-by: Konstantin Belousov <kib@FreeBSD.org>
Signed-off-by: Konstantin Belousov <kib@FreeBSD.org>
Signed-off-by: Konstantin Belousov <kib@FreeBSD.org>
…ockaddr

Signed-off-by: Konstantin Belousov <kib@FreeBSD.org>
The actions[] argument to mlx5dv_dr_action_create_modify_header()
is u64/uint64_t *.  And on FreeBSD u64 is unsigned long, while on
Linux it is unsigned long long.  Both types have the same bit
representation, but they are different in the C.

Properly import types from linux/types.h, and add a placeholder to
inform cython about __be64 existence with ctypedef (any integer type
would work, according to the cython documentation).

Signed-off-by: Konstantin Belousov <kib@FreeBSD.org>
Signed-off-by: Konstantin Belousov <kib@FreeBSD.org>
sysfs nodes are translated to sysctl MIBs same as it is done in the
in-tree OFED port.

Signed-off-by: Konstantin Belousov <kib@FreeBSD.org>
kostikbel and others added 11 commits September 8, 2026 05:11
…/modalias")

Construct pci vendor:devid string in Linux format.

Signed-off-by: Konstantin Belousov <kib@FreeBSD.org>
Signed-off-by: Konstantin Belousov <kib@FreeBSD.org>
to avoid conflict with the legacy base OFED libraries.

Signed-off-by: Konstantin Belousov <kib@FreeBSD.org>
describing FreeBSD port requirements and the WIP.

Signed-off-by: Konstantin Belousov <kib@FreeBSD.org>
Allow to have #ifdef/#endif blocks inside the structure definition,
using canonical system name in C preprocessor.  Currently only __linux__
and __FreeBSD__ are recognized.

Signed-off-by: Konstantin Belousov <kib@FreeBSD.org>
…eate_cq

Signed-off-by: Konstantin Belousov <kib@FreeBSD.org>
Signed-off-by: Konstantin Belousov <kib@FreeBSD.org>
On FreeBSD libudev is a 3rd-party library and is installed into a
non-default compiler search path, so we need to supply -I flags
properly.

Note that UDEV_INCLUDE_DIRS is already being used in the root
CMakeLists.txt, but it had no effect before this change.

Signed-off-by:	Gleb Popov <arrowd@FreeBSD.org>
Signed-off-by:	Gleb Popov <arrowd@FreeBSD.org>
Signed-off-by:  Gleb Popov <arrowd@FreeBSD.org>
Signed-off-by: Gleb Popov <6yearold@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants