Skip to content

Commit

Permalink
rpma: add librpma_apm_* and librpma_gpspm_* engines
Browse files Browse the repository at this point in the history
The Remote Persistent Memory Access (RPMA) Library is a C library
created to simplify accessing persistent memory on remote hosts over
Remote Direct Memory Access (RDMA).

The librpma_apm_client and librpma_apm_server is a pair of engines
which allows benchmarking persistent writes achieved via
the Appliance Persistency Method (APM; natively supported by
the librpma library) and regular reads (a part of the RDMA standard).

The librpma_gpspm_client and librpma_gpspm_server is a pair of
engines which allows benchmarking persistent writes achieved via
the General Purpose Persistency Method (GPSPM; build on top of
the librpma API).

The librpma library is available here: https://github.com/pmem/rpma
along with the set of scripts using the newly introduced engines
to construct miscellaneous benchmarking scenarios:
https://github.com/pmem/rpma/tree/master/tools/perf

The full history of the development of the librpma fio engines
is available at: https://github.com/pmem/fio/tree/rpma

Co-Authored-By: Lukasz Dorau <[email protected]>
Co-Authored-By: Tomasz Gromadzki <[email protected]>
Co-Authored-By: Jan Michalski <[email protected]>
Co-Authored-By: Oksana Salyk <[email protected]>
  • Loading branch information
4 people committed Mar 13, 2021
1 parent b02c5ed commit e4c4625
Show file tree
Hide file tree
Showing 21 changed files with 2,948 additions and 2 deletions.
11 changes: 10 additions & 1 deletion HOWTO
Original file line number Diff line number Diff line change
Expand Up @@ -2189,7 +2189,7 @@ with the caveat that when used on the command line, they must come after the
this will be the starting port number since fio will use a range of
ports.

[rdma]
[rdma], [librpma_*]

The port to use for RDMA-CM communication. This should be the same value
on the client and the server side.
Expand All @@ -2200,6 +2200,15 @@ with the caveat that when used on the command line, they must come after the
is a TCP listener or UDP reader, the hostname is not used and must be omitted
unless it is a valid UDP multicast address.

.. option:: serverip=str : [librpma_*]

The IP address to be used for RDMA-CM based I/O.

.. option:: direct_write_to_pmem=bool : [librpma_*]

Set to 1 only when Direct Write to PMem from the remote host is possible.
Otherwise, set to 0.

.. option:: interface=str : [netsplice] [net]

The IP address of the network interface used to send or receive UDP
Expand Down
15 changes: 15 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,21 @@ ifdef CONFIG_RDMA
rdma_LIBS = -libverbs -lrdmacm
ENGINES += rdma
endif
ifdef CONFIG_LIBRPMA_APM
librpma_apm_SRCS = engines/librpma_apm.c
librpma_fio_SRCS = engines/librpma_fio.c
librpma_apm_LIBS = -lrpma -lpmem
ENGINES += librpma_apm
endif
ifdef CONFIG_LIBRPMA_GPSPM
librpma_gpspm_SRCS = engines/librpma_gpspm.c engines/librpma_gpspm_flush.pb-c.c
librpma_fio_SRCS = engines/librpma_fio.c
librpma_gpspm_LIBS = -lrpma -lpmem -lprotobuf-c
ENGINES += librpma_gpspm
endif
ifdef librpma_fio_SRCS
SOURCE += $(librpma_fio_SRCS)
endif
ifdef CONFIG_POSIXAIO
SOURCE += engines/posixaio.c
endif
Expand Down
22 changes: 22 additions & 0 deletions ci/travis-install-librpma.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/bash -e

# 11.02.2021 Merge pull request #866 from ldorau/rpma-mmap-memory-for-rpma_mr_reg-in-rpma_flush_apm_new
LIBRPMA_VERSION=fbac593917e98f3f26abf14f4fad5a832b330f5c
ZIP_FILE=rpma.zip

WORKDIR=$(pwd)

# install librpma
wget -O $ZIP_FILE https://github.com/pmem/rpma/archive/${LIBRPMA_VERSION}.zip
unzip $ZIP_FILE
mkdir -p rpma-${LIBRPMA_VERSION}/build
cd rpma-${LIBRPMA_VERSION}/build
cmake .. -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr \
-DBUILD_DOC=OFF \
-DBUILD_EXAMPLES=OFF \
-DBUILD_TESTS=OFF
make -j$(nproc)
sudo make -j$(nproc) install
cd $WORKDIR
rm -rf $ZIP_FILE rpma-${LIBRPMA_VERSION}
28 changes: 28 additions & 0 deletions ci/travis-install-pmdk.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/bin/bash -e

# pmdk v1.9.1 release
PMDK_VERSION=1.9.1

WORKDIR=$(pwd)

#
# The '/bin/sh' shell used by PMDK's 'make install'
# does not know the exact localization of clang
# and fails with:
# /bin/sh: 1: clang: not found
# if CC is not set to the full path of clang.
#
export CC=$(which $CC)

# Install PMDK libraries, because PMDK's libpmem
# is a dependency of the librpma fio engine.
# Install it from a release package
# with already generated documentation,
# in order to not install 'pandoc'.
wget https://github.com/pmem/pmdk/releases/download/${PMDK_VERSION}/pmdk-${PMDK_VERSION}.tar.gz
tar -xzf pmdk-${PMDK_VERSION}.tar.gz
cd pmdk-${PMDK_VERSION}
make -j$(nproc) NDCTL_ENABLE=n
sudo make -j$(nproc) install prefix=/usr NDCTL_ENABLE=n
cd $WORKDIR
rm -rf pmdk-${PMDK_VERSION}
10 changes: 10 additions & 0 deletions ci/travis-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,16 @@ case "$TRAVIS_OS_NAME" in
)
sudo apt-get -qq update
sudo apt-get install --no-install-recommends -qq -y "${pkgs[@]}"
# librpma is supported on the amd64 (x86_64) architecture for now
if [[ $CI_TARGET_ARCH == "amd64" ]]; then
# install libprotobuf-c-dev required by librpma_gpspm
sudo apt-get install --no-install-recommends -qq -y libprotobuf-c-dev
# PMDK libraries have to be installed, because
# libpmem is a dependency of the librpma fio engine
ci/travis-install-pmdk.sh
# install librpma from sources from GitHub
ci/travis-install-librpma.sh
fi
;;
"osx")
brew update >/dev/null 2>&1
Expand Down
52 changes: 52 additions & 0 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -920,6 +920,49 @@ if test "$disable_rdma" != "yes" && compile_prog "" "-lrdmacm" "rdma"; then
fi
print_config "rdmacm" "$rdmacm"

##########################################
# librpma probe
if test "$librpma" != "yes" ; then
librpma="no"
fi
cat > $TMPC << EOF
#include <stdio.h>
#include <librpma.h>
int main(int argc, char **argv)
{
enum rpma_conn_event event = RPMA_CONN_REJECTED;
(void) event; /* unused */
rpma_log_set_threshold(RPMA_LOG_THRESHOLD, RPMA_LOG_LEVEL_INFO);
return 0;
}
EOF
if test "$disable_rdma" != "yes" && compile_prog "" "-lrpma" "rpma"; then
librpma="yes"
fi
print_config "librpma" "$librpma"

##########################################
# libprotobuf-c probe
if test "$libprotobuf_c" != "yes" ; then
libprotobuf_c="no"
fi
cat > $TMPC << EOF
#include <stdio.h>
#include <protobuf-c/protobuf-c.h>
#if !defined(PROTOBUF_C_VERSION_NUMBER)
# error PROTOBUF_C_VERSION_NUMBER is not defined!
#endif
int main(int argc, char **argv)
{
(void)protobuf_c_message_check(NULL);
return 0;
}
EOF
if compile_prog "" "-lprotobuf-c" "protobuf_c"; then
libprotobuf_c="yes"
fi
print_config "libprotobuf_c" "$libprotobuf_c"

##########################################
# asprintf() and vasprintf() probes
if test "$have_asprintf" != "yes" ; then
Expand Down Expand Up @@ -2788,6 +2831,15 @@ fi
if test "$libverbs" = "yes" -a "$rdmacm" = "yes" ; then
output_sym "CONFIG_RDMA"
fi
# librpma is supported on the 'x86_64' architecture for now
if test "$cpu" = "x86_64" -a "$libverbs" = "yes" -a "$rdmacm" = "yes" \
-a "$librpma" = "yes" -a "$libpmem" = "yes" ; then
output_sym "CONFIG_LIBRPMA_APM"
fi
if test "$cpu" = "x86_64" -a "$libverbs" = "yes" -a "$rdmacm" = "yes" \
-a "$librpma" = "yes" -a "$libpmem" = "yes" -a "$libprotobuf_c" = "yes" ; then
output_sym "CONFIG_LIBRPMA_GPSPM"
fi
if test "$clock_gettime" = "yes" ; then
output_sym "CONFIG_CLOCK_GETTIME"
fi
Expand Down
Loading

0 comments on commit e4c4625

Please sign in to comment.