Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
712ce2f
Update kernel headers
mrgolin Mar 17, 2026
93c1884
providers/efa: Rename alloc_ucontext comp_mask to supported_caps
mrgolin Mar 17, 2026
494d4f9
pyverbs: Add port speed verb and event
Dec 24, 2025
2b8e9e8
tests: Add test for query_port_speed
Dec 24, 2025
de558ce
pyverbs: Add dmabuf FD export for DM and UAR
ShacharKagan Dec 25, 2025
74bc6cb
tests: Add dmabuf FD export tests for UAR and DM
ShacharKagan Dec 25, 2025
4d6f1c2
librdmacm: Fix rpoll in case of timeout
BatshevaBlack Nov 14, 2024
eb0acaf
librdmacm: Fix select function
BatshevaBlack Oct 6, 2024
733af17
librdmacm: Add support for accept4 function
BatshevaBlack Dec 23, 2024
539c76c
librdmacm: Add support for fcntl64
BatshevaBlack Oct 6, 2024
406bff5
librdmacm: Add support to more optnames in getsockopt, setsockopt
BatshevaBlack Oct 6, 2024
52bc43c
librdmacm: Fix rfcntl to keep fs flags separately
BatshevaBlack Dec 23, 2024
13ddd1b
librdmacm: Add support for sendfile64
BatshevaBlack Dec 22, 2024
900f989
librdmacm: Add support for dup
BatshevaBlack Dec 22, 2024
05cf65b
librdmacm: Add rsocket to connect service on success too
BatshevaBlack Dec 16, 2024
1402235
librdmacm: Change wake-up timeout from rpoll
BatshevaBlack Nov 10, 2024
468c29f
librdmacm: Fix SOCK_STREAM and SOCK_DGRAM types
BatshevaBlack Oct 6, 2024
dcd0312
librdmacm: Fix fcntl64/sendfile64 detection by adding _GNU_SOURCE
BatshevaBlack Apr 14, 2026
a0ff4cf
librdmacm: Fix fcntl64/sendfile64 header detection for -Wredundant-decls
BatshevaBlack Apr 14, 2026
bdd5d69
ibstat: ignore non-RDMA endpoint devices when umad_get_ca() fails
NagappanRMPL Mar 4, 2026
0f5413e
dump_fts: Change lft type in dump_fts to uint8_t
mazorasaf Mar 23, 2026
85e37d7
librdmacm: ensure poll handles normal file descriptors correctly
kaolamall Apr 22, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -449,6 +449,46 @@ if (NOT HAVE_LARGE_FILES)
add_definitions("-D_FILE_OFFSET_BITS=64")
endif()

# librspreload: probe libc for fcntl64/sendfile64; CMake sets RDMA_PRELOAD_WRAP_LFS64 when
# preload should implement the fcntl64/sendfile64 wrapper (see RDMA_PRELOAD_WRAP_LFS64 below).
set(CMAKE_REQUIRED_QUIET 1)
set(SAFE_CMAKE_REQUIRED_DEFINITIONS "${CMAKE_REQUIRED_DEFINITIONS}")
set(CMAKE_REQUIRED_DEFINITIONS "-D_GNU_SOURCE")
CHECK_C_SOURCE_COMPILES("
#include <fcntl.h>
#include <sys/sendfile.h>
int main(void) {
(void)&fcntl64;
(void)&sendfile64;
return 0;
}
" RDMA_PRELOAD_LIBC_HAS_FCNTL64_SENDFILE64)
set(CMAKE_REQUIRED_DEFINITIONS "${SAFE_CMAKE_REQUIRED_DEFINITIONS}")
set(CMAKE_REQUIRED_QUIET 0)
if(RDMA_PRELOAD_LIBC_HAS_FCNTL64_SENDFILE64)
set(RDMA_PRELOAD_HAVE_LFS_WRAPPER_SYMS 1)
else()
set(RDMA_PRELOAD_HAVE_LFS_WRAPPER_SYMS 0)
endif()

# Single gate for preload.c fcntl64/sendfile64 wrappers: need libc symbols and must
# not compile preload with _FILE_OFFSET_BITS=64 (CMake adds that when HAVE_LARGE_FILES is false).
if(RDMA_PRELOAD_HAVE_LFS_WRAPPER_SYMS AND HAVE_LARGE_FILES)
set(RDMA_PRELOAD_WRAP_LFS64 1)
else()
set(RDMA_PRELOAD_WRAP_LFS64 0)
endif()

# If the first test found fcntl64/sendfile64 with _GNU_SOURCE, the headers
# must declare them -- no separate check needed.
if(RDMA_PRELOAD_HAVE_LFS_WRAPPER_SYMS)
set(RDMA_PRELOAD_FCNTL64_IN_HEADER 1)
set(RDMA_PRELOAD_SENDFILE64_IN_HEADER 1)
else()
set(RDMA_PRELOAD_FCNTL64_IN_HEADER 0)
set(RDMA_PRELOAD_SENDFILE64_IN_HEADER 0)
endif()

# Provide a shim if C11 stdatomic.h is not supported.
if (NOT HAVE_SPARSE)
CHECK_INCLUDE_FILE("stdatomic.h" HAVE_STDATOMIC)
Expand Down
13 changes: 13 additions & 0 deletions buildlib/rdma_functions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,19 @@ function(rdma_library DEST VERSION_SCRIPT SOVERSION VERSION)
install(TARGETS ${DEST} DESTINATION "${CMAKE_INSTALL_LIBDIR}")
endfunction()

# rsocket LD_PRELOAD module. Requires RDMA_PRELOAD_* variables from top-level
# CMakeLists.txt (RDMA_PRELOAD_WRAP_LFS64 and fcntl64/sendfile64 header probe).
function(rdma_rspreload_module DEST VERSION_SCRIPT)
add_library(${DEST} MODULE ${ARGN})
target_compile_definitions(${DEST} PRIVATE
RDMA_PRELOAD_WRAP_LFS64=${RDMA_PRELOAD_WRAP_LFS64}
RDMA_PRELOAD_FCNTL64_IN_HEADER=${RDMA_PRELOAD_FCNTL64_IN_HEADER}
RDMA_PRELOAD_SENDFILE64_IN_HEADER=${RDMA_PRELOAD_SENDFILE64_IN_HEADER})
set_target_properties(${DEST} PROPERTIES LINK_FLAGS ${CMAKE_SHARED_LINKER_FLAGS})
set_target_properties(${DEST} PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${BUILD_LIB}")
rdma_set_library_map(${DEST} ${VERSION_SCRIPT})
endfunction()

# Create a special provider with exported symbols in it The shared provider
# exists as a normal system library with the normal shared library SONAME and
# other convections. The system library is symlinked into the
Expand Down
2 changes: 1 addition & 1 deletion infiniband-diags/dump_fts.c
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ static void dump_unicast_tables(ibnd_node_t *node, int startl, int endl,
ibnd_fabric_t *fabric)
{
ib_portid_t * portid = &node->path_portid;
char lft[IB_SMP_DATA_SIZE] = { 0 };
uint8_t lft[IB_SMP_DATA_SIZE] = { 0 };
char str[200];
uint64_t nodeguid;
int block, i, e, top;
Expand Down
53 changes: 50 additions & 3 deletions infiniband-diags/ibstat.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,17 @@
#include <sys/stat.h>
#include <fcntl.h>
#include <errno.h>
#include <dirent.h>
#include <linux/types.h> /* __be64 */

#include <infiniband/umad.h>

#include <ibdiag_common.h>

/* IB spec: Port supports Connection Manager (cap_mask bit 16) */
#define IB_PORT_CAP_CM (0x10000)
#define SYS_PORT_GID "gids/0"

static const char * const node_type_str[] = {
"???",
"CA",
Expand Down Expand Up @@ -193,13 +198,55 @@ static int port_dump(umad_port_t * port, int alone)
return 0;
}

static bool port_has_gid(const char *ca_name, int portnum)
{
char path[256];
FILE *f;

snprintf(path, sizeof(path),
SYS_INFINIBAND "/%s/ports/%d/" SYS_PORT_GID, ca_name, portnum);

f = fopen(path, "r");
if (!f)
return false;

fclose(f);
return true;
}

static int port_has_cm_cap(const char *ca_name, int portnum)
{
char path[256], buf[32];
uint32_t capmask;

snprintf(path, sizeof(path),
SYS_INFINIBAND "/%s/ports/%d", ca_name, portnum);

if (sys_read_string(path, SYS_PORT_CAPMASK, buf, sizeof(buf)) < 0)
return 0;

capmask = strtoul(buf, NULL, 0);
return (capmask & IB_PORT_CAP_CM);
}

static int ca_stat(const char *ca_name, int portnum, int no_ports)
{
umad_ca_t ca;
int r;

if ((r = umad_get_ca(ca_name, &ca)) < 0)
int r, check_port;

r = umad_get_ca(ca_name, &ca);
if (r < 0) {
if (portnum == -1)
check_port = 1;
else
check_port = portnum;

if ((!port_has_gid(ca_name, check_port)) && (!port_has_cm_cap(ca_name, check_port))) {
DEBUG("The device %s is not RDMA endpoint device", ca_name);
return 0;
}
return r;
}

if (!ca.node_type)
return 0;
Expand Down
36 changes: 35 additions & 1 deletion kernel-headers/rdma/bnxt_re-abi.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,12 +102,17 @@ struct bnxt_re_pd_resp {
struct bnxt_re_cq_req {
__aligned_u64 cq_va;
__aligned_u64 cq_handle;
__aligned_u64 comp_mask;
};

enum bnxt_re_cq_mask {
enum bnxt_re_resp_cq_mask {
BNXT_RE_CQ_TOGGLE_PAGE_SUPPORT = 0x1,
};

enum bnxt_re_req_cq_mask {
BNXT_RE_CQ_FIXED_NUM_CQE_ENABLE = 0x1,
};

struct bnxt_re_cq_resp {
__u32 cqid;
__u32 tail;
Expand Down Expand Up @@ -163,6 +168,8 @@ enum bnxt_re_objects {
BNXT_RE_OBJECT_ALLOC_PAGE = (1U << UVERBS_ID_NS_SHIFT),
BNXT_RE_OBJECT_NOTIFY_DRV,
BNXT_RE_OBJECT_GET_TOGGLE_MEM,
BNXT_RE_OBJECT_DBR,
BNXT_RE_OBJECT_DEFAULT_DBR,
};

enum bnxt_re_alloc_page_type {
Expand Down Expand Up @@ -231,4 +238,31 @@ struct bnxt_re_packet_pacing_caps {
struct bnxt_re_query_device_ex_resp {
struct bnxt_re_packet_pacing_caps packet_pacing_caps;
};

struct bnxt_re_db_region {
__u32 dpi;
__u32 reserved;
__aligned_u64 umdbr;
};

enum bnxt_re_obj_dbr_alloc_attrs {
BNXT_RE_ALLOC_DBR_HANDLE = (1U << UVERBS_ID_NS_SHIFT),
BNXT_RE_ALLOC_DBR_ATTR,
BNXT_RE_ALLOC_DBR_OFFSET,
};

enum bnxt_re_obj_dbr_free_attrs {
BNXT_RE_FREE_DBR_HANDLE = (1U << UVERBS_ID_NS_SHIFT),
};

enum bnxt_re_obj_default_dbr_attrs {
BNXT_RE_DEFAULT_DBR_ATTR = (1U << UVERBS_ID_NS_SHIFT),
};

enum bnxt_re_obj_dpi_methods {
BNXT_RE_METHOD_DBR_ALLOC = (1U << UVERBS_ID_NS_SHIFT),
BNXT_RE_METHOD_DBR_FREE,
BNXT_RE_METHOD_GET_DEFAULT_DBR,
};

#endif /* __BNXT_RE_UVERBS_ABI_H__*/
6 changes: 3 additions & 3 deletions kernel-headers/rdma/efa-abi.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@
*/

enum {
EFA_ALLOC_UCONTEXT_CMD_COMP_TX_BATCH = 1 << 0,
EFA_ALLOC_UCONTEXT_CMD_COMP_MIN_SQ_WR = 1 << 1,
EFA_ALLOC_UCONTEXT_CMD_SUPP_CAPS_TX_BATCH = 1 << 0,
EFA_ALLOC_UCONTEXT_CMD_SUPP_CAPS_MIN_SQ_WR = 1 << 1,
};

struct efa_ibv_alloc_ucontext_cmd {
__u32 comp_mask;
__u32 supported_caps;
__u8 reserved_20[4];
};

Expand Down
1 change: 1 addition & 0 deletions kernel-headers/rdma/ib_user_ioctl_verbs.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@

enum ib_uverbs_core_support {
IB_UVERBS_CORE_SUPPORT_OPTIONAL_MR_ACCESS = 1 << 0,
IB_UVERBS_CORE_SUPPORT_ROBUST_UDATA = 1 << 1,
};

enum ib_uverbs_access_flags {
Expand Down
6 changes: 1 addition & 5 deletions librdmacm/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,10 @@ target_link_libraries(rdmacm LINK_PRIVATE

# The preload library is a bit special, it needs to be open coded
# Since it is a LD_PRELOAD it has no soname, and is installed in sub dir
add_library(rspreload MODULE
rdma_rspreload_module(rspreload librspreload.map
preload.c
indexer.c
)
# Even though this is a module we still want to use Wl,--no-undefined
set_target_properties(rspreload PROPERTIES LINK_FLAGS ${CMAKE_SHARED_LINKER_FLAGS})
set_target_properties(rspreload PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${BUILD_LIB}")
rdma_set_library_map(rspreload librspreload.map)
target_link_libraries(rspreload LINK_PRIVATE
rdmacm
${CMAKE_THREAD_LIBS_INIT}
Expand Down
4 changes: 4 additions & 0 deletions librdmacm/librspreload.map
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,14 @@
the signature this will go sideways.. */
global:
accept;
accept4;
bind;
close;
connect;
dup;
dup2;
fcntl;
fcntl64;
getpeername;
getsockname;
getsockopt;
Expand All @@ -22,6 +25,7 @@
select;
send;
sendfile;
sendfile64;
sendmsg;
sendto;
setsockopt;
Expand Down
Loading