Skip to content

FreeBSD port#1778

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

FreeBSD port#1778
kostikbel wants to merge 28 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 added 12 commits July 21, 2026 23:57
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>
@kostikbel
kostikbel force-pushed the freebsd branch 8 times, most recently from 708bab4 to 8cdc5a3 Compare July 23, 2026 03:08
kostikbel added 10 commits July 24, 2026 06:44
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>
…/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>
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>
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.

1 participant