Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 4 additions & 0 deletions debian/librdmacm1.symbols
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,14 @@ librdmacm.so.1 librdmacm1 #MINVER#
RDMACM_1.2@RDMACM_1.2 23
RDMACM_1.3@RDMACM_1.3 31
RDMACM_1.4@RDMACM_1.4 60
RDMACM_1.5@RDMACM_1.5 61
raccept@RDMACM_1.0 1.0.16
rbind@RDMACM_1.0 1.0.16
rclose@RDMACM_1.0 1.0.16
rconnect@RDMACM_1.0 1.0.16
repoll_create1@RDMACM_1.5 61
repoll_ctl@RDMACM_1.5 61
repoll_wait@RDMACM_1.5 61
rdma_accept@RDMACM_1.0 1.0.15
rdma_ack_cm_event@RDMACM_1.0 1.0.15
rdma_bind_addr@RDMACM_1.0 1.0.15
Expand Down
59 changes: 58 additions & 1 deletion librdmacm/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ publish_headers(infiniband

rdma_library(rdmacm librdmacm.map
# See Documentation/versioning.md
1 1.4.${PACKAGE_VERSION}
1 1.5.${PACKAGE_VERSION}
acm.c
addrinfo.c
cma.c
Expand All @@ -25,12 +25,69 @@ target_link_libraries(rdmacm LINK_PRIVATE
${RT_LIBRARIES}
)

# When building without LFS (_FILE_OFFSET_BITS != 64), we may need to wrap
# fcntl64/sendfile64. Only do so if the system libc actually provides them
set(CMAKE_REQUIRED_QUIET 1)
set(SAVE_DEFS "${CMAKE_REQUIRED_DEFINITIONS}")
set(CMAKE_REQUIRED_DEFINITIONS "")
check_c_source_compiles("
#include <fcntl.h>
#include <sys/sendfile.h>
int main(void) {
(void)&fcntl64;
(void)&sendfile64;
return 0;
}
" RDMA_PRELOAD_HAVE_64)
set(CMAKE_REQUIRED_DEFINITIONS "${SAVE_DEFS}")
set(CMAKE_REQUIRED_QUIET 0)
if(RDMA_PRELOAD_HAVE_64)
set(RDMA_PRELOAD_HAVE_LFS_WRAPPER_SYMS 1)
else()
set(RDMA_PRELOAD_HAVE_LFS_WRAPPER_SYMS 0)
endif()

# Detect at configure time if fcntl64/sendfile64 is declared so we can
# add our forward declarations only when needed.
set(RDMA_PRELOAD_FCNTL64_IN_HEADER 0)
set(RDMA_PRELOAD_SENDFILE64_IN_HEADER 0)
if(RDMA_PRELOAD_HAVE_LFS_WRAPPER_SYMS)
set(CMAKE_REQUIRED_QUIET 1)
set(SAVE_FLAGS "${CMAKE_REQUIRED_FLAGS}")
set(CMAKE_REQUIRED_FLAGS "${CMAKE_C_FLAGS}")
check_c_source_compiles("
#define _GNU_SOURCE
#include <fcntl.h>
int fcntl64(int socket, int cmd, ...) { (void)socket;(void)cmd; return 0; }
" RDMA_PRELOAD_FCNTL64_DECLARED_IN_HEADER)
if(RDMA_PRELOAD_FCNTL64_DECLARED_IN_HEADER)
set(RDMA_PRELOAD_FCNTL64_IN_HEADER 1)
endif()
check_c_source_compiles("
#define _GNU_SOURCE
#include <sys/sendfile.h>
#include <sys/types.h>
ssize_t sendfile64(int out_fd, int in_fd, off64_t *offset64, size_t count) {
(void)out_fd;(void)in_fd;(void)offset64;(void)count; return 0;
}
" RDMA_PRELOAD_SENDFILE64_DECLARED_IN_HEADER)
if(RDMA_PRELOAD_SENDFILE64_DECLARED_IN_HEADER)
set(RDMA_PRELOAD_SENDFILE64_IN_HEADER 1)
endif()
set(CMAKE_REQUIRED_FLAGS "${SAVE_FLAGS}")
set(CMAKE_REQUIRED_QUIET 0)
endif()

# 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
preload.c
indexer.c
)
target_compile_definitions(rspreload PRIVATE
RDMA_PRELOAD_HAVE_64=${RDMA_PRELOAD_HAVE_LFS_WRAPPER_SYMS}
RDMA_PRELOAD_FCNTL64_IN_HEADER=${RDMA_PRELOAD_FCNTL64_IN_HEADER}
RDMA_PRELOAD_SENDFILE64_IN_HEADER=${RDMA_PRELOAD_SENDFILE64_IN_HEADER})
# 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}")
Expand Down
1 change: 1 addition & 0 deletions librdmacm/cma.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ int ucma_init(void);
extern int af_ib_support;

#define RAI_ROUTEONLY 0x01000000
#define EPOLL_FLAG 0x80000000

void ucma_ib_init(void);
void ucma_ib_cleanup(void);
Expand Down
7 changes: 7 additions & 0 deletions librdmacm/librdmacm.map
Original file line number Diff line number Diff line change
Expand Up @@ -94,3 +94,10 @@ RDMACM_1.4 {
rdma_resolve_addrinfo;
rdma_write_cm_event;
} RDMACM_1.3;

RDMACM_1.5 {
global:
repoll_create1;
repoll_ctl;
repoll_wait;
} RDMACM_1.4;
8 changes: 8 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,12 +25,17 @@
select;
send;
sendfile;
sendfile64;
sendmsg;
sendto;
setsockopt;
shutdown;
socket;
write;
writev;
epoll_create;
epoll_create1;
epoll_ctl;
epoll_wait;
local: *;
};
5 changes: 4 additions & 1 deletion librdmacm/man/rsocket.7.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.\" Licensed under the OpenIB.org BSD license (FreeBSD Variant) - See COPYING.md
.TH "RSOCKET" 7 "2019-04-16" "librdmacm" "Librdmacm Programmer's Manual" librdmacm
.TH "RSOCKET" 7 "2024-12-24" "librdmacm" "Librdmacm Programmer's Manual" librdmacm
.SH NAME
rsocket \- RDMA socket API
.SH SYNOPSIS
Expand Down Expand Up @@ -30,6 +30,7 @@ rpoll, rselect
rgetpeername, rgetsockname
.P
rsetsockopt, rgetsockopt, rfcntl
repoll_create1, repoll_ctl, repoll_wait
.P
Functions take the same parameters as that used for sockets. The
follow capabilities and flags are supported at this time:
Expand Down Expand Up @@ -151,6 +152,8 @@ wake_up_interval - maximum number of milliseconds to block in poll.
This value is used to safe guard against potential application hangs
in rpoll().
.P
max_events - maximum number of events for the epoll thread to handle for an epoll_instance.
.P
All configuration files should contain a single integer value. Values may
be set by issuing a command similar to the following example.
.P
Expand Down
Loading