Commit 9ece4526 authored by Benjamin Drung's avatar Benjamin Drung

New upstream version 4.1+0.2.g770623f

parent 99fe4b48
......@@ -19,12 +19,12 @@ 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
bin_SCRIPTS = run_perftest_loopback run_perftest_multi_devices
if HAVE_RAW_ETH
libperftest_a_SOURCES += src/raw_ethernet_resources.c
noinst_HEADERS += src/raw_ethernet_resources.h
bin_PROGRAMS += raw_ethernet_bw raw_ethernet_lat raw_ethernet_burst_lat
bin_PROGRAMS += raw_ethernet_bw raw_ethernet_lat raw_ethernet_burst_lat raw_ethernet_fs_rate
else
libperftest_a_SOURCES +=
noinst_HEADERS +=
......@@ -73,6 +73,8 @@ raw_ethernet_lat_LDADD = libperftest.a $(LIBMATH) $(LIBMLX4) $(LIBMLX5)
raw_ethernet_burst_lat_SOURCES = src/raw_ethernet_send_burst_lat.c
raw_ethernet_burst_lat_LDADD = libperftest.a $(LIBMATH) $(LIBMLX4) $(LIBMLX5)
raw_ethernet_fs_rate_SOURCES = src/raw_ethernet_fs_rate.c
raw_ethernet_fs_rate_LDADD = libperftest.a $(LIBMATH) $(LIBMLX4) $(LIBMLX5)
else
raw_ethernet_bw_SOURCES =
......
......@@ -101,7 +101,7 @@ bin_PROGRAMS = ib_send_bw$(EXEEXT) ib_send_lat$(EXEEXT) \
$(am__EXEEXT_2)
@HAVE_RAW_ETH_TRUE@am__append_1 = src/raw_ethernet_resources.c
@HAVE_RAW_ETH_TRUE@am__append_2 = src/raw_ethernet_resources.h
@HAVE_RAW_ETH_TRUE@am__append_3 = raw_ethernet_bw raw_ethernet_lat raw_ethernet_burst_lat
@HAVE_RAW_ETH_TRUE@am__append_3 = raw_ethernet_bw raw_ethernet_lat raw_ethernet_burst_lat raw_ethernet_fs_rate
@HAVE_RAW_ETH_FALSE@am__append_4 =
@HAVE_RAW_ETH_FALSE@am__append_5 =
@HAVE_RAW_ETH_FALSE@am__append_6 =
......@@ -149,7 +149,8 @@ am_libperftest_a_OBJECTS = src/get_clock.$(OBJEXT) \
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) \
@HAVE_RAW_ETH_TRUE@ raw_ethernet_burst_lat$(EXEEXT)
@HAVE_RAW_ETH_TRUE@ raw_ethernet_burst_lat$(EXEEXT) \
@HAVE_RAW_ETH_TRUE@ raw_ethernet_fs_rate$(EXEEXT)
am__EXEEXT_2 =
am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(bindir)"
PROGRAMS = $(bin_PROGRAMS)
......@@ -209,6 +210,13 @@ raw_ethernet_bw_OBJECTS = $(am_raw_ethernet_bw_OBJECTS)
@HAVE_RAW_ETH_TRUE@raw_ethernet_bw_DEPENDENCIES = libperftest.a \
@HAVE_RAW_ETH_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
@HAVE_RAW_ETH_TRUE@ $(am__DEPENDENCIES_1)
am__raw_ethernet_fs_rate_SOURCES_DIST = src/raw_ethernet_fs_rate.c
@HAVE_RAW_ETH_TRUE@am_raw_ethernet_fs_rate_OBJECTS = \
@HAVE_RAW_ETH_TRUE@ src/raw_ethernet_fs_rate.$(OBJEXT)
raw_ethernet_fs_rate_OBJECTS = $(am_raw_ethernet_fs_rate_OBJECTS)
@HAVE_RAW_ETH_TRUE@raw_ethernet_fs_rate_DEPENDENCIES = libperftest.a \
@HAVE_RAW_ETH_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
@HAVE_RAW_ETH_TRUE@ $(am__DEPENDENCIES_1)
am__raw_ethernet_lat_SOURCES_DIST = src/raw_ethernet_send_lat.c
@HAVE_RAW_ETH_TRUE@am_raw_ethernet_lat_OBJECTS = \
@HAVE_RAW_ETH_TRUE@ src/raw_ethernet_send_lat.$(OBJEXT)
......@@ -283,7 +291,8 @@ SOURCES = $(libperftest_a_SOURCES) $(ib_atomic_bw_SOURCES) \
$(ib_read_lat_SOURCES) $(ib_send_bw_SOURCES) \
$(ib_send_lat_SOURCES) $(ib_write_bw_SOURCES) \
$(ib_write_lat_SOURCES) $(raw_ethernet_burst_lat_SOURCES) \
$(raw_ethernet_bw_SOURCES) $(raw_ethernet_lat_SOURCES)
$(raw_ethernet_bw_SOURCES) $(raw_ethernet_fs_rate_SOURCES) \
$(raw_ethernet_lat_SOURCES)
DIST_SOURCES = $(am__libperftest_a_SOURCES_DIST) \
$(ib_atomic_bw_SOURCES) $(ib_atomic_lat_SOURCES) \
$(ib_read_bw_SOURCES) $(ib_read_lat_SOURCES) \
......@@ -291,6 +300,7 @@ DIST_SOURCES = $(am__libperftest_a_SOURCES_DIST) \
$(ib_write_bw_SOURCES) $(ib_write_lat_SOURCES) \
$(am__raw_ethernet_burst_lat_SOURCES_DIST) \
$(am__raw_ethernet_bw_SOURCES_DIST) \
$(am__raw_ethernet_fs_rate_SOURCES_DIST) \
$(am__raw_ethernet_lat_SOURCES_DIST)
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
......@@ -476,7 +486,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
bin_SCRIPTS = run_perftest_loopback run_perftest_multi_devices
@IS_FREEBSD_FALSE@LIBMLX4 =
@IS_FREEBSD_TRUE@LIBMLX4 = -lmlx4
@IS_FREEBSD_FALSE@LIBMLX5 =
......@@ -507,6 +517,8 @@ ib_atomic_bw_LDADD = libperftest.a $(LIBMATH) $(LIBMLX4) $(LIBMLX5)
@HAVE_RAW_ETH_TRUE@raw_ethernet_lat_LDADD = libperftest.a $(LIBMATH) $(LIBMLX4) $(LIBMLX5)
@HAVE_RAW_ETH_TRUE@raw_ethernet_burst_lat_SOURCES = src/raw_ethernet_send_burst_lat.c
@HAVE_RAW_ETH_TRUE@raw_ethernet_burst_lat_LDADD = libperftest.a $(LIBMATH) $(LIBMLX4) $(LIBMLX5)
@HAVE_RAW_ETH_TRUE@raw_ethernet_fs_rate_SOURCES = src/raw_ethernet_fs_rate.c
@HAVE_RAW_ETH_TRUE@raw_ethernet_fs_rate_LDADD = libperftest.a $(LIBMATH) $(LIBMLX4) $(LIBMLX5)
all: config.h
$(MAKE) $(AM_MAKEFLAGS) all-am
......@@ -696,6 +708,12 @@ src/raw_ethernet_send_bw.$(OBJEXT): src/$(am__dirstamp) \
raw_ethernet_bw$(EXEEXT): $(raw_ethernet_bw_OBJECTS) $(raw_ethernet_bw_DEPENDENCIES) $(EXTRA_raw_ethernet_bw_DEPENDENCIES)
@rm -f raw_ethernet_bw$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(raw_ethernet_bw_OBJECTS) $(raw_ethernet_bw_LDADD) $(LIBS)
src/raw_ethernet_fs_rate.$(OBJEXT): src/$(am__dirstamp) \
src/$(DEPDIR)/$(am__dirstamp)
raw_ethernet_fs_rate$(EXEEXT): $(raw_ethernet_fs_rate_OBJECTS) $(raw_ethernet_fs_rate_DEPENDENCIES) $(EXTRA_raw_ethernet_fs_rate_DEPENDENCIES)
@rm -f raw_ethernet_fs_rate$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(raw_ethernet_fs_rate_OBJECTS) $(raw_ethernet_fs_rate_LDADD) $(LIBS)
src/raw_ethernet_send_lat.$(OBJEXT): src/$(am__dirstamp) \
src/$(DEPDIR)/$(am__dirstamp)
......@@ -752,6 +770,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/perftest_communication.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/perftest_parameters.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/perftest_resources.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/raw_ethernet_fs_rate.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/raw_ethernet_resources.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/raw_ethernet_send_burst_lat.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/raw_ethernet_send_bw.Po@am__quote@
......
......@@ -16409,7 +16409,7 @@ else
HAVE_EXP_ODP_FALSE=
fi
if test $HAVE_EXP_ODP = yes ; then
if test $HAVE_EXP_ODP = yes && test $HAVE_VERBS_EXP = yes; then
if test $HAVE_EX_ODP = no ; then
$as_echo "@%:@define HAVE_EXP_ODP 1" >>confdefs.h
......
......@@ -16405,7 +16405,7 @@ else
HAVE_EXP_ODP_FALSE=
fi
if test $HAVE_EXP_ODP = yes ; then
if test $HAVE_EXP_ODP = yes && test $HAVE_VERBS_EXP = yes; then
if test $HAVE_EX_ODP = no ; then
$as_echo "@%:@define HAVE_EXP_ODP 1" >>confdefs.h
......
......@@ -16405,7 +16405,7 @@ else
HAVE_EXP_ODP_FALSE=
fi
if test $HAVE_EXP_ODP = yes ; then
if test $HAVE_EXP_ODP = yes && test $HAVE_VERBS_EXP = yes; then
if test $HAVE_EX_ODP = no ; then
$as_echo "#define HAVE_EXP_ODP 1" >>confdefs.h
......
......@@ -227,7 +227,7 @@ AC_TRY_LINK([
#include <infiniband/verbs_exp.h>],
[int x = IBV_EXP_ACCESS_ON_DEMAND;],[HAVE_EXP_ODP=yes], [HAVE_EXP_ODP=no])
AM_CONDITIONAL([HAVE_EXP_ODP],[test "x$HAVE_EXP_ODP" = "xyes"])
if [test $HAVE_EXP_ODP = yes] ; then
if [test $HAVE_EXP_ODP = yes] && [test $HAVE_VERBS_EXP = yes]; then
if [test $HAVE_EX_ODP = no] ; then
AC_DEFINE([HAVE_EXP_ODP], [1], [Have Experimental ODP support])
fi
......
Name: perftest
Summary: IB Performance tests
Version: 3.4
Release: 0.6.gc3435c2
Version: 4.1
Release: 0.2.g770623f
License: BSD 3-Clause, GPL v2 or later
Group: Productivity/Networking/Diagnostic
Source: http://www.openfabrics.org/downloads/perftest-3.4-0.6.gc3435c2.tar.gz
Source: http://www.openfabrics.org/downloads/perftest-4.1-0.2.g770623f.tar.gz
Url: http://www.openfabrics.org
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: libibverbs-devel librdmacm-devel libibumad-devel
......
#!/bin/sh
# Script to launch a multi device test on seperate processes.
GET_HELP=0
HAVE_CORES=0
HAVE_DEVICES=0
HAVE_IB_PORTS=0
HAVE_GID_INDEXES=0
HAVE_REMOTE_HOST=0
HAVE_CMD=0
BASE_TCP_PORT=15000
function force_dependencies {
if [[ $GET_HELP -eq 1 ]]
then
print_usage
exit
fi
#mandatory flags
if [[ $HAVE_DEVICES -eq 0 ]]
then
echo "-d/--devices flag is mandatory"
exit
fi
if [[ $HAVE_CMD -eq 0 ]]
then
echo "-C/--cmd flag is mandatory"
exit
fi
#optional flags
#check that all arguments have enough params.
if [[ $HAVE_CORES -eq 1 ]]
then
if [[ ${#CORES_LIST[@]} -ne $EXPECTED_PARAMS ]]
then
echo "number of cores should be equal to number of devices (cores for each device)"
exit
fi
fi
if [[ $HAVE_IB_PORTS -eq 1 ]]
then
if [[ ${#IB_PORTS_LIST[@]} -ne $EXPECTED_PARAMS ]]
then
echo "number of ib ports should be equal to number of devices (ib_port for each device)"
exit
fi
fi
if [[ $HAVE_GID_INDEXES -eq 1 ]]
then
if [[ ${#GID_INDEXES_LIST[@]} -ne $EXPECTED_PARAMS ]]
then
echo "number of gid indexes should be equal to number of devices (gid_index for each device)"
exit
fi
fi
}
function run_commands {
for (( I=0 ; I < $EXPECTED_PARAMS ; I++ ))
do
cmd=""
if [[ $HAVE_CORES -eq 1 ]]
then
cmd="taskset -c ${CORES_LIST[$I]}"
fi
#mandatory:
cmd="$cmd $TEST_CMD -d ${DEVICE_LIST[$I]} -p $(($BASE_TCP_PORT+I))"
#optional:
if [[ $HAVE_IB_PORTS -eq 1 ]]
then
cmd="$cmd -i ${IB_PORTS_LIST[$I]}"
fi
if [[ $HAVE_GID_INDEXES -eq 1 ]]
then
cmd="$cmd -x ${GID_INDEXES_LIST[$I]}"
fi
if [[ $HAVE_REMOTE_HOST -eq 1 ]]
then
cmd="$cmd $REMOTE_HOST"
fi
if [[ $I -ne $(($EXPECTED_PARAMS-1)) ]]
then
cmd="$cmd &"
fi
eval $cmd
done
}
function print_usage {
echo -e "\nUsage:"
echo " Server side: run_perftest_multi_device --devices dev1,dev2 --cmd \"<perftest command>\" [optional_flags]"
echo " Client side: run_perftest_multi_device --devices dev1,dev2 --cmd \"<perftest command>\" --remote <server_name> [optional_flags]"
echo ""
echo " ** Please make sure that <perftest command> does not include the <server_name> on both sides. **"
echo " This should be added only by --remote flag on the Client side."
echo -e "\nMandatory flags:"
echo " -d, --devices List of IB devices, seperated by comma. This will override '-d, --ib-dev' flag if existed in the perftest command."
echo " i.e. --devices dev1,dev2"
echo " -C, --cmd A valid perftest command."
echo " i.e. --cmd \"ib_write_bw --size 64 --duration 3\""
echo -e "\nOptional flags:"
echo " -c, --cores Pin each device to a specific core using taskset"
echo " i.e. --cores 0,1 - This will pin dev1 command to core 0 and dev2 command to core 1"
echo " -i, --ib_ports Choose ib_port for each device. This will override '-i, --ib-port' flag if existed in the perftest command."
echo " i.e. --ib_ports 1,2 - dev1 will work with port 1 and dev2 will work with port 2"
echo " -x, --gid_indexes Choose gid_index for each device. This will override '-x, --gid-index' flag if existed in the perftest command."
echo " i.e. --gid_indexes 3,7 - dev1 will work with gid_index 3 and dev2 will work with gid_index 7"
echo " -r, --remote Sets the remote host to connect. This will set it as the client side."
echo " i.e. --remote <server_host_name> , or --remote <server_ip>."
}
#parser
while [[ $# -ge 1 ]]
do
key="$1"
case $key in
-h|--help)
GET_HELP=1
shift
;;
-c|--cores)
CORES_LIST=($(echo "$2" | tr "," " "))
HAVE_CORES=1
shift # past argument
;;
-d|--devices)
DEVICE_LIST=($(echo "$2" | tr "," " "))
HAVE_DEVICES=1
EXPECTED_PARAMS=${#DEVICE_LIST[@]}
shift # past argument
;;
-i|--ib_ports)
IB_PORTS_LIST=($(echo "$2" | tr "," " "))
HAVE_IB_PORTS=1
shift # past argument
;;
-x|--gid_indexes)
GID_INDEXES_LIST=($(echo "$2" | tr "," " "))
HAVE_GID_INDEXES=1
shift
;;
-C|--cmd)
TEST_CMD="$2"
HAVE_CMD=1
shift
;;
-r|--remote)
REMOTE_HOST="$2"
HAVE_REMOTE_HOST=1
shift
;;
*)
# unknown option - ignore
;;
esac
shift
done
force_dependencies
run_commands
exit
......@@ -97,6 +97,12 @@ int main(int argc, char *argv[])
return FAILURE;
}
/* Verify user parameters that require the device context,
* the function will print the relevent error info. */
if (verify_params_with_device_context(ctx.context, &user_param)) {
return FAILURE;
}
#ifdef HAVE_MASKED_ATOMICS
if (check_masked_atomics_support(&ctx)) {
user_param.masked_atomics = 1;
......
......@@ -1706,6 +1706,7 @@ int check_mtu(struct ibv_context *context,struct perftest_parameters *user_param
char cur[2];
char rem[2];
int size_of_cur;
float rem_vers = atof(user_param->rem_version);
if (user_param->connection_type == RawEth) {
if (set_eth_mtu(user_param) != 0 ) {
......@@ -1715,11 +1716,12 @@ int check_mtu(struct ibv_context *context,struct perftest_parameters *user_param
} else {
curr_mtu = (int) (set_mtu(context,user_param->ib_port,user_param->mtu));
if (!user_param->dont_xchg_versions) {
if (strverscmp(user_param->rem_version, "5.1") >= 0) {
/*add mtu set in remote node from version 5.1 and above*/
if (rem_vers >= 5.1 ) {
sprintf(cur,"%d",curr_mtu);
/*fix a buffer overflow issue in ppc.*/
size_of_cur = (strverscmp(user_param->rem_version, "5.31") >= 0) ? sizeof(char[2]) : sizeof(int);
size_of_cur = (rem_vers >= 5.31) ? sizeof(char[2]) : sizeof(int);
if (ctx_xchg_data(user_comm,(void*)(cur),(void*)(rem),size_of_cur)) {
fprintf(stderr," Failed to exchange data between server and clients\n");
......
This diff is collapsed.
......@@ -158,17 +158,22 @@
#define MAX_CQ_MOD (1024)
#define MAX_INLINE (912)
#define MAX_INLINE_UD (884)
#define MIN_EQ_NUM (0)
#define MAX_EQ_NUM (2048)
/* Raw etherent defines */
#define RAWETH_MIN_MSG_SIZE (64)
#define MIN_MTU_RAW_ETERNET (64)
#define MAX_MTU_RAW_ETERNET (9600)
#define MIN_FS_PORT (5000)
#define MAX_FS_PORT (65536)
#define RESULT_LINE "---------------------------------------------------------------------------------------\n"
#define RESULT_LINE_PER_PORT "-------------------------------------------------------------------------------------------------------------------------------------------------------------------\n"
#define CYCLES "cycles"
#define USEC "usec"
/* The format of the results */
#define RESULT_FMT " #bytes #iterations BW peak[MB/sec] BW average[MB/sec] MsgRate[Mpps]"
......@@ -184,12 +189,16 @@
#define RESULT_FMT_LAT " #bytes #iterations t_min[usec] t_max[usec] t_typical[usec] t_avg[usec] t_stdev[usec] 99""%"" percentile[usec] 99.9""%"" percentile[usec] "
#define RESULT_FMT_LAT_DUR " #bytes #iterations t_avg[usec] "
#define RESULT_FMT_LAT_DUR " #bytes #iterations t_avg[usec] tps average"
#define RESULT_EXT "\n"
#define RESULT_EXT_CPU_UTIL " CPU_Util[%%]\n"
#define RESULT_FMT_FS_RATE " #flows fs_min_time[usec] fs_max_time[usec] fs_typical_time[usec] fs_avg_time[usec] fps[flow per sec]"
#define RESULT_FMT_FS_RATE_DUR " #flows fs_avg_time[usec] fps[flow per sec]"
/* Result print format */
#define REPORT_FMT " %-7lu %-10lu %-7.2lf %-7.2lf %-7.6lf"
......@@ -204,9 +213,12 @@
#define REPORT_FMT_QOS " %-7lu %d %lu %-7.2lf %-7.2lf %-7.6lf\n"
/* Result print format for latency tests. */
#define REPORT_FMT_LAT " %-7lu %d %-7.2f %-7.2f %-7.2f %-7.2f %-7.2f %-7.2f %-7.2f"
#define REPORT_FMT_LAT " %-7lu %d %-7.2f %-7.2f %-7.2f %-7.2f %-7.2f %-7.2f %-7.2f"
#define REPORT_FMT_LAT_DUR " %-7lu %d %-7.2f %-7.2f"
#define REPORT_FMT_LAT_DUR " %-7lu %d %-7.2f"
#define REPORT_FMT_FS_RATE " %d %-7.2f %-7.2f %-7.2f %-7.2f %-7.2f"
#define REPORT_FMT_FS_RATE_DUR " %d %-7.2f %-7.2f"
#define CHECK_VALUE(arg,type,minv,maxv,name) \
{ arg = (type)strtol(optarg, NULL, 0); if ((arg < minv) || (arg > maxv)) \
......@@ -231,7 +243,7 @@
typedef enum { SEND , WRITE, READ, ATOMIC } VerbType;
/* The type of the test */
typedef enum { LAT , BW , LAT_BY_BW } TestType;
typedef enum { LAT , BW , LAT_BY_BW, FS_RATE } TestType;
/* The type of the machine ( server or client actually). */
typedef enum { SERVER , CLIENT , UNCHOSEN} MachineType;
......@@ -271,8 +283,9 @@ enum ctx_device {
CONNECTX4LX = 11,
QLOGIC_E4 = 12,
QLOGIC_AH = 13,
CONNECTX5 = 14,
CONNECTX5EX = 15
CHELSIO_T6 = 14,
CONNECTX5 = 15,
CONNECTX5EX = 16
};
/* Units for rate limiter */
......@@ -355,6 +368,8 @@ struct perftest_parameters {
int connection_type;
int num_of_qps;
int use_event;
int eq_num;
int use_eq_num;
int inline_size;
int inline_recv_size;
int out_reads;
......@@ -636,6 +651,17 @@ void print_report_lat (struct perftest_parameters *user_param);
*/
void print_report_lat_duration (struct perftest_parameters *user_param);
/* print_report_fs_rate
*
* Description : Prints the Flow steering rate and avarage latency to create flow
*
* Parameters :
*
* user_param - the parameters parameters.
*
*/
void print_report_fs_rate (struct perftest_parameters *user_param);
/* set_mtu
*
* Description : set MTU from the port or user
......
......@@ -19,6 +19,7 @@
#endif
#include "perftest_resources.h"
#include "raw_ethernet_resources.h"
#include "config.h"
#ifdef HAVE_VERBS_EXP
......@@ -651,7 +652,7 @@ void alloc_ctx(struct pingpong_context *ctx,struct perftest_parameters *user_par
tarr_size = (user_param->noPeak) ? 1 : user_param->iters*user_param->num_of_qps;
ALLOCATE(user_param->tposted, cycles_t, tarr_size);
memset(user_param->tposted, 0, sizeof(cycles_t)*tarr_size);
if (user_param->tst == LAT && user_param->test_type == DURATION)
if ((user_param->tst == LAT || user_param->tst == FS_RATE) && user_param->test_type == DURATION)
ALLOCATE(user_param->tcompleted, cycles_t, 1);
ALLOCATE(ctx->qp, struct ibv_qp*, user_param->num_of_qps);
......@@ -683,21 +684,25 @@ void alloc_ctx(struct pingpong_context *ctx,struct perftest_parameters *user_par
memset(ctx->scnt, 0, user_param->num_of_qps * sizeof (uint64_t));
memset(ctx->ccnt, 0, user_param->num_of_qps * sizeof (uint64_t));
} else if ((user_param->tst == BW || user_param->tst == LAT_BY_BW ) && user_param->verb == SEND && user_param->machine == SERVER) {
} else if ((user_param->tst == BW || user_param->tst == LAT_BY_BW)
&& user_param->verb == SEND && user_param->machine == SERVER) {
ALLOCATE(ctx->my_addr,uint64_t,user_param->num_of_qps);
ALLOCATE(user_param->tcompleted,cycles_t,1);
ALLOCATE(ctx->my_addr, uint64_t, user_param->num_of_qps);
ALLOCATE(user_param->tcompleted, cycles_t, 1);
} else if (user_param->tst == FS_RATE && user_param->test_type == ITERATIONS) {
ALLOCATE(user_param->tcompleted, cycles_t, tarr_size);
memset(user_param->tcompleted, 0, sizeof(cycles_t) * tarr_size);
}
if (user_param->machine == CLIENT || user_param->tst == LAT || user_param->duplex) {
ALLOCATE(ctx->sge_list,struct ibv_sge,user_param->num_of_qps*user_param->post_list);
ALLOCATE(ctx->sge_list, struct ibv_sge,user_param->num_of_qps * user_param->post_list);
#ifdef HAVE_VERBS_EXP
ALLOCATE(ctx->exp_wr,struct ibv_exp_send_wr,user_param->num_of_qps*user_param->post_list);
ALLOCATE(ctx->exp_wr, struct ibv_exp_send_wr, user_param->num_of_qps * user_param->post_list);
#endif
ALLOCATE(ctx->wr,struct ibv_send_wr,user_param->num_of_qps*user_param->post_list);
ALLOCATE(ctx->wr, struct ibv_send_wr, user_param->num_of_qps * user_param->post_list);
if ((user_param->verb == SEND && user_param->connection_type == UD ) || user_param->connection_type == DC) {
ALLOCATE(ctx->ah,struct ibv_ah*,user_param->num_of_qps);
ALLOCATE(ctx->ah, struct ibv_ah*, user_param->num_of_qps);
}
}
......@@ -993,9 +998,8 @@ int create_reg_cqs(struct pingpong_context *ctx,
struct perftest_parameters *user_param,
int tx_buffer_depth, int need_recv_cq)
{
ctx->send_cq = ibv_create_cq(ctx->context,tx_buffer_depth *
user_param->num_of_qps,NULL,ctx->channel,0);
user_param->num_of_qps, NULL, ctx->channel, user_param->eq_num);
if (!ctx->send_cq) {
fprintf(stderr, "Couldn't create CQ\n");
return FAILURE;
......@@ -1003,7 +1007,7 @@ int create_reg_cqs(struct pingpong_context *ctx,
if (need_recv_cq) {
ctx->recv_cq = ibv_create_cq(ctx->context,user_param->rx_depth *
user_param->num_of_qps,NULL,ctx->channel,0);
user_param->num_of_qps, NULL, ctx->channel, user_param->eq_num);
if (!ctx->recv_cq) {
fprintf(stderr, "Couldn't create a receiver CQ\n");
return FAILURE;
......@@ -1276,11 +1280,15 @@ int create_single_mr(struct pingpong_context *ctx, struct perftest_parameters *u
ctx->buf[qp_index] = ctx->mr[qp_index]->addr;
/* Initialize buffer with random numbers */
/* Initialize buffer with random numbers except in WRITE_LAT test that it 0's */
if (!user_param->use_cuda) {
srand(time(NULL));
for (i = 0; i < ctx->buff_size; i++) {
((char*)ctx->buf[qp_index])[i] = (char)rand();
if (user_param->verb == WRITE && user_param->tst == LAT) {
memset(ctx->buf[qp_index], 0, ctx->buff_size);
} else {
for (i = 0; i < ctx->buff_size; i++) {
((char*)ctx->buf[qp_index])[i] = (char)rand();
}
}
}
......@@ -1355,6 +1363,21 @@ int alloc_hugepage_region (struct pingpong_context *ctx)
return SUCCESS;
}
int verify_params_with_device_context(struct ibv_context *context,
struct perftest_parameters *user_param)
{
if(user_param->use_event) {
if(user_param->eq_num > context->num_comp_vectors) {
fprintf(stderr, " Completion vector specified is invalid\n");
fprintf(stderr, " Max completion vector = %d\n",
context->num_comp_vectors - 1);
return FAILURE;
}
}
return SUCCESS;
}
int ctx_init(struct pingpong_context *ctx, struct perftest_parameters *user_param)
{
int i;
......@@ -4845,6 +4868,120 @@ int check_packet_pacing_support(struct pingpong_context *ctx)
return attr.packet_pacing_caps.qp_rate_limit_max > 0 ? SUCCESS : FAILURE;
}
#endif
int run_iter_fs(struct pingpong_context *ctx, struct perftest_parameters *user_param) {
struct raw_ethernet_info *my_dest_info = NULL;
struct raw_ethernet_info *rem_dest_info = NULL;
#ifdef HAVE_RAW_ETH_EXP
struct ibv_exp_flow **flow_create_result;
struct ibv_exp_flow_attr **flow_rules;
#else
struct ibv_flow **flow_create_result;
struct ibv_flow_attr **flow_rules;
#endif
int flow_index = 0;
int qp_index = 0;
int retval = SUCCESS;
uint64_t tot_fs_cnt = 0;
uint64_t allocated_flows = 0;
uint64_t tot_iters = 0;
/* Allocate user input dependable structs */
ALLOCATE(my_dest_info, struct raw_ethernet_info, user_param->num_of_qps);
memset(my_dest_info, 0, sizeof(struct raw_ethernet_info) * user_param->num_of_qps);
ALLOCATE(rem_dest_info, struct raw_ethernet_info, user_param->num_of_qps);
memset(rem_dest_info, 0, sizeof(struct raw_ethernet_info) * user_param->num_of_qps);
if (user_param->test_type == ITERATIONS) {
user_param->flows = user_param->iters * user_param->num_of_qps;
allocated_flows = user_param->iters;
} else if (user_param->test_type == DURATION) {
allocated_flows = (2 * MAX_FS_PORT) - (user_param->server_port + user_param->client_port);
}
#ifdef HAVE_RAW_ETH_EXP
ALLOCATE(flow_create_result, struct ibv_exp_flow*, allocated_flows * user_param->num_of_qps);
ALLOCATE(flow_rules, struct ibv_exp_flow_attr*, allocated_flows * user_param->num_of_qps);
#else
ALLOCATE(flow_create_result, struct ibv_flow*, allocated_flows * user_param->num_of_qps);
ALLOCATE(flow_rules, struct ibv_flow_attr*, allocated_flows * user_param->num_of_qps);
#endif
if(user_param->test_type == DURATION) {
duration_param = user_param;
user_param->iters = 0;
duration_param->state = START_STATE;
signal(SIGALRM, catch_alarm);
alarm(user_param->margin);
if (user_param->margin > 0)
alarm(user_param->margin);
else
catch_alarm(0); /* move to next state */
}
if (set_up_fs_rules(flow_rules, ctx, user_param, allocated_flows)) {
fprintf(stderr, "Unable to set up flow rules\n");
retval = FAILURE;
goto cleaning;
}
do {/* This loop runs once in Iteration mode */
for (qp_index = 0; qp_index < user_param->num_of_qps; qp_index++) {
for (flow_index = 0; flow_index < allocated_flows; flow_index++) {
if (user_param->test_type == ITERATIONS)
user_param->tposted[tot_fs_cnt] = get_cycles();
else if (user_param->test_type == DURATION && duration_param->state == END_STATE)
break;
#ifdef HAVE_RAW_ETH_EXP
flow_create_result[flow_index] =
ibv_exp_create_flow(ctx->qp[qp_index], flow_rules[(qp_index * allocated_flows) + flow_index]);
#else
flow_create_result[flow_index] =
ibv_create_flow(ctx->qp[qp_index], flow_rules[(qp_index * allocated_flows) + flow_index]);
#endif
if (user_param->test_type == ITERATIONS)
user_param->tcompleted[tot_fs_cnt] = get_cycles();
if (!flow_create_result[flow_index]) {
perror("error");
fprintf(stderr, "Couldn't attach QP\n");
retval = FAILURE;
goto cleaning;
}
if (user_param->test_type == ITERATIONS ||
(user_param->test_type == DURATION && duration_param->state == SAMPLE_STATE))
tot_fs_cnt++;
tot_iters++;
}
}
} while (user_param->test_type == DURATION && duration_param->state != END_STATE);
if (user_param->test_type == DURATION && user_param->state == END_STATE)
user_param->iters = tot_fs_cnt;
cleaning:
/* destroy open flows */
for (flow_index = 0; flow_index < tot_iters; flow_index++) {
#ifdef HAVE_RAW_ETH_EXP
if (ibv_exp_destroy_flow(flow_create_result[flow_index])) {
#else
if (ibv_destroy_flow(flow_create_result[flow_index])) {
#endif
perror("error");
fprintf(stderr, "Couldn't Destory flow\n");
}
}
free(flow_rules);
free(flow_create_result);
free(my_dest_info);
free(rem_dest_info);
return retval;
}
/******************************************************************************
* End
******************************************************************************/
......@@ -280,6 +280,21 @@ void alloc_ctx(struct pingpong_context *ctx,struct perftest_parameters *user_par
int destroy_ctx(struct pingpong_context *ctx,
struct perftest_parameters *user_param);
/* verify_params_with_device_context
*
* Description :
* Verify user params that require information from the ibv_context
*
* Parameters :
* context - ibv_context
* user_param - the perftest parameters.
*
* Return Value : SUCCESS, FAILURE.
*/
int verify_params_with_device_context(struct ibv_context *ctx,