Commit a8b168f9 authored by Ana Guerrero López's avatar Ana Guerrero López

Imported Upstream version 3.0+0.9.g214990b

parent 662f3497
......@@ -19,6 +19,7 @@ libperftest_a_SOURCES = src/get_clock.c src/perftest_communication.c src/perftes
noinst_HEADERS = src/get_clock.h src/perftest_communication.h src/perftest_parameters.h src/perftest_resources.h
bin_PROGRAMS = ib_send_bw ib_send_lat ib_write_lat ib_write_bw ib_read_lat ib_read_bw ib_atomic_lat ib_atomic_bw
bin_SCRIPTS = run_perftest_loopback
if HAVE_RAW_ETH
libperftest_a_SOURCES += src/raw_ethernet_resources.c
......
......@@ -30,6 +30,7 @@
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
......@@ -102,7 +103,7 @@ libperftest_a_OBJECTS = $(am_libperftest_a_OBJECTS)
@HAVE_RAW_ETH_TRUE@am__EXEEXT_1 = raw_ethernet_bw$(EXEEXT) \
@HAVE_RAW_ETH_TRUE@ raw_ethernet_lat$(EXEEXT)
am__EXEEXT_2 =
am__installdirs = "$(DESTDIR)$(bindir)"
am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(bindir)"
PROGRAMS = $(bin_PROGRAMS)
am_ib_atomic_bw_OBJECTS = src/atomic_bw.$(OBJEXT)
ib_atomic_bw_OBJECTS = $(am_ib_atomic_bw_OBJECTS)
......@@ -148,6 +149,28 @@ am__raw_ethernet_lat_SOURCES_DIST = src/raw_ethernet_send_lat.c
raw_ethernet_lat_OBJECTS = $(am_raw_ethernet_lat_OBJECTS)
@HAVE_RAW_ETH_TRUE@raw_ethernet_lat_DEPENDENCIES = libperftest.a \
@HAVE_RAW_ETH_TRUE@ $(am__DEPENDENCIES_1)
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
am__vpath_adj = case $$p in \
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
*) f=$$p;; \
esac;
am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
am__install_max = 40
am__nobase_strip_setup = \
srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
am__nobase_strip = \
for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
am__nobase_list = $(am__nobase_strip_setup); \
for p in $$list; do echo "$$p $$p"; done | \
sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
$(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
if (++n[$$2] == $(am__install_max)) \
{ print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
END { for (dir in files) print dir, files[dir] }'
am__base_list = \
sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
SCRIPTS = $(bin_SCRIPTS)
DEFAULT_INCLUDES = -I.@am__isrc@
depcomp = $(SHELL) $(top_srcdir)/config/depcomp
am__depfiles_maybe = depfiles
......@@ -334,6 +357,7 @@ libperftest_a_SOURCES = src/get_clock.c src/perftest_communication.c \
noinst_HEADERS = src/get_clock.h src/perftest_communication.h \
src/perftest_parameters.h src/perftest_resources.h \
$(am__append_2) $(am__append_5)
bin_SCRIPTS = run_perftest_loopback
ib_send_bw_SOURCES = src/send_bw.c src/multicast_resources.c src/multicast_resources.h
ib_send_bw_LDADD = libperftest.a $(LIBUMAD) $(LIBMATH)
ib_send_lat_SOURCES = src/send_lat.c src/multicast_resources.c src/multicast_resources.h
......@@ -532,6 +556,40 @@ src/raw_ethernet_send_lat.$(OBJEXT): src/$(am__dirstamp) \
raw_ethernet_lat$(EXEEXT): $(raw_ethernet_lat_OBJECTS) $(raw_ethernet_lat_DEPENDENCIES)
@rm -f raw_ethernet_lat$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(raw_ethernet_lat_OBJECTS) $(raw_ethernet_lat_LDADD) $(LIBS)
install-binSCRIPTS: $(bin_SCRIPTS)
@$(NORMAL_INSTALL)
test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)"
@list='$(bin_SCRIPTS)'; test -n "$(bindir)" || list=; \
for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \
done | \
sed -e 'p;s,.*/,,;n' \
-e 'h;s|.*|.|' \
-e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \
$(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \
{ d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
if ($$2 == $$4) { files[d] = files[d] " " $$1; \
if (++n[d] == $(am__install_max)) { \
print "f", d, files[d]; n[d] = 0; files[d] = "" } } \
else { print "f", d "/" $$4, $$1 } } \
END { for (d in files) print "f", d, files[d] }' | \
while read type dir files; do \
if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
test -z "$$files" || { \
echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(bindir)$$dir'"; \
$(INSTALL_SCRIPT) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
} \
; done
uninstall-binSCRIPTS:
@$(NORMAL_UNINSTALL)
@list='$(bin_SCRIPTS)'; test -n "$(bindir)" || exit 0; \
files=`for p in $$list; do echo "$$p"; done | \
sed -e 's,.*/,,;$(transform)'`; \
test -n "$$list" || exit 0; \
echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
cd "$(DESTDIR)$(bindir)" && rm -f $$files
mostlyclean-compile:
-rm -f *.$(OBJEXT)
......@@ -809,9 +867,10 @@ distcleancheck: distclean
exit 1; } >&2
check-am: all-am
check: check-am
all-am: Makefile $(LIBRARIES) $(PROGRAMS) $(HEADERS) config.h
all-am: Makefile $(LIBRARIES) $(PROGRAMS) $(SCRIPTS) $(HEADERS) \
config.h
installdirs:
for dir in "$(DESTDIR)$(bindir)"; do \
for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(bindir)"; do \
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done
install: install-am
......@@ -871,7 +930,7 @@ install-dvi: install-dvi-am
install-dvi-am:
install-exec-am: install-binPROGRAMS
install-exec-am: install-binPROGRAMS install-binSCRIPTS
install-html: install-html-am
......@@ -913,7 +972,7 @@ ps: ps-am
ps-am:
uninstall-am: uninstall-binPROGRAMS
uninstall-am: uninstall-binPROGRAMS uninstall-binSCRIPTS
.MAKE: all install-am install-strip
......@@ -924,15 +983,16 @@ uninstall-am: uninstall-binPROGRAMS
distclean distclean-compile distclean-generic distclean-hdr \
distclean-libtool distclean-tags distcleancheck distdir \
distuninstallcheck dvi dvi-am html html-am info info-am \
install install-am install-binPROGRAMS install-data \
install-data-am install-dvi install-dvi-am install-exec \
install-exec-am install-html install-html-am install-info \
install-info-am install-man install-pdf install-pdf-am \
install-ps install-ps-am install-strip installcheck \
installcheck-am installdirs maintainer-clean \
install install-am install-binPROGRAMS install-binSCRIPTS \
install-data install-data-am install-dvi install-dvi-am \
install-exec install-exec-am install-html install-html-am \
install-info install-info-am install-man install-pdf \
install-pdf-am install-ps install-ps-am install-strip \
installcheck installcheck-am installdirs maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-compile \
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
tags uninstall uninstall-am uninstall-binPROGRAMS
tags uninstall uninstall-am uninstall-binPROGRAMS \
uninstall-binSCRIPTS
# Tell versions [3.59,3.63) of GNU make to not export all variables.
......
Open Fabrics Enterprise Distribution (OFED)
Performance Tests README for OFED 2.3
April 2014
Performance Tests README for OFED 3.0
March 2015
......@@ -125,70 +125,70 @@ Client: ./<test name> <options> <server IP address>
Common Options to all tests:
----------------------------
-h, --help Display this help message screen
-p, --port=<port> Listen on/connect to port <port> (default: 18515)
-R, --rdma_cm Connect QPs with rdma_cm and run test on those QPs
-z, --com_rdma_cm Communicate with rdma_cm module to exchange data - use regular QPs
-m, --mtu=<mtu> QP Mtu size (default: active_mtu from ibv_devinfo)
-c, --connection=<RC/UC/UD/XRC> Connection type RC/UC/UD/XRC (default RC)
-d, --ib-dev=<dev> Use IB device <dev> (default: first device found)
-i, --ib-port=<port> Use network port <port> of IB device (default: 1)
-s, --size=<size> Size of message to exchange (default: 1)
-a, --all Run sizes from 2 till 2^23
-n, --iters=<iters> Number of exchanges (at least 100, default: 1000)
-x, --gid-index=<index> Test uses GID with GID index taken from command
-V, --version Display version number
-e, --events Sleep on CQ events (default poll)
-F, --CPU-freq Do not fail even if cpufreq_ondemand module
-I, --inline_size=<size> Max size of message to be sent in inline mode
-u, --qp-timeout=<timeout> QP timeout = (4 uSec)*(2^timeout) (default: 14)
-S, --sl=<sl> Service Level (default 0)
-r, --rx-depth=<dep> Receive queue depth (default 600)
-h, --help Display this help message screen
-p, --port=<port> Listen on/connect to port <port> (default: 18515)
-R, --rdma_cm Connect QPs with rdma_cm and run test on those QPs
-z, --com_rdma_cm Communicate with rdma_cm module to exchange data - use regular QPs
-m, --mtu=<mtu> QP Mtu size (default: active_mtu from ibv_devinfo)
-c, --connection=<RC/UC/UD/XRC/DC> Connection type RC/UC/UD/XRC/DC (default RC).
-d, --ib-dev=<dev> Use IB device <dev> (default: first device found)
-i, --ib-port=<port> Use network port <port> of IB device (default: 1)
-s, --size=<size> Size of message to exchange (default: 1)
-a, --all Run sizes from 2 till 2^23
-n, --iters=<iters> Number of exchanges (at least 100, default: 1000)
-x, --gid-index=<index> Test uses GID with GID index taken from command
-V, --version Display version number
-e, --events Sleep on CQ events (default poll)
-F, --CPU-freq Do not fail even if cpufreq_ondemand module
-I, --inline_size=<size> Max size of message to be sent in inline mode
-u, --qp-timeout=<timeout> QP timeout = (4 uSec)*(2^timeout) (default: 14)
-S, --sl=<sl> Service Level (default 0)
-r, --rx-depth=<dep> Receive queue depth (default 600)
Options for latency tests:
--------------------------
-C, --report-cycles Report times in CPU cycle units
-H, --report-histogram Print out all results (Default: summary only)
-U, --report-unsorted Print out unsorted results (default sorted)
-C, --report-cycles Report times in CPU cycle units
-H, --report-histogram Print out all results (Default: summary only)
-U, --report-unsorted Print out unsorted results (default sorted)
Options for BW tests:
---------------------
-b, --bidirectional Measure bidirectional bandwidth (default uni)
-N, --no peak-bw Cancel peak-bw calculation (default with peak-bw)
-Q, --cq-mod Generate Cqe only after <cq-mod> completion
-t, --tx-depth=<dep> Size of tx queue (default: 128)
-O, --dualport Run test in dual-port mode (2 QPs). Both ports must be active (default OFF)
-b, --bidirectional Measure bidirectional bandwidth (default uni)
-N, --no peak-bw Cancel peak-bw calculation (default with peak-bw)
-Q, --cq-mod Generate Cqe only after <cq-mod> completion
-t, --tx-depth=<dep> Size of tx queue (default: 128)
-O, --dualport Run test in dual-port mode (2 QPs). Both ports must be active (default OFF)
-D, --duration=<sec> Run test for <sec> period of seconds
-f, --margin=<sec> When in Duration, measure results within margins (default: 2)
-l, --post_list=<list size> Post list of WQEs of <list size> size (instead of single post)
-l, --post_list=<list size> Post list of WQEs of <list size> size (instead of single post)
-q, --qp=<num of qp's> Num of QPs running in the process (default: 1)
--run_infinitely Run test until interrupted by user, print results every 5 seconds
SEND tests (ib_send_lat or ib_send_bw) flags:
---------------------------------------------
-r, --rx-depth=<dep> Size of receive queue (default: 512 in BW test)
-r, --rx-depth=<dep> Size of receive queue (default: 512 in BW test)
-g, --mcg=<num_of_qps> Send messages to multicast group with <num_of_qps> qps attached to it
-M, --MGID=<multicast_gid> In multicast, uses <multicast_gid> as the group MGID
-M, --MGID=<multicast_gid> In multicast, uses <multicast_gid> as the group MGID
ATOMIC tests (ib_atomic_lat or ib_atomic_bw) flags:
---------------------------------------------------
-A, --atomic_type=<type> type of atomic operation from {CMP_AND_SWAP,FETCH_AND_ADD}
-A, --atomic_type=<type> type of atomic operation from {CMP_AND_SWAP,FETCH_AND_ADD}
-o, --outs=<num> Number of outstanding read/atomic requests - also on READ tests
Options for raw_ethernet_send_bw:
---------------------------------
-B, --source_mac source MAC address by this format XX:XX:XX:XX:XX:XX (default take the MAC address form GID)
-E, --dest_mac destination MAC address by this format XX:XX:XX:XX:XX:XX **MUST** be entered
-J, --server_ip server ip address by this format X.X.X.X (using to send packets with IP header)
-j, --client_ip client ip address by this format X.X.X.X (using to send packets with IP header)
-K, --server_port server udp port number (using to send packets with UPD header)
-k, --client_port client udp port number (using to send packets with UDP header)
-Z, --server choose server side for the current machine (--server/--client must be selected)
-P, --client choose client side for the current machine (--server/--client must be selected)
-B, --source_mac source MAC address by this format XX:XX:XX:XX:XX:XX (default take the MAC address form GID)
-E, --dest_mac destination MAC address by this format XX:XX:XX:XX:XX:XX **MUST** be entered
-J, --server_ip server ip address by this format X.X.X.X (using to send packets with IP header)
-j, --client_ip client ip address by this format X.X.X.X (using to send packets with IP header)
-K, --server_port server udp port number (using to send packets with UPD header)
-k, --client_port client udp port number (using to send packets with UDP header)
-Z, --server choose server side for the current machine (--server/--client must be selected)
-P, --client choose client side for the current machine (--server/--client must be selected)
----------------------------------------------
Special feature detailed explanation in tests:
......@@ -225,12 +225,12 @@ Special feature detailed explanation in tests:
2. Bidirectional support in ib_send_bw test, when running in UD or UC mode.
In rare cases, the benchmark program may hang.
This release added a feature for hang detection, which will exit test in those situations.
perftest-2.3 release includes a feature for hang detection, which will exit test after 2 mins in those situations.
3. Different versions of perftest may not be compatible with each other.
Please use the same perftest version on both sides to ensure consistency of benchmark results.
4. Version 5.2 won't work with previous versions of perftest.
4. Test version 5.3 and above won't work with previous versions of perftest.
5. This perftest package won't compile on MLNX_OFED-2.1 due to API changes in MLNX_OFED-2.2
In order to compile it properly, please do:
......@@ -239,6 +239,7 @@ Special feature detailed explanation in tests:
6. In te x390x platform virtualized environment the results shown by package test applications can be incorrect.
7. This release includes support for dualport VPI test - port1-Ethernet , port2-IB. (in addition to Eth:Eth, IB:IB)
7. perftest-2.3 release includes support for dualport VPI test - port1-Ethernet , port2-IB. (in addition to Eth:Eth, IB:IB)
Currently, running dualport when port1-IB , port2-Ethernet still not working.
8. for postlist, tests will not finish correctly when using iterations and num_iters/poslist_val has a remainder.
=======================================
Build instructions:
=======================================
# ./autogen.sh
# ./configure --build= --host=sparc64-redhat-linux-gnu
--target=sparc64-linux --program-prefix= --prefix=/usr
--exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin
--sysconfdir=/etc --datadir=/usr/share --includedir=/usr/include
--libdir=/usr/lib64 --libexecdir=/usr/libexec --localstatedir=/var
--sharedstatedir=/var/lib --mandir=/usr/share/man
--infodir=/usr/share/info
# make clean && make V=1
=======================================
RPM queries:
=======================================
# rpm --eval %{_target}
sparc64-linux
# rpm --eval %{_host}
sparc64-redhat-linux-gnu
=======================================
GCC queries:
=======================================
Get all the gcc definitions for the platform:
# gcc -E -dM - < /dev/null
...
#define __sparc__ 1
...
#define __arch64__ 1
...
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -3,6 +3,9 @@
/* Enable CUDA feature */
#undef CUDA_PATH
/* Enable Accelerated verbs feature */
#undef HAVE_ACCL_VERBS
/* Enable CUDA feature */
#undef HAVE_CUDA
......
This diff is collapsed.
......@@ -11,7 +11,7 @@
# $HEADER$
dnl Process this file with autoconf to produce a configure script.
AC_INIT([perftest],[5.33],[linux-rdma@vger.kernel.org])
AC_INIT([perftest],[5.5],[linux-rdma@vger.kernel.org])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_AUX_DIR([config])
AC_CONFIG_MACRO_DIR([m4])
......@@ -22,6 +22,7 @@ AC_SUBST(MAJOR_VERSION)
AC_SUBST(MINOR_VERSION)
AC_ARG_VAR(CUDA_H_PATH, help-string)
AC_ARG_VAR(RANLIB, ranlib tool)
AC_ARG_ENABLE([verbs_exp],
[AS_HELP_STRING([--disable-verbs_exp],
......@@ -37,22 +38,13 @@ AC_PROG_CXX
AM_PROG_AS
AC_PROG_INSTALL
AC_PROG_LIBTOOL
AC_PROG_RANLIB
AC_HEADER_STDC
AC_CHECK_HEADERS([infiniband/verbs.h],,[AC_MSG_ERROR([ibverbs header files not found])])
AC_CHECK_LIB([ibverbs], [ibv_get_device_list], [], [AC_MSG_ERROR([libibverbs not found])])
AC_CHECK_LIB([rdmacm], [rdma_create_event_channel], [], AC_MSG_ERROR([librdmacm-devel not found]))
AC_CHECK_LIB([ibumad], [umad_init], [LIBUMAD=-libumad], AC_MSG_ERROR([libibumad not found]))
AC_CHECK_LIB([m], [log], [LIBMATH=-lm], AC_MSG_ERROR([libm not found]))
AC_TRY_LINK([
#include <infiniband/verbs.h>
#include <infiniband/verbs_exp.h>],
[int x = IBV_EXP_ACCESS_ON_DEMAND;],[HAVE_ODP=yes], [HAVE_ODP=no])
AM_CONDITIONAL([HAVE_ODP],[test "x$HAVE_ODP" = "xyes"])
if [test $HAVE_ODP = yes] && [test $HAVE_ODP = yes]; then
AC_DEFINE([HAVE_ODP], [1], [Have ODP support])
fi
AC_TRY_LINK([#include <infiniband/verbs.h>],
[struct ibv_exp_flow *t = ibv_exp_create_flow(NULL,NULL);],[HAVE_RAW_ETH_EXP=yes], [HAVE_RAW_ETH_EXP=no])
......@@ -137,6 +129,24 @@ if [test $HAVE_DC = yes] && [test $HAVE_VERBS_EXP = yes]; then
AC_DEFINE([HAVE_DC], [1], [Enable DC feature])
fi
AC_TRY_LINK([
#include <infiniband/verbs.h>
#include <infiniband/verbs_exp.h>],
[int x = IBV_EXP_INTF_GLOBAL;],[HAVE_ACCL_VERBS=yes], [HAVE_ACCL_VERBS=no])
AM_CONDITIONAL([HAVE_ACCL_VERBS],[test "x$HAVE_ACCL_VERBS" = "xyes"])
if [test $HAVE_ACCL_VERBS = yes] && [test $HAVE_VERBS_EXP = yes]; then
AC_DEFINE([HAVE_ACCL_VERBS], [1], [Enable Accelerated verbs feature])
fi
AC_TRY_LINK([
#include <infiniband/verbs.h>
#include <infiniband/verbs_exp.h>],
[int x = IBV_EXP_ACCESS_ON_DEMAND;],[HAVE_ODP=yes], [HAVE_ODP=no])
AM_CONDITIONAL([HAVE_ODP],[test "x$HAVE_ODP" = "xyes"])
if [test $HAVE_ODP = yes] && [test $HAVE_VERBS_EXP = yes]; then
AC_DEFINE([HAVE_ODP], [1], [Have ODP support])
fi
if [test "$CUDA_H_PATH" ]; then
AC_DEFINE([HAVE_CUDA], [1], [Enable CUDA feature])
AC_DEFINE_UNQUOTED([CUDA_PATH], "$CUDA_H_PATH" , [Enable CUDA feature])
......
Name: perftest
Summary: IB Performance tests
Version: 2.3
Release: 0.12.gcb5b746
Version: 3.0
Release: 0.9.g214990b
License: BSD 3-Clause, GPL v2 or later
Group: Productivity/Networking/Diagnostic
Source: http://www.openfabrics.org/downloads/perftest-2.3-0.12.gcb5b746.tar.gz
Source: http://www.openfabrics.org/downloads/perftest-3.0-0.9.g214990b.tar.gz
Url: http://www.openfabrics.org
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: libibverbs-devel librdmacm-devel libibumad-devel
......
#!/bin/sh
# trivial script to launch a loopback test on the same device
# example: run_perftest_loopback 0 1 ib_write_bw -s 10
if [ $# -lt 3 ] ; then
echo ""
echo "Usage: run_perftest_loopback <server_core> <client_core> <test command>"
echo "example: run_perftest_loopback 0 1 ib_write_bw -s 10"
exit 3
fi
server_core=$1
client_core=$2
shift 2
taskset -c $server_core $* &
#give server time to start
sleep 1
taskset -c $client_core $* localhost
status=$?
wait
exit $status
This diff is collapsed.
......@@ -50,17 +50,16 @@
/******************************************************************************
*
******************************************************************************/
int main(int argc, char *argv[]) {
int ret_parser;
struct report_options report;
struct pingpong_context ctx;
struct pingpong_dest *my_dest = NULL;
struct pingpong_dest *rem_dest = NULL;
struct ibv_device *ib_dev;
struct perftest_parameters user_param;
int main(int argc, char *argv[])
{
int ret_parser, i;
struct report_options report;
struct pingpong_context ctx;
struct pingpong_dest *my_dest = NULL;
struct pingpong_dest *rem_dest = NULL;
struct ibv_device *ib_dev;
struct perftest_parameters user_param;
struct perftest_comm user_comm;
int i;
/* init default values to user's parameters */
memset(&ctx,0,sizeof(struct pingpong_context));
......@@ -78,38 +77,44 @@ int main(int argc, char *argv[]) {
fprintf(stderr," Parser function exited with Error\n");
return 1;
}
if(user_param.use_xrc) {
if(user_param.use_xrc)
user_param.num_of_qps *= 2;
}
// Finding the IB device selected (or defalut if no selected).
/* Finding the IB device selected (or defalut if no selected). */
ib_dev = ctx_find_dev(user_param.ib_devname);
if (!ib_dev) {
fprintf(stderr," Unable to find the Infiniband/RoCE device\n");
return FAILURE;
}
// Getting the relevant context from the device
/* Getting the relevant context from the device */
ctx.context = ibv_open_device(ib_dev);
if (!ctx.context) {
fprintf(stderr, " Couldn't get context for the device\n");
return 1;
}
if (ib_dev_name(ctx.context) == CONNECTIB)
{
#ifdef HAVE_MASKED_ATOMICS
if (check_masked_atomics_support(&ctx)) {
user_param.masked_atomics = 1;
user_param.use_exp = 1;
}
// See if MTU and link type are valid and supported.
if (user_param.masked_atomics && (user_param.work_rdma_cm || user_param.use_rdma_cm)) {
fprintf(stderr, "atomic test is not supported with -R/-z flag (rdma_cm) with this device.\n");
return 1;
}
#endif
/* See if MTU and link type are valid and supported. */
if (check_link(ctx.context,&user_param)) {
fprintf(stderr, " Couldn't get context for the device\n");
return FAILURE;
}
// copy the relevant user parameters to the comm struct + creating rdma_cm resources.
/* copy the relevant user parameters to the comm struct + creating rdma_cm resources. */
if (create_comm_struct(&user_comm,&user_param)) {
fprintf(stderr," Unable to create RDMA_CM resources\n");
return 1;
......@@ -121,7 +126,7 @@ int main(int argc, char *argv[]) {
printf("************************************\n");
}
// Initialize the connection and print the local data.
/* Initialize the connection and print the local data. */
if (establish_connection(&user_comm)) {
fprintf(stderr," Unable to init the socket connection\n");
return FAILURE;
......@@ -131,13 +136,13 @@ int main(int argc, char *argv[]) {
check_sys_data(&user_comm, &user_param);
// See if MTU and link type are valid and supported.
/* See if MTU and link type are valid and supported. */
if (check_mtu(ctx.context,&user_param, &user_comm)) {
fprintf(stderr, " Couldn't get context for the device\n");
return FAILURE;
}
// Print basic test information.
/* Print basic test information. */
ctx_print_test_info(&user_param);
ALLOCATE(my_dest , struct pingpong_dest , user_param.num_of_qps);
......@@ -145,10 +150,10 @@ int main(int argc, char *argv[]) {
ALLOCATE(rem_dest , struct pingpong_dest , user_param.num_of_qps);
memset(rem_dest, 0, sizeof(struct pingpong_dest)*user_param.num_of_qps);
// Allocating arrays needed for the test.
/* Allocating arrays needed for the test. */
alloc_ctx(&ctx,&user_param);
// Create (if nessacery) the rdma_cm ids and channel.
/* Create (if nessacery) the rdma_cm ids and channel. */
if (user_param.work_rdma_cm == ON) {
if (user_param.machine == CLIENT) {
......@@ -158,10 +163,10 @@ int main(int argc, char *argv[]) {
}
} else {
if (create_rdma_resources(&ctx,&user_param)) {
if (create_rdma_resources(&ctx,&user_param)) {
fprintf(stderr," Unable to create the rdma_resources\n");
return FAILURE;
}
}
if (rdma_server_connect(&ctx,&user_param)) {
fprintf(stderr,"Unable to perform rdma_client function\n");
return FAILURE;
......@@ -170,14 +175,14 @@ int main(int argc, char *argv[]) {
} else {
// create all the basic IB resources (data buffer, PD, MR, CQ and events channel)
if (ctx_init(&ctx,&user_param)) {
/* create all the basic IB resources (data buffer, PD, MR, CQ and events channel) */
if (ctx_init(&ctx,&user_param)) {
fprintf(stderr, " Couldn't create IB resources\n");
return FAILURE;
}
}
}
// Set up the Connection.
/* Set up the Connection. */
if (set_up_connection(&ctx,&user_param,my_dest)) {
fprintf(stderr," Unable to set up socket connection\n");
return 1;
......@@ -186,7 +191,7 @@ int main(int argc, char *argv[]) {
for (i=0; i < user_param.num_of_qps; i++)
ctx_print_pingpong_data(&my_dest[i],&user_comm);
// shaking hands and gather the other side info.
/* shaking hands and gather the other side info. */
if (ctx_hand_shake(&user_comm,my_dest,rem_dest)) {
fprintf(stderr,"Failed to exchange data between server and clients\n");
return 1;
......@@ -195,7 +200,7 @@ int main(int argc, char *argv[]) {
user_comm.rdma_params->side = REMOTE;
for (i=0; i < user_param.num_of_qps; i++) {
// shaking hands and gather the other side info.
/* shaking hands and gather the other side info. */
if (ctx_hand_shake(&user_comm,&my_dest[i],&rem_dest[i])) {
fprintf(stderr,"Failed to exchange data between server and clients\n");
return 1;
......@@ -204,42 +209,37 @@ int main(int argc, char *argv[]) {
ctx_print_pingpong_data(&rem_dest[i],&user_comm);
}
if (user_param.work_rdma_cm == OFF)
{
if (ctx_check_gid_compatibility(&my_dest[0], &rem_dest[0]))
{
fprintf(stderr,"\n Found Incompatibility issue with GID types.\n");
fprintf(stderr," Please Try to use a different IP version.\n\n");
return 1;
}
}
if (user_param.work_rdma_cm == OFF) {
if (ctx_check_gid_compatibility(&my_dest[0], &rem_dest[0])) {
fprintf(stderr,"\n Found Incompatibility issue with GID types.\n");
fprintf(stderr," Please Try to use a different IP version.\n\n");
return 1;
}
}
if (user_param.work_rdma_cm == OFF) {
if (ctx_connect(&ctx,rem_dest,&user_param,my_dest)) {
fprintf(stderr," Unable to Connect the HCA's through the link\n");
return 1;
}
}
// An additional handshake is required after moving qp to RTR.
/* An additional handshake is required after moving qp to RTR. */
if (ctx_hand_shake(&user_comm,my_dest,rem_dest)) {
fprintf(stderr,"Failed to exchange data between server and clients\n");
return 1;
}
fprintf(stderr,"Failed to exchange data between server and clients\n");
return 1;
}
// Only Client post read request.
/* Only Client post read request. */
if (user_param.machine == SERVER) {
if (ctx_close_connection(&user_comm,my_dest,rem_dest)) {
fprintf(stderr,"Failed to close connection between server and client\n");
return 1;
fprintf(stderr,"Failed to close connection between server and client\n");
return 1;
}
if (user_param.output == FULL_VERBOSITY) {
printf(RESULT_LINE);
}
return 0;
}
if (user_param.use_event) {
......@@ -262,8 +262,8 @@ int main(int argc, char *argv[]) {
user_param.test_type == ITERATIONS ? print_report_lat(&user_param) : print_report_lat_duration(&user_param);
if (ctx_close_connection(&user_comm,my_dest,rem_dest)) {
fprintf(stderr,"Failed to close connection between server and client\n");
return 1;
fprintf(stderr,"Failed to close connection between server and client\n");
return 1;
}
if (user_param.output == FULL_VERBOSITY) {
......
......@@ -15,8 +15,7 @@ int main()
}
printf("Type CTRL-C to cancel.\n");
for(;;)
{
for (;;) {
c1 = get_cycles();
sleep(1);
c2 = get_cycles();
......
......@@ -44,6 +44,7 @@
#include <unistd.h>
#include <stdio.h>
#include <string.h>
#include "get_clock.h"
#ifndef DEBUG
......@@ -58,8 +59,8 @@
#define USECSTART 100
/*
Use linear regression to calculate cycles per microsecond.
http://en.wikipedia.org/wiki/Linear_regression#Parameter_estimation
Use linear regression to calculate cycles per microsecond.
http://en.wikipedia.org/wiki/Linear_regression#Parameter_estimation
*/
static double sample_get_cpu_mhz(void)
{
......@@ -90,7 +91,7 @@ static double sample_get_cpu_mhz(void)
return 0;
}
} while ((tv2.tv_sec - tv1.tv_sec) * 1000000 +
(tv2.tv_usec - tv1.tv_usec) < USECSTART + i * USECSTEP);
(tv2.tv_usec - tv1.tv_usec) < USECSTART + i * USECSTEP);
x[i] = (tv2.tv_sec - tv1.tv_sec) * 1000000 +
tv2.tv_usec - tv1.tv_usec;
......@@ -148,15 +149,31 @@ static double proc_get_cpu_mhz(int no_cpu_freq_fail)
double m;
int rc;
#if defined (__ia64__)
#if defined (__ia64__)
/* Use the ITC frequency on IA64 */
rc = sscanf(buf, "itc MHz : %lf", &m);
#elif defined (__PPC__) || defined (__PPC64__)
#elif defined (__PPC__) || defined (__PPC64__)
/* PPC has a different format as well */
rc = sscanf(buf, "clock : %lf", &m);
#else
#elif defined (__sparc__) && defined (__arch64__)
/*
* on sparc the /proc/cpuinfo lines that hold
* the cpu freq in HZ are as follow:
* Cpu{cpu-num}ClkTck : 00000000a9beeee4