Hello community, here is the log from the commit of package perftest for openSUSE:Factory checked in at 2020-03-23 12:52:22 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/perftest (Old) and /work/SRC/openSUSE:Factory/.perftest.new.3160 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "perftest" Mon Mar 23 12:52:22 2020 rev:10 rq:787385 version:4.4 Changes: -------- --- /work/SRC/openSUSE:Factory/perftest/perftest.changes 2019-09-27 14:54:12.727865511 +0200 +++ /work/SRC/openSUSE:Factory/.perftest.new.3160/perftest.changes 2020-03-23 12:53:18.972060243 +0100 @@ -1,0 +2,6 @@ +Fri Mar 20 11:28:11 UTC 2020 - Nicolas Morey-Chaisemartin <[email protected]> + +- Update to 4.4.0-11 + - No release notes available + +------------------------------------------------------------------- Old: ---- perftest-4.4-0.8.tar.gz New: ---- perftest-4.4-0.11.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ perftest.spec ++++++ --- /var/tmp/diff_new_pack.1WfFV4/_old 2020-03-23 12:53:19.764060740 +0100 +++ /var/tmp/diff_new_pack.1WfFV4/_new 2020-03-23 12:53:19.772060746 +0100 @@ -1,7 +1,7 @@ # # spec file for package perftest # -# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2020 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -16,7 +16,7 @@ # -%define extra_version -0.8 +%define extra_version -0.11 Name: perftest Summary: IB Performance tests @@ -26,7 +26,7 @@ Release: 0 Source0: %{name}-%{version}%{extra_version}.tar.gz Patch4: perftest-armv6.patch -Url: https://github.com/linux-rdma/perftest +URL: https://github.com/linux-rdma/perftest BuildRoot: %{_tmppath}/%{name}-%{version}-build # For transition to rdma-core make sure the new packages are selected # Once the transition is made the version check can be removed ++++++ _service ++++++ --- /var/tmp/diff_new_pack.1WfFV4/_old 2020-03-23 12:53:19.816060773 +0100 +++ /var/tmp/diff_new_pack.1WfFV4/_new 2020-03-23 12:53:19.816060773 +0100 @@ -5,8 +5,8 @@ <param name="package-meta">no</param> <param name="exclude">.git</param> <param name="filename">perftest</param> - <param name="version">4.4-0.8</param> - <param name="revision">04c33e4d7fb42b721e3e38363bda6b1587af02c0</param> + <param name="version">4.4-0.11</param> + <param name="revision">b0c85dd2608b48afbb437fc739488e1d12556019</param> </service> <service name="recompress" mode="disabled"> <param name="file">*perftest*.tar</param> ++++++ perftest-4.4-0.8.tar.gz -> perftest-4.4-0.11.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/perftest-4.4-0.8/Makefile.am new/perftest-4.4-0.11/Makefile.am --- old/perftest-4.4-0.8/Makefile.am 2019-08-25 14:11:20.000000000 +0200 +++ new/perftest-4.4-0.11/Makefile.am 2019-12-15 15:31:12.000000000 +0100 @@ -34,8 +34,8 @@ AUTOMAKE_OPTIONS= subdir-objects noinst_LIBRARIES = libperftest.a -libperftest_a_SOURCES = src/get_clock.c src/perftest_communication.c src/perftest_parameters.c src/perftest_resources.c -noinst_HEADERS = src/get_clock.h src/perftest_communication.h src/perftest_parameters.h src/perftest_resources.h +libperftest_a_SOURCES = src/get_clock.c src/perftest_communication.c src/perftest_parameters.c src/perftest_resources.c src/perftest_counters.c +noinst_HEADERS = src/get_clock.h src/perftest_communication.h src/perftest_parameters.h src/perftest_resources.h src/perftest_counters.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 run_perftest_multi_devices @@ -59,41 +59,41 @@ endif ib_send_bw_SOURCES = src/send_bw.c src/multicast_resources.c src/multicast_resources.h -ib_send_bw_LDADD = libperftest.a $(LIBUMAD) $(LIBMATH) $(LIBMLX4) $(LIBMLX5) +ib_send_bw_LDADD = libperftest.a $(LIBUMAD) $(LIBMATH) $(LIBMLX4) $(LIBMLX5) $(LIBEFA) ib_send_lat_SOURCES = src/send_lat.c src/multicast_resources.c src/multicast_resources.h -ib_send_lat_LDADD = libperftest.a $(LIBUMAD) $(LIBMATH) $(LIBMLX4) $(LIBMLX5) +ib_send_lat_LDADD = libperftest.a $(LIBUMAD) $(LIBMATH) $(LIBMLX4) $(LIBMLX5) $(LIBEFA) ib_write_lat_SOURCES = src/write_lat.c -ib_write_lat_LDADD = libperftest.a $(LIBMATH) $(LIBMLX4) $(LIBMLX5) +ib_write_lat_LDADD = libperftest.a $(LIBMATH) $(LIBMLX4) $(LIBMLX5) $(LIBEFA) ib_write_bw_SOURCES = src/write_bw.c -ib_write_bw_LDADD = libperftest.a $(LIBMATH) $(LIBMLX4) $(LIBMLX5) +ib_write_bw_LDADD = libperftest.a $(LIBMATH) $(LIBMLX4) $(LIBMLX5) $(LIBEFA) ib_read_lat_SOURCES = src/read_lat.c -ib_read_lat_LDADD = libperftest.a $(LIBMATH) $(LIBMLX4) $(LIBMLX5) +ib_read_lat_LDADD = libperftest.a $(LIBMATH) $(LIBMLX4) $(LIBMLX5) $(LIBEFA) ib_read_bw_SOURCES = src/read_bw.c -ib_read_bw_LDADD = libperftest.a $(LIBMATH) $(LIBMLX4) $(LIBMLX5) +ib_read_bw_LDADD = libperftest.a $(LIBMATH) $(LIBMLX4) $(LIBMLX5) $(LIBEFA) ib_atomic_lat_SOURCES = src/atomic_lat.c -ib_atomic_lat_LDADD = libperftest.a $(LIBMATH) $(LIBMLX4) $(LIBMLX5) +ib_atomic_lat_LDADD = libperftest.a $(LIBMATH) $(LIBMLX4) $(LIBMLX5) $(LIBEFA) ib_atomic_bw_SOURCES = src/atomic_bw.c -ib_atomic_bw_LDADD = libperftest.a $(LIBMATH) $(LIBMLX4) $(LIBMLX5) +ib_atomic_bw_LDADD = libperftest.a $(LIBMATH) $(LIBMLX4) $(LIBMLX5) $(LIBEFA) if HAVE_RAW_ETH raw_ethernet_bw_SOURCES = src/raw_ethernet_send_bw.c -raw_ethernet_bw_LDADD = libperftest.a $(LIBMATH) $(LIBMLX4) $(LIBMLX5) +raw_ethernet_bw_LDADD = libperftest.a $(LIBMATH) $(LIBMLX4) $(LIBMLX5) $(LIBEFA) raw_ethernet_lat_SOURCES = src/raw_ethernet_send_lat.c -raw_ethernet_lat_LDADD = libperftest.a $(LIBMATH) $(LIBMLX4) $(LIBMLX5) +raw_ethernet_lat_LDADD = libperftest.a $(LIBMATH) $(LIBMLX4) $(LIBMLX5) $(LIBEFA) raw_ethernet_burst_lat_SOURCES = src/raw_ethernet_send_burst_lat.c -raw_ethernet_burst_lat_LDADD = libperftest.a $(LIBMATH) $(LIBMLX4) $(LIBMLX5) +raw_ethernet_burst_lat_LDADD = libperftest.a $(LIBMATH) $(LIBMLX4) $(LIBMLX5) $(LIBEFA) raw_ethernet_fs_rate_SOURCES = src/raw_ethernet_fs_rate.c -raw_ethernet_fs_rate_LDADD = libperftest.a $(LIBMATH) $(LIBMLX4) $(LIBMLX5) +raw_ethernet_fs_rate_LDADD = libperftest.a $(LIBMATH) $(LIBMLX4) $(LIBMLX5) $(LIBEFA) else raw_ethernet_bw_SOURCES = diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/perftest-4.4-0.8/README new/perftest-4.4-0.11/README --- old/perftest-4.4-0.8/README 2019-08-25 14:11:20.000000000 +0200 +++ new/perftest-4.4-0.11/README 2019-12-15 15:31:12.000000000 +0100 @@ -130,7 +130,7 @@ -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). + -c, --connection=<type> Connection type RC/UC/UD/XRC/DC/SRD (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) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/perftest-4.4-0.8/configure.ac new/perftest-4.4-0.11/configure.ac --- old/perftest-4.4-0.8/configure.ac 2019-08-25 14:11:20.000000000 +0200 +++ new/perftest-4.4-0.11/configure.ac 2019-12-15 15:31:12.000000000 +0100 @@ -331,6 +331,13 @@ AC_DEFINE([HAVE_EXP_OOO_ATTR], [1], [Have Experimental Out of order data placement support]) fi +AC_CHECK_LIB([efa], [efadv_create_driver_qp], [HAVE_SRD=yes LIBEFA=-lefa], [HAVE_SRD=no]) +AM_CONDITIONAL([HAVE_SRD], [test "x$HAVE_SRD" = "xyes"]) +if [test $HAVE_SRD = yes] && [test $HAVE_IBV_WR_API = no]; then + AC_DEFINE([HAVE_SRD], [1], [Have SRD support]) + AC_SUBST([LIBEFA]) +fi + CFLAGS="-g -Wall -D_GNU_SOURCE -O3 $CFLAGS" LIBS=$LIBS" -lpthread" AC_SUBST([LIBUMAD]) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/perftest-4.4-0.8/src/atomic_bw.c new/perftest-4.4-0.11/src/atomic_bw.c --- old/perftest-4.4-0.8/src/atomic_bw.c 2019-08-25 14:11:20.000000000 +0200 +++ new/perftest-4.4-0.11/src/atomic_bw.c 2019-12-15 15:31:12.000000000 +0100 @@ -76,7 +76,7 @@ user_param.num_of_qps *= 2; } - ib_dev = ctx_find_dev(user_param.ib_devname); + ib_dev = ctx_find_dev(&user_param.ib_devname); if (!ib_dev) return 7; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/perftest-4.4-0.8/src/atomic_lat.c new/perftest-4.4-0.11/src/atomic_lat.c --- old/perftest-4.4-0.8/src/atomic_lat.c 2019-08-25 14:11:20.000000000 +0200 +++ new/perftest-4.4-0.11/src/atomic_lat.c 2019-12-15 15:31:12.000000000 +0100 @@ -84,7 +84,7 @@ user_param.num_of_qps *= 2; /* Finding the IB device selected (or defalut if no selected). */ - ib_dev = ctx_find_dev(user_param.ib_devname); + ib_dev = ctx_find_dev(&user_param.ib_devname); if (!ib_dev) { fprintf(stderr," Unable to find the Infiniband/RoCE device\n"); return FAILURE; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/perftest-4.4-0.8/src/multicast_resources.c new/perftest-4.4-0.11/src/multicast_resources.c --- old/perftest-4.4-0.8/src/multicast_resources.c 2019-08-25 14:11:20.000000000 +0200 +++ new/perftest-4.4-0.11/src/multicast_resources.c 2019-12-15 15:31:12.000000000 +0100 @@ -73,7 +73,7 @@ memcpy(&ptr[16],params->port_gid.raw, 16); (*(uint32_t *)(ptr + 32)) = htonl(DEF_QKEY); - (*(uint16_t *)(ptr + 40)) = htons(params->pkey); + (*(uint16_t *)(ptr + 40)) = params->pkey; ptr[39] = DEF_TCLASS; ptr[44] = INSERTF(ptr[44], 4, DEF_SLL, 0, 4); ptr[44] = INSERTF(ptr[44], 0, DEF_FLOW_LABLE, 16, 4); @@ -171,6 +171,53 @@ } /****************************************************************************** + * Set pkey correctly for cases where non-default values are used (e.g. Azure setup) + ******************************************************************************/ +static int set_pkey(void *umad_buff, struct ibv_context *ctx, int port_num) +{ + struct ibv_device_attr device_attr; + int32_t partial_ix = -1; + uint16_t pkey = 0xffff; + uint16_t tmp_pkey; + uint16_t pkey_tbl; + uint16_t index; + int ret; + int i; + + ret = ibv_query_device(ctx, &device_attr); + if (ret) + return ret; + + pkey_tbl = device_attr.max_pkeys; + for (i = 0; i < pkey_tbl; ++i) { + ret = ibv_query_pkey(ctx, port_num, i, &tmp_pkey); + if (ret) + continue; + + tmp_pkey = ntohs(tmp_pkey); + if ((pkey & 0x7fff) == (tmp_pkey & 0x7fff)) { + /* if there is full-member pkey take it.*/ + if (tmp_pkey & 0x8000) { + index = i; + umad_set_pkey(umad_buff, index); + return 0; + } + if (partial_ix < 0) + partial_ix = i; + } + } + + /*no full-member, if exists take the limited*/ + if (partial_ix >= 0) { + index = partial_ix; + umad_set_pkey(umad_buff, index); + return 0; + } + + return 1; +} + +/****************************************************************************** * join_multicast_group ******************************************************************************/ int join_multicast_group(subn_adm_method method,struct mcast_parameters *params) @@ -180,7 +227,7 @@ void *umad_buff = NULL; void *mad = NULL; int length = MAD_SIZE; - int test_result = 0; + int test_result = 1; /* mlid will be assigned to the new LID after the join */ if (umad_init() < 0) { @@ -209,6 +256,11 @@ mad = umad_get_mad(umad_buff); prepare_mcast_mad(method,params,(struct sa_mad_packet_t *)mad); + if (set_pkey(umad_buff, params->ib_ctx, params->ib_port)) { + fprintf(stderr, "failed to set pkey index\n"); + goto cleanup; + } + if (umad_set_addr(umad_buff,params->sm_lid,1,params->sm_sl,QP1_WELL_KNOWN_Q_KEY) < 0) { fprintf(stderr, "failed to set the destination address of the SMP\n"); goto cleanup; @@ -233,13 +285,12 @@ if (method == SUBN_ADM_METHOD_SET) { get_mlid_from_mad((struct sa_mad_packet_t*)mad,¶ms->mlid); params->mcast_state |= MCAST_IS_JOINED; - if (params->is_2nd_mgid_used == 0) { - sighandler_params = params; - signal(SIGINT,signalCatcher); - } + sighandler_params = params; + signal(SIGINT,signalCatcher); } else { params->mcast_state &= ~MCAST_IS_JOINED; } + test_result = 0; cleanup: if (umad_buff) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/perftest-4.4-0.8/src/multicast_resources.h new/perftest-4.4-0.11/src/multicast_resources.h --- old/perftest-4.4-0.8/src/multicast_resources.h 2019-08-25 14:11:20.000000000 +0200 +++ new/perftest-4.4-0.11/src/multicast_resources.h 2019-12-15 15:31:12.000000000 +0100 @@ -142,6 +142,7 @@ /* In case it's a latency test. */ union ibv_gid base_mgid; int is_2nd_mgid_used; + struct ibv_context *ib_ctx; }; /* according to Table 195 in the IB spec 1.2.1 */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/perftest-4.4-0.8/src/perftest_communication.c new/perftest-4.4-0.11/src/perftest_communication.c --- old/perftest-4.4-0.8/src/perftest_communication.c 2019-08-25 14:11:20.000000000 +0200 +++ new/perftest-4.4-0.11/src/perftest_communication.c 2019-12-15 15:31:12.000000000 +0100 @@ -1217,6 +1217,12 @@ } } + if ((user_param->counter_ctx) && (counters_open(user_param->counter_ctx, + user_param->ib_devname, user_param->ib_port))) { + fprintf(stderr," Unable to access performance counters\n"); + return FAILURE; + } + return SUCCESS; } @@ -1474,10 +1480,13 @@ void *my_data, void *rem_data,int size) { - if (comm->rdma_params->use_rdma_cm || comm->rdma_params->work_rdma_cm) - ctx_xchg_data_rdma(comm,my_data,rem_data,size); - else - ctx_xchg_data_ethernet(comm,my_data,rem_data,size); + if (comm->rdma_params->use_rdma_cm || comm->rdma_params->work_rdma_cm) { + if (ctx_xchg_data_rdma(comm,my_data,rem_data,size)) + return 1; + } else { + if (ctx_xchg_data_ethernet(comm,my_data,rem_data,size)) + return 1; + } return 0; } @@ -1744,9 +1753,8 @@ fprintf(stderr," Changing to this MTU\n"); } user_param->size = MTU_SIZE(user_param->curr_mtu); - } - /*checking msg size in raw ethernet*/ - if (user_param->connection_type == RawEth){ + } else if (user_param->connection_type == RawEth) { + /* checking msg size in raw ethernet */ if (user_param->size > user_param->curr_mtu) { fprintf(stderr," Max msg size in RawEth is MTU %d\n",user_param->curr_mtu); fprintf(stderr," Changing msg size to this MTU\n"); @@ -1755,6 +1763,21 @@ printf(" Min msg size for RawEth is 64B - changing msg size to 64 \n"); user_param->size = RAWETH_MIN_MSG_SIZE; } + } else if (user_param->connection_type == SRD) { + struct ibv_port_attr port_attr; + + if (ibv_query_port(context, user_param->ib_port, &port_attr)) { + fprintf(stderr, " Error when trying to query port\n"); + exit(1); + } + + if (user_param->size > port_attr.max_msg_sz) { + if (user_param->test_method == RUN_ALL) { + fprintf(stderr, " Max msg size is %u\n", port_attr.max_msg_sz); + fprintf(stderr, " Changing to this size\n"); + } + user_param->size = port_attr.max_msg_sz; + } } return SUCCESS; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/perftest-4.4-0.8/src/perftest_communication.h new/perftest-4.4-0.11/src/perftest_communication.h --- old/perftest-4.4-0.8/src/perftest_communication.h 2019-08-25 14:11:20.000000000 +0200 +++ new/perftest-4.4-0.11/src/perftest_communication.h 2019-12-15 15:31:12.000000000 +0100 @@ -103,6 +103,7 @@ struct perftest_comm { struct pingpong_context *rdma_ctx; + struct counter_context *counter_ctx; struct perftest_parameters *rdma_params; }; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/perftest-4.4-0.8/src/perftest_counters.c new/perftest-4.4-0.11/src/perftest_counters.c --- old/perftest-4.4-0.8/src/perftest_counters.c 1970-01-01 01:00:00.000000000 +0100 +++ new/perftest-4.4-0.11/src/perftest_counters.c 2019-12-15 15:31:12.000000000 +0100 @@ -0,0 +1,125 @@ +#include <stdio.h> +#include <fcntl.h> +#include <stdlib.h> +#include <string.h> +#include <sys/stat.h> +#include <sys/types.h> +#include "perftest_parameters.h" + +#define COUNTER_PATH "/sys/class/infiniband/%s/ports/%i/%s" +#define COUNTER_VALUE_MAX_LEN (21) + +typedef unsigned long long counter_t; + +struct counter_context { + char *counter_list; + unsigned num_counters; + struct { + int fd; + char *name; + counter_t prev_value; + counter_t last_value; + } counters[]; +}; + + +static int counters_read(struct counter_context *ctx) +{ + char read_buf[COUNTER_VALUE_MAX_LEN]; + + int i; + for (i = 0; i < ctx->num_counters; i++) { + int read_fd = ctx->counters[i].fd; + if (read(read_fd, &read_buf, COUNTER_VALUE_MAX_LEN) < 0) { + return -1; + } + + ctx->counters[i].prev_value = ctx->counters[i].last_value; + ctx->counters[i].last_value = strtoll(read_buf, NULL, 10); + (void) lseek(read_fd, 0, SEEK_SET); + } + + return SUCCESS; +} + +int counters_alloc(const char *counter_names, + struct counter_context **ctx) +{ + /* Count the number of commas and allocate accordingly */ + unsigned i, num_counters = (unsigned)(strlen(counter_names) > 0); + for (i = 0; i < strlen(counter_names); i++) { + if (counter_names[i] == ',') { + num_counters++; + } + } + + ALLOCATE(*ctx, struct counter_context, 3 * num_counters + 1); + (*ctx)->counter_list = strdup(counter_names); + (*ctx)->num_counters = num_counters; + return SUCCESS; +} + +int counters_open(struct counter_context *ctx, + const char *dev_name, int port) +{ + /* Open the sysfs file for each counter */ + int i; + char *given_path, *real_path, *next_counter; + for (i = 0, next_counter = strtok(ctx->counter_list, ","); + i < ctx->num_counters; + i++, next_counter = strtok(0, ",")) { + if (asprintf(&given_path, COUNTER_PATH, dev_name, port, next_counter) == -1) { + goto counter_cleanup; + } + + real_path = realpath(given_path, NULL); + if (!real_path) { + goto counter_cleanup; + } + + free(given_path); + if (strstr(real_path, COUNTER_PATH) != 0) { + free(real_path); + goto counter_cleanup; + } + + if ((ctx->counters[i].fd = open(real_path, O_RDONLY)) < 0) { + free(real_path); + goto counter_cleanup; + } + + ctx->counters[i].name = next_counter; + ctx->counters[i].last_value = 0; + free(real_path); + } + + return counters_read(ctx); + +counter_cleanup: + ctx->num_counters = i; + counters_close(ctx); + return FAILURE; +} + +void counters_print(struct counter_context *ctx) +{ + (void) counters_read(ctx); + + int i; + for (i = 0; i < ctx->num_counters; i++) { + printf("\t%s=%llu\n", ctx->counters[i].name, + ctx->counters[i].last_value - ctx->counters[i].prev_value); + } + printf("\n"); +} + +void counters_close(struct counter_context *ctx) +{ + int i; + for (i = 0; i < ctx->num_counters; i++) { + close(ctx->counters[i].fd); + } + + free(ctx->counter_list); + free(ctx); +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/perftest-4.4-0.8/src/perftest_counters.h new/perftest-4.4-0.11/src/perftest_counters.h --- old/perftest-4.4-0.8/src/perftest_counters.h 1970-01-01 01:00:00.000000000 +0100 +++ new/perftest-4.4-0.11/src/perftest_counters.h 2019-12-15 15:31:12.000000000 +0100 @@ -0,0 +1,28 @@ +#ifndef PERFTEST_COUNTERS_H +#define PERFTEST_COUNTERS_H + +struct counter_context; + +/* + * Allocate context for performance counters. + */ +int counters_alloc(const char *counter_names, + struct counter_context **ctx); + +/* + * Open a handle to the counters (and sample once). + */ +int counters_open(struct counter_context *ctx, + const char *dev_name, int port); + +/* + * Sample and output the values to STDOUT. + */ +void counters_print(struct counter_context *ctx); + +/* + * Close the handle to the counters. + */ +void counters_close(struct counter_context *ctx); + +#endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/perftest-4.4-0.8/src/perftest_parameters.c new/perftest-4.4-0.11/src/perftest_parameters.c --- old/perftest-4.4-0.8/src/perftest_parameters.c 2019-08-25 14:11:20.000000000 +0200 +++ new/perftest-4.4-0.11/src/perftest_parameters.c 2019-12-15 15:31:12.000000000 +0100 @@ -15,7 +15,7 @@ #define ETHERTYPE_LEN (6) #define MAC_ARR_LEN (6) #define HEX_BASE (16) -static const char *connStr[] = {"RC","UC","UD","RawEth","XRC","DC"}; +static const char *connStr[] = {"RC","UC","UD","RawEth","XRC","DC","SRD"}; static const char *testsStr[] = {"Send","RDMA_Write","RDMA_Read","Atomic"}; static const char *portStates[] = {"Nop","Down","Init","Armed","","Active Defer"}; static const char *qp_state[] = {"OFF","ON"}; @@ -196,8 +196,8 @@ if (connection_type != RawEth) { if (verb == SEND) { - printf(" -c, --connection=<RC/XRC/UC/UD/DC> "); - printf(" Connection type RC/XRC/UC/UD/DC (default RC)\n"); + printf(" -c, --connection=<RC/XRC/UC/UD/DC/SRD> "); + printf(" Connection type RC/XRC/UC/UD/DC/SRD (default RC)\n"); } else if (verb == WRITE) { printf(" -c, --connection=<RC/XRC/UC/DC> "); printf(" Connection type RC/XRC/UC/DC (default RC)\n"); @@ -351,6 +351,9 @@ printf(" Set verifier limit for bandwidth\n"); } + printf(" -W, --report-counters=<list of counter names> "); + printf(" Report performance counter change (example: \"counters/port_xmit_data,hw_counters/out_of_buffer\")\n"); + if (connection_type != RawEth) { printf(" -x, --gid-index=<index> "); printf(" Test uses GID with GID index (Default : IB - no gid . ETH - 0)\n"); @@ -644,6 +647,7 @@ user_param->rx_depth = user_param->verb == SEND ? DEF_RX_SEND : DEF_RX_RDMA; user_param->duplex = OFF; user_param->noPeak = OFF; + user_param->req_cq_mod = 0; user_param->cq_mod = DEF_CQ_MOD; user_param->iters = (user_param->tst == BW && user_param->verb == WRITE) ? DEF_ITERS_WB : DEF_ITERS; user_param->dualport = OFF; @@ -807,8 +811,19 @@ fprintf(stderr," DC not detected in libibverbs\n"); exit(1); #endif + } else if (strcmp(connStr[6], optarg) == 0) { + #ifdef HAVE_SRD + if (verb != SEND) { + fprintf(stderr, " SRD connection only possible in SEND verb\n"); + exit(1); + } + *cptr = SRD; + #else + fprintf(stderr, " SRD not detected in libibverbs\n"); + exit(1); + #endif } else { - fprintf(stderr," Invalid Connection type . please choose from {RC,UC,UD}\n"); + fprintf(stderr, " Invalid Connection type. Please choose from {RC,UC,UD,XRC,DC,SRD}\n"); exit(1); } } @@ -918,6 +933,22 @@ } } + if (user_param->size > MSG_SIZE_CQ_MOD_LIMIT && + user_param->connection_type != UD && + user_param->test_method != RUN_ALL) + { + if (!user_param->req_cq_mod) // user didn't request any cq_mod + { + user_param->cq_mod = DISABLED_CQ_MOD_VALUE; + } + else if (user_param->cq_mod > DISABLED_CQ_MOD_VALUE) + { + printf(RESULT_LINE); + printf("Warning: Large message requested and CQ moderation enabled\n"); + printf("Warning: It can lead to inaccurate results\n"); + } + } + if (user_param->tst == LAT_BY_BW && user_param->rate_limit_type == DISABLE_RATE_LIMIT) { if (user_param->output == FULL_VERBOSITY) printf("rate_limit type is forced to SW.\n"); @@ -1192,6 +1223,20 @@ } } + if (user_param->connection_type == SRD) { + if (user_param->work_rdma_cm == ON) { + printf(RESULT_LINE); + fprintf(stderr, " SRD does not support RDMA_CM\n"); + exit(1); + } + if (user_param->use_event == ON) { + printf(RESULT_LINE); + fprintf(stderr, " SRD does not support events\n"); + exit(1); + } + user_param->cq_mod = 1; + } + #ifndef HAVE_RSS_EXP if (user_param->use_rss) { printf(RESULT_LINE); @@ -1569,6 +1614,7 @@ case 55296 : dev_fname = NETXTREME; break; case 55298 : dev_fname = NETXTREME; break; case 55300 : dev_fname = NETXTREME; break; + case 61344 : dev_fname = EFA; break; default : dev_fname = UNKNOWN; } } @@ -1736,6 +1782,8 @@ } if (current_dev == NETXTREME) user_param->inline_size = 96; + else if (current_dev == EFA) + user_param->inline_size = 32; } else { user_param->inline_size = 0; @@ -1902,6 +1950,7 @@ { .name = "client", .has_arg = 0, .val = 'P' }, { .name = "mac_fwd", .has_arg = 0, .val = 'v' }, { .name = "use_rss", .has_arg = 0, .val = 'G' }, + { .name = "report-counters", .has_arg = 1, .val = 'W' }, { .name = "force-link", .has_arg = 1, .flag = &force_link_flag, .val = 1}, { .name = "remote_mac", .has_arg = 1, .flag = &remote_mac_flag, .val = 1 }, { .name = "local_mac", .has_arg = 1, .flag = &local_mac_flag, .val = 1 }, @@ -1969,7 +2018,7 @@ #endif { 0 } }; - c = getopt_long(argc,argv,"w:y:p:d:i:m:s:n:t:u:S:x:c:q:I:o:M:r:Q:A:l:D:f:B:T:L:E:J:j:K:k:X:aFegzRvhbNVCHUOZP",long_options,NULL); + c = getopt_long(argc,argv,"w:y:p:d:i:m:s:n:t:u:S:x:c:q:I:o:M:r:Q:A:l:D:f:B:T:L:E:J:j:K:k:X:W:aFegzRvhbNVCHUOZP",long_options,NULL); if (c == -1) break; @@ -2018,7 +2067,9 @@ fprintf(stderr," On RDMA verbs rx depth can be only 1\n"); return 1; } break; - case 'Q': CHECK_VALUE(user_param->cq_mod,int,MIN_CQ_MOD,MAX_CQ_MOD,"CQ moderation"); break; + case 'Q': CHECK_VALUE(user_param->cq_mod,int,MIN_CQ_MOD,MAX_CQ_MOD,"CQ moderation"); + user_param->req_cq_mod = 1; + break; case 'A': if (user_param->verb != ATOMIC) { fprintf(stderr," You are not running the atomic_lat/bw test!\n"); @@ -2193,6 +2244,12 @@ return FAILURE; } break; + case 'W': + if (counters_alloc(optarg, &user_param->counter_ctx)) { + fprintf(stderr, "Failed to parse the performance counter list\n"); + return FAILURE; + } + break; case 'P': user_param->machine = CLIENT; break; case 'Z': user_param->machine = SERVER; break; case 'v': user_param->mac_fwd = ON; break; @@ -2671,8 +2728,6 @@ user_param->size = RAWETH_MIN_MSG_SIZE; } } - if (!user_param->ib_devname) - GET_STRING(user_param->ib_devname,ibv_get_device_name(context->device)) if (user_param->pkey_index > 0) user_param->pkey_index = ctx_chk_pkey_index(context, user_param->pkey_index); @@ -2720,10 +2775,6 @@ else user_param->out_reads = 1; - - if (!user_param->ib_devname) - GET_STRING(user_param->ib_devname,ibv_get_device_name(context->device)) - if (user_param->pkey_index > 0) user_param->pkey_index = ctx_chk_pkey_index(context, user_param->pkey_index); @@ -3002,6 +3053,9 @@ fflush(stdout); fprintf(stdout, user_param->cpu_util_data.enable ? REPORT_EXT_CPU_UTIL : REPORT_EXT , calc_cpu_util(user_param)); } + if (user_param->counter_ctx) { + counters_print(user_param->counter_ctx); + } } /****************************************************************************** * @@ -3129,6 +3183,10 @@ printf( user_param->cpu_util_data.enable ? REPORT_EXT_CPU_UTIL : REPORT_EXT , calc_cpu_util(user_param)); } + if (user_param->counter_ctx) { + counters_print(user_param->counter_ctx); + } + free(delta); } @@ -3159,6 +3217,10 @@ latency, tps); printf( user_param->cpu_util_data.enable ? REPORT_EXT_CPU_UTIL : REPORT_EXT , calc_cpu_util(user_param)); } + + if (user_param->counter_ctx) { + counters_print(user_param->counter_ctx); + } } void print_report_fs_rate (struct perftest_parameters *user_param) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/perftest-4.4-0.8/src/perftest_parameters.h new/perftest-4.4-0.11/src/perftest_parameters.h --- old/perftest-4.4-0.8/src/perftest_parameters.h 2019-08-25 14:11:20.000000000 +0200 +++ new/perftest-4.4-0.11/src/perftest_parameters.h 2019-12-15 15:31:12.000000000 +0100 @@ -59,6 +59,7 @@ #include <malloc.h> #endif #include "get_clock.h" +#include "perftest_counters.h" #ifdef HAVE_CONFIG_H #include <config.h> @@ -79,6 +80,7 @@ #define RawEth (3) #define XRC (4) #define DC (5) +#define SRD (6) /* Genral control definitions */ #define OFF (0) @@ -127,6 +129,8 @@ #define DEF_PAGE_SIZE (4096) #define DEF_FLOWS (1) #define RATE_VALUES_COUNT (18) +#define DISABLED_CQ_MOD_VALUE (1) +#define MSG_SIZE_CQ_MOD_LIMIT (8192) /* Optimal Values for Inline */ #define DEF_INLINE_WRITE (220) @@ -295,7 +299,8 @@ BLUEFIELD = 20, BLUEFIELD2 = 21, INTEL_ALL = 22, - NETXTREME = 23 + NETXTREME = 23, + EFA = 24, }; /* Units for rate limiter */ @@ -410,6 +415,7 @@ int duplex; int noPeak; int cq_mod; + int req_cq_mod; int spec; int dualport; int post_list; @@ -510,6 +516,7 @@ int vlan_en; uint32_t vlan_pcp; void (*print_eth_func)(void*); + struct counter_context *counter_ctx; }; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/perftest-4.4-0.8/src/perftest_resources.c new/perftest-4.4-0.11/src/perftest_resources.c --- old/perftest-4.4-0.8/src/perftest_resources.c 2019-08-25 14:11:20.000000000 +0200 +++ new/perftest-4.4-0.11/src/perftest_resources.c 2019-12-15 15:31:12.000000000 +0100 @@ -19,11 +19,15 @@ #include <sys/stat.h> #endif -#include "perftest_resources.h" -#include "raw_ethernet_resources.h" #ifdef HAVE_CONFIG_H #include <config.h> #endif +#ifdef HAVE_SRD +#include <infiniband/efadv.h> +#endif + +#include "perftest_resources.h" +#include "raw_ethernet_resources.h" #ifdef HAVE_VERBS_EXP static enum ibv_exp_wr_opcode exp_opcode_verbs_array[] = {IBV_EXP_WR_SEND,IBV_EXP_WR_RDMA_WRITE,IBV_EXP_WR_RDMA_READ}; @@ -875,7 +879,7 @@ /****************************************************************************** + * + ******************************************************************************/ -struct ibv_device* ctx_find_dev(const char *ib_devname) +struct ibv_device* ctx_find_dev(char **ib_devname) { int num_of_device; struct ibv_device **dev_list; @@ -890,6 +894,11 @@ } if (!ib_devname) { + fprintf(stderr," Internal error, existing.\n"); + return NULL; + } + + if (!*ib_devname) { ib_dev = dev_list[0]; if (!ib_dev) { fprintf(stderr, "No IB devices found\n"); @@ -897,11 +906,15 @@ } } else { for (; (ib_dev = *dev_list); ++dev_list) - if (!strcmp(ibv_get_device_name(ib_dev), ib_devname)) + if (!strcmp(ibv_get_device_name(ib_dev), *ib_devname)) break; - if (!ib_dev) - fprintf(stderr, "IB device %s not found\n", ib_devname); + if (!ib_dev) { + fprintf(stderr, "IB device %s not found\n", *ib_devname); + return NULL; + } } + + GET_STRING(*ib_devname, ibv_get_device_name(ib_dev)); return ib_dev; } @@ -972,7 +985,8 @@ 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); - if ((user_param->verb == SEND && user_param->connection_type == UD ) || user_param->connection_type == DC) { + if ((user_param->verb == SEND && user_param->connection_type == UD) || + user_param->connection_type == DC || user_param->connection_type == SRD) { ALLOCATE(ctx->ah, struct ibv_ah*, user_param->num_of_qps); } } @@ -1047,9 +1061,10 @@ first = 0; for (i = first; i < user_param->num_of_qps; i++) { - if (( (user_param->connection_type == DC && !((!(user_param->duplex || user_param->tst == LAT) && (user_param->machine == SERVER) ) - || ((user_param->duplex || user_param->tst == LAT) && (i >= num_of_qps)))) || - user_param->connection_type == UD) && (user_param->tst == LAT || user_param->machine == CLIENT || user_param->duplex)) { + if (((user_param->connection_type == DC && !((!(user_param->duplex || user_param->tst == LAT) && user_param->machine == SERVER) + || ((user_param->duplex || user_param->tst == LAT) && i >= num_of_qps))) || + user_param->connection_type == UD || user_param->connection_type == SRD) && + (user_param->tst == LAT || user_param->machine == CLIENT || user_param->duplex)) { if (ibv_destroy_ah(ctx->ah[i])) { fprintf(stderr, "Failed to destroy AH\n"); test_result = 1; @@ -1217,6 +1232,10 @@ rdma_cm_destroy_cma(ctx, user_param); } + if (user_param->counter_ctx) { + counters_close(user_param->counter_ctx); + } + return test_result; } @@ -2197,6 +2216,9 @@ #ifdef HAVE_RAW_ETH case RawEth : attr.qp_type = IBV_QPT_RAW_PACKET; break; #endif + #ifdef HAVE_SRD + case SRD: attr.qp_type = IBV_QPT_DRIVER; break; + #endif default: fprintf(stderr, "Unknown connection type \n"); return NULL; } @@ -2232,6 +2254,10 @@ qp = ctx->cm_id->qp; } #endif + } else if (user_param->connection_type == SRD) { + #ifdef HAVE_SRD + qp = efadv_create_driver_qp(ctx->pd, &attr, EFADV_QP_DRIVER_TYPE_SRD); + #endif } else { #ifdef HAVE_IBV_WR_API qp = ibv_create_qp_ex(ctx->context, &attr); @@ -2441,7 +2467,7 @@ exp_flags = init_flag | IBV_EXP_QP_STATE | IBV_EXP_QP_PORT; #endif - } else if (user_param->connection_type == UD) { + } else if (user_param->connection_type == UD || user_param->connection_type == SRD) { attr.qkey = DEFF_QKEY; flags |= IBV_QP_QKEY; @@ -2593,7 +2619,7 @@ attr->ah_attr.grh.hop_limit = 0xFF; attr->ah_attr.grh.traffic_class = user_param->traffic_class; } - if (user_param->connection_type != UD) { + if (user_param->connection_type != UD && user_param->connection_type != SRD) { attr->path_mtu = user_param->curr_mtu; attr->dest_qp_num = dest->qpn; @@ -2818,7 +2844,7 @@ } } - if ((user_param->connection_type == UD || user_param->connection_type == DC) && + if ((user_param->connection_type == UD || user_param->connection_type == DC || user_param->connection_type == SRD) && (user_param->tst == LAT || user_param->machine == CLIENT || user_param->duplex)) { #ifdef HAVE_DC @@ -2828,9 +2854,8 @@ #endif ctx->ah[i] = ibv_create_ah(ctx->pd,&(attr.ah_attr)); - if (!ctx->ah[i]) { - fprintf(stderr, "Failed to create AH for UD\n"); + fprintf(stderr, "Failed to create AH\n"); return FAILURE; } } @@ -3254,6 +3279,9 @@ if (j == (user_param->post_list - 1)) { ctx->wr[i*user_param->post_list + j].send_flags = IBV_SEND_SIGNALED; + #ifdef HAVE_IBV_WR_API + ctx->qpx[i]->wr_flags = IBV_SEND_SIGNALED; + #endif ctx->wr[i*user_param->post_list + j].next = NULL; } @@ -3304,7 +3332,7 @@ } else if (user_param->verb == SEND) { - if (user_param->connection_type == UD) { + if (user_param->connection_type == UD || user_param->connection_type == SRD) { ctx->wr[i*user_param->post_list + j].wr.ud.ah = ctx->ah[i]; if (user_param->work_rdma_cm) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/perftest-4.4-0.8/src/perftest_resources.h new/perftest-4.4-0.11/src/perftest_resources.h --- old/perftest-4.4-0.8/src/perftest_resources.h 2019-08-25 14:11:20.000000000 +0200 +++ new/perftest-4.4-0.11/src/perftest_resources.h 2019-12-15 15:31:12.000000000 +0100 @@ -121,7 +121,7 @@ #define INC(size,cache_line_size) ((size > cache_line_size) ? ((size%cache_line_size == 0) ? \ (size) : (cache_line_size*(size/cache_line_size+1))) : (cache_line_size)) -#define UD_MSG_2_EXP(size) ((log(size))/(log(2))) +#define MSG_SZ_2_EXP(size) ((log(size)) / (log(2))) #define MASK_IS_SET(mask, attr) (((mask)&(attr))!=0) @@ -249,7 +249,8 @@ /* ctx_find_dev * * Description : Returns the device corresponding to ib_devname - * or the first one found , in case ib_devname == NULL + * or the first one found , in case ib_devname == NULL. + * Also sets the actual device name selected. * * Parameters : * @@ -257,7 +258,7 @@ * * Return Value : the device or NULL in case of failure. */ -struct ibv_device* ctx_find_dev(const char *ib_devname); +struct ibv_device* ctx_find_dev(char **ib_devname); /* create_rdma_resources * diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/perftest-4.4-0.8/src/raw_ethernet_fs_rate.c new/perftest-4.4-0.11/src/raw_ethernet_fs_rate.c --- old/perftest-4.4-0.8/src/raw_ethernet_fs_rate.c 2019-08-25 14:11:20.000000000 +0200 +++ new/perftest-4.4-0.11/src/raw_ethernet_fs_rate.c 2019-12-15 15:31:12.000000000 +0100 @@ -93,13 +93,12 @@ memset(rem_dest_info, 0, sizeof(struct raw_ethernet_info) * user_param.num_of_qps); /* Finding the IB device selected (or default if no selected). */ - ib_dev = ctx_find_dev(user_param.ib_devname); + ib_dev = ctx_find_dev(&user_param.ib_devname); if (!ib_dev) { fprintf(stderr, "Unable to find the Infiniband/RoCE device\n"); DEBUG_LOG(TRACE, "<<<<<<%s", __FUNCTION__); return FAILURE; } - GET_STRING(user_param.ib_devname, ibv_get_device_name(ib_dev)); if (check_flow_steering_support(user_param.ib_devname)) { return FAILURE; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/perftest-4.4-0.8/src/raw_ethernet_send_burst_lat.c new/perftest-4.4-0.11/src/raw_ethernet_send_burst_lat.c --- old/perftest-4.4-0.8/src/raw_ethernet_send_burst_lat.c 2019-08-25 14:11:20.000000000 +0200 +++ new/perftest-4.4-0.11/src/raw_ethernet_send_burst_lat.c 2019-12-15 15:31:12.000000000 +0100 @@ -118,13 +118,12 @@ user_param.duplex = 1; /* Find the selected IB device (or default if the user didn't select one). */ - ib_dev = ctx_find_dev(user_param.ib_devname); + ib_dev = ctx_find_dev(&user_param.ib_devname); if (!ib_dev) { fprintf(stderr," Unable to find the Infiniband/RoCE device\n"); DEBUG_LOG(TRACE,"<<<<<<%s",__FUNCTION__); return FAILURE; } - GET_STRING(user_param.ib_devname, ibv_get_device_name(ib_dev)); if (check_flow_steering_support(user_param.ib_devname)) { return FAILURE; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/perftest-4.4-0.8/src/raw_ethernet_send_bw.c new/perftest-4.4-0.11/src/raw_ethernet_send_bw.c --- old/perftest-4.4-0.8/src/raw_ethernet_send_bw.c 2019-08-25 14:11:20.000000000 +0200 +++ new/perftest-4.4-0.11/src/raw_ethernet_send_bw.c 2019-12-15 15:31:12.000000000 +0100 @@ -153,13 +153,12 @@ } /* Finding the IB device selected (or default if no selected). */ - ib_dev = ctx_find_dev(user_param.ib_devname); + ib_dev = ctx_find_dev(&user_param.ib_devname); if (!ib_dev) { fprintf(stderr," Unable to find the Infiniband/RoCE device\n"); DEBUG_LOG(TRACE, "<<<<<<%s", __FUNCTION__); return FAILURE; } - GET_STRING(user_param.ib_devname, ibv_get_device_name(ib_dev)); if (check_flow_steering_support(user_param.ib_devname)) { return FAILURE; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/perftest-4.4-0.8/src/raw_ethernet_send_lat.c new/perftest-4.4-0.11/src/raw_ethernet_send_lat.c --- old/perftest-4.4-0.8/src/raw_ethernet_send_lat.c 2019-08-25 14:11:20.000000000 +0200 +++ new/perftest-4.4-0.11/src/raw_ethernet_send_lat.c 2019-12-15 15:31:12.000000000 +0100 @@ -118,13 +118,12 @@ user_param.duplex = 1; /* Find the selected IB device (or default if the user didn't select one). */ - ib_dev = ctx_find_dev(user_param.ib_devname); + ib_dev = ctx_find_dev(&user_param.ib_devname); if (!ib_dev) { fprintf(stderr," Unable to find the Infiniband/RoCE device\n"); DEBUG_LOG(TRACE,"<<<<<<%s",__FUNCTION__); return FAILURE; } - GET_STRING(user_param.ib_devname, ibv_get_device_name(ib_dev)); if (check_flow_steering_support(user_param.ib_devname)) { return FAILURE; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/perftest-4.4-0.8/src/read_bw.c new/perftest-4.4-0.11/src/read_bw.c --- old/perftest-4.4-0.8/src/read_bw.c 2019-08-25 14:11:20.000000000 +0200 +++ new/perftest-4.4-0.11/src/read_bw.c 2019-12-15 15:31:12.000000000 +0100 @@ -76,7 +76,7 @@ user_param.num_of_qps *= 2; } - ib_dev =ctx_find_dev(user_param.ib_devname); + ib_dev =ctx_find_dev(&user_param.ib_devname); if (!ib_dev) return 7; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/perftest-4.4-0.8/src/read_lat.c new/perftest-4.4-0.11/src/read_lat.c --- old/perftest-4.4-0.8/src/read_lat.c 2019-08-25 14:11:20.000000000 +0200 +++ new/perftest-4.4-0.11/src/read_lat.c 2019-12-15 15:31:12.000000000 +0100 @@ -85,7 +85,7 @@ } /* Finding the IB device selected (or defalut if no selected). */ - ib_dev = ctx_find_dev(user_param.ib_devname); + ib_dev = ctx_find_dev(&user_param.ib_devname); if (!ib_dev) { fprintf(stderr," Unable to find the Infiniband/RoCE device\n"); return FAILURE; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/perftest-4.4-0.8/src/send_bw.c new/perftest-4.4-0.11/src/send_bw.c --- old/perftest-4.4-0.8/src/send_bw.c 2019-08-25 14:11:20.000000000 +0200 +++ new/perftest-4.4-0.11/src/send_bw.c 2019-12-15 15:31:12.000000000 +0100 @@ -66,6 +66,7 @@ mcg_params->sm_lid = port_attr.sm_lid; mcg_params->sm_sl = port_attr.sm_sl; mcg_params->ib_port = user_param->ib_port; + mcg_params->ib_ctx = ctx->context; if (!strcmp(link_layer_str(user_param->link_type),"IB")) { /* Request for Mcast group create registery in SM. */ @@ -191,15 +192,12 @@ } /* Finding the IB device selected (or defalut if no selected). */ - ib_dev = ctx_find_dev(user_param.ib_devname); + ib_dev = ctx_find_dev(&user_param.ib_devname); if (!ib_dev) { fprintf(stderr," Unable to find the Infiniband/RoCE device\n"); return FAILURE; } - if (user_param.use_mcg) - GET_STRING(mcg_params.ib_devname,ibv_get_device_name(ib_dev)); - /* Getting the relevant context from the device */ ctx.context = ibv_open_device(ib_dev); if (!ctx.context) { @@ -378,9 +376,10 @@ } if (user_param.test_method == RUN_ALL) { - if (user_param.connection_type == UD) - size_max_pow = (int)UD_MSG_2_EXP(MTU_SIZE(user_param.curr_mtu)) + 1; + size_max_pow = (int)MSG_SZ_2_EXP(MTU_SIZE(user_param.curr_mtu)) + 1; + else if (user_param.connection_type == SRD) + size_max_pow = (int)MSG_SZ_2_EXP(user_param.size) + 1; for (i = 1; i < size_max_pow ; ++i) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/perftest-4.4-0.8/src/send_lat.c new/perftest-4.4-0.11/src/send_lat.c --- old/perftest-4.4-0.8/src/send_lat.c 2019-08-25 14:11:20.000000000 +0200 +++ new/perftest-4.4-0.11/src/send_lat.c 2019-12-15 15:31:12.000000000 +0100 @@ -57,7 +57,6 @@ struct perftest_parameters *user_param, struct mcast_parameters *mcg_params) { - int i; struct ibv_port_attr port_attr; if (ibv_query_gid(ctx->context,user_param->ib_port,user_param->gid_index,&mcg_params->port_gid)) { @@ -74,26 +73,15 @@ mcg_params->sm_lid = port_attr.sm_lid; mcg_params->sm_sl = port_attr.sm_sl; mcg_params->ib_port = user_param->ib_port; - mcg_params->user_mgid = user_param->user_mgid; - set_multicast_gid(mcg_params,ctx->qp[0]->qp_num,(int)user_param->machine); + mcg_params->ib_ctx = ctx->context; if (!strcmp(link_layer_str(user_param->link_type),"IB")) { /* Request for Mcast group create registery in SM. */ if (join_multicast_group(SUBN_ADM_METHOD_SET,mcg_params)) { - fprintf(stderr," Failed to Join Mcast request\n"); + fprintf(stderr,"Couldn't Register the Mcast group on the SM\n"); return FAILURE; } } - - for (i=0; i < user_param->num_of_qps; i++) { - - if (ibv_attach_mcast(ctx->qp[i],&mcg_params->mgid,mcg_params->mlid)) { - fprintf(stderr, "Couldn't attach QP to MultiCast group"); - return FAILURE; - } - } - mcg_params->mcast_state |= MCAST_IS_ATTACHED; - return 0; } @@ -113,9 +101,9 @@ return FAILURE; } - if (user_param->use_mcg && (user_param->duplex || user_param->machine == SERVER)) { - + if (user_param->use_mcg) { mcg_params->user_mgid = user_param->user_mgid; + set_multicast_gid(mcg_params,ctx->qp[0]->qp_num,(int)user_param->machine); if (set_mcast_group(ctx,user_param,mcg_params)) { return FAILURE; @@ -133,7 +121,6 @@ my_dest->lid = mcg_params->mlid; my_dest->qpn = QPNUM_MCAST; } - return 0; } @@ -146,19 +133,14 @@ { int i; if (user_param->use_mcg) { - - if (user_param->machine == SERVER) - { - for (i=0; i < user_param->num_of_qps; i++) { + for (i=0; i < user_param->num_of_qps; i++) { if (ibv_detach_mcast(ctx->qp[i],&mcg_params->base_mgid,mcg_params->base_mlid)) { fprintf(stderr, "Couldn't dettach QP to MultiCast group\n"); return FAILURE; } - } } if (!strcmp(link_layer_str(user_param->link_type),"IB")) { - if (join_multicast_group(SUBN_ADM_METHOD_DELETE,mcg_params)) { fprintf(stderr,"Couldn't Unregister the Mcast group on the SM\n"); return FAILURE; @@ -222,15 +204,12 @@ } /* Finding the IB device selected (or defalut if no selected). */ - ib_dev = ctx_find_dev(user_param.ib_devname); + ib_dev = ctx_find_dev(&user_param.ib_devname); if (!ib_dev) { fprintf(stderr," Unable to find the Infiniband/RoCE device\n"); return FAILURE; } - if (user_param.use_mcg) - GET_STRING(mcg_params.ib_devname,ibv_get_device_name(ib_dev)); - /* Getting the relevant context from the device */ ctx.context = ibv_open_device(ib_dev); if (!ctx.context) { @@ -336,7 +315,6 @@ } if (user_param.use_mcg) { - memcpy(mcg_params.base_mgid.raw,mcg_params.mgid.raw,16); memcpy(mcg_params.mgid.raw,rem_dest[0].gid.raw,16); mcg_params.base_mlid = mcg_params.mlid; @@ -397,9 +375,10 @@ ctx_set_send_wqes(&ctx,&user_param,rem_dest); if (user_param.test_method == RUN_ALL) { - if (user_param.connection_type == UD) - size_max_pow = (int)UD_MSG_2_EXP(MTU_SIZE(user_param.curr_mtu)) + 1; + size_max_pow = (int)MSG_SZ_2_EXP(MTU_SIZE(user_param.curr_mtu)) + 1; + else if (user_param.connection_type == SRD) + size_max_pow = (int)MSG_SZ_2_EXP(user_param.size) + 1; for (i = 1; i < size_max_pow ; ++i) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/perftest-4.4-0.8/src/write_bw.c new/perftest-4.4-0.11/src/write_bw.c --- old/perftest-4.4-0.8/src/write_bw.c 2019-08-25 14:11:20.000000000 +0200 +++ new/perftest-4.4-0.11/src/write_bw.c 2019-12-15 15:31:12.000000000 +0100 @@ -77,7 +77,7 @@ } /* Finding the IB device selected (or default if none is selected). */ - ib_dev = ctx_find_dev(user_param.ib_devname); + ib_dev = ctx_find_dev(&user_param.ib_devname); if (!ib_dev) { fprintf(stderr," Unable to find the Infiniband/RoCE device\n"); return FAILURE; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/perftest-4.4-0.8/src/write_lat.c new/perftest-4.4-0.11/src/write_lat.c --- old/perftest-4.4-0.8/src/write_lat.c 2019-08-25 14:11:20.000000000 +0200 +++ new/perftest-4.4-0.11/src/write_lat.c 2019-12-15 15:31:12.000000000 +0100 @@ -85,7 +85,7 @@ } /* Finding the IB device selected (or defalut if no selected). */ - ib_dev = ctx_find_dev(user_param.ib_devname); + ib_dev = ctx_find_dev(&user_param.ib_devname); if (!ib_dev) { fprintf(stderr," Unable to find the Infiniband/RoCE device\n"); return FAILURE;
