..\perf_utils.c \\r
read_bw.c \r
\r
-INCLUDES=..;..\..\..\..\inc;..\..\..\..\inc\user\r
+INCLUDES=..;..\..\..\..\inc;..\..\..\..\inc\user;..\..\..\..\hw\mlx4\user\hca;..\..\..\..\inc\complib\r
\r
RCOPTIONS=/I..\..\win\include\r
\r
#include "getopt.h"
#include "perf_defs.h"
#include "get_clock.h"
+#include "l2w.h"
struct user_parameters {
const char *servername;
return ;
}
-static struct pingpong_context *pp_init_ctx(unsigned size,int port, struct user_parameters *user_parm)
+static struct pingpong_context *pp_init_ctx(unsigned size,int port, struct user_parameters *user_parm, char* ib_devguid)
{
struct pingpong_context *ctx;
ib_api_status_t ib_status = IB_SUCCESS;
size_t guid_count;
ib_net64_t *ca_guid_array;
+ int guid_index = 0;
ctx = malloc(sizeof *ctx);
* Open only the first HCA
*/
/* Open the CA */
- ib_status = ib_open_ca(ctx->al ,ca_guid_array[0] ,NULL,
+ if (ib_devguid)
+ {
+ unsigned int i = 0;
+ guid_index = -1;
+ for (i = 0; i < guid_count; i++)
+ {
+ char curr_dev[20];
+ sprintf(curr_dev, "0x%016I64x", ntohll(ca_guid_array[i]));
+ if (!_stricmp(ib_devguid, curr_dev))
+ {
+ guid_index = i;
+ break;
+ }
+ }
+ if (guid_index == -1)
+ {
+ fprintf(stderr,"device with guid %s was not found\n", ib_devguid);
+ return NULL;
+ }
+ }
+
+ ib_status = ib_open_ca(ctx->al ,ca_guid_array[guid_index] ,NULL,
NULL, //ca_context
&ctx->ca);
printf("\n");
printf("Options:\n");
printf(" -p, --port=<port> listen on/connect to port <port> (default 18515)\n");
+ printf(" -d, --ib-dev=<dev> use IB device <device guid> (default first device found)\n");
printf(" -i, --ib-port=<port> use port <port> of IB device (default 1)\n");
printf(" -m, --mtu=<mtu> mtu size (default 1024)\n");
printf(" -o, --outs=<num> num of outstanding read/atom(default 4)\n");
struct pingpong_dest *my_dest;
struct pingpong_dest *rem_dest;
struct user_parameters user_param;
- char *ib_devname = NULL;
+ char *ib_devguid = NULL;
int port = 18515;
int ib_port = 1;
unsigned size = 65536;
int i = 0;
int duplex = 0;
+ SYSTEM_INFO si;
+ GetSystemInfo(&si);
+
/* init default values to user's parameters */
memset(&user_param, 0, sizeof(struct user_parameters));
user_param.mtu = 0; /* signal choose default by device */
break;
case 'd':
- ib_devname = _strdup(optarg);
+ ib_devguid = _strdup(optarg);
break;
case 'm':
user_param.mtu = strtol(optarg, NULL, 0);
srand(GetCurrentProcessId() * GetTickCount());
- //TODO: get pagesize from sysinfo
- page_size = 4096;
-
- //TODO:get the device names
-
+ page_size = si.dwPageSize;
- ctx = pp_init_ctx(size,ib_port, &user_param);
+ ctx = pp_init_ctx(size,ib_port, &user_param, ib_devguid);
if (!ctx)
return 8;
..\perf_utils.c \\r
read_lat.c \r
\r
-INCLUDES=..;..\..\..\..\inc;..\..\..\..\inc\user\r
+INCLUDES=..;..\..\..\..\inc;..\..\..\..\inc\user;..\..\..\..\hw\mlx4\user\hca;..\..\..\..\inc\complib\r
\r
RCOPTIONS=/I..\..\win\include\r
\r
#include "getopt.h"
#include "perf_defs.h"
#include "get_clock.h"
+#include "l2w.h"
return ;
}
-static struct pingpong_context *pp_init_ctx(unsigned size,int port, struct user_parameters *user_parm)
+static struct pingpong_context *pp_init_ctx(unsigned size,int port, struct user_parameters *user_parm, char* ib_devguid)
{
ib_api_status_t ib_status = IB_SUCCESS;
size_t guid_count;
ib_net64_t *ca_guid_array;
+ int guid_index = 0;
ctx = malloc(sizeof *ctx);
* Open only the first HCA
*/
/* Open the CA */
- ib_status = ib_open_ca(ctx->al ,ca_guid_array[0] ,NULL,
+ if (ib_devguid)
+ {
+ unsigned int i = 0;
+ guid_index = -1;
+ for (i = 0; i < guid_count; i++)
+ {
+ char curr_dev[20];
+ sprintf(curr_dev, "0x%016I64x", ntohll(ca_guid_array[i]));
+ if (!_stricmp(ib_devguid, curr_dev))
+ {
+ guid_index = i;
+ break;
+ }
+ }
+ if (guid_index == -1)
+ {
+ fprintf(stderr,"device with guid %s was not found\n", ib_devguid);
+ return NULL;
+ }
+ }
+
+ ib_status = ib_open_ca(ctx->al ,ca_guid_array[guid_index] ,NULL,
NULL, //ca_context
&ctx->ca);
printf("\n");
printf("Options:\n");
printf(" -p, --port=<port> listen on/connect to port <port> (default 18515)\n");
+ printf(" -d, --ib-dev=<dev> use IB device <device guid> (default first device found)\n");
printf(" -m, --mtu=<mtu> mtu size (default 256)\n");
printf(" -i, --ib-port=<port> use port <port> of IB device (default 1)\n");
printf(" -s, --size=<size> size of message to exchange (default 1)\n");
struct pingpong_dest *my_dest;
struct pingpong_dest *rem_dest;
struct user_parameters user_param;
- char *ib_devname = NULL;
+ char *ib_devguid = NULL;
int port = 18515;
int ib_port = 1;
unsigned tmp_size,size = 2;
int i = 0;
struct report_options report = {0};
+ SYSTEM_INFO si;
+ GetSystemInfo(&si);
/* init default values to user's parameters */
memset(&user_param, 0, sizeof(struct user_parameters));
return 0;
break;
case 'd':
- ib_devname = _strdup(optarg);
+ ib_devguid = _strdup(optarg);
break;
case 'i':
srand(GetCurrentProcessId() * GetTickCount());
- //TODO: get pagesize from sysinfo
- page_size = 4096;
-
- //TODO:get the device names
-
+ page_size = si.dwPageSize;
- ctx = pp_init_ctx(size,ib_port, &user_param);
+ ctx = pp_init_ctx(size,ib_port, &user_param, ib_devguid);
if (!ctx)
return 8;
..\perf_utils.c \\r
send_bw.c \r
\r
-INCLUDES=..;..\..\..\..\inc;..\..\..\..\inc\user\r
+INCLUDES=..;..\..\..\..\inc;..\..\..\..\inc\user;..\..\..\..\hw\mlx4\user\hca;..\..\..\..\inc\complib\r
\r
RCOPTIONS=/I..\..\win\include\r
\r
#include "get_clock.h"
#include "perf_defs.h"
+#include "l2w.h"
#define SIGNAL 1
#define MAX_INLINE 400
static struct pingpong_context *pp_init_ctx(unsigned size,int port,
- struct user_parameters *user_parm)
+ struct user_parameters *user_parm, char* ib_devguid)
{
struct pingpong_context *ctx;
ib_api_status_t ib_status = IB_SUCCESS;
size_t guid_count;
ib_net64_t *ca_guid_array;
+ int guid_index = 0;
* Open only the first HCA
*/
/* Open the CA */
- ib_status = ib_open_ca(ctx->al ,ca_guid_array[0] ,NULL,
+ if (ib_devguid)
+ {
+ unsigned int i = 0;
+ guid_index = -1;
+ for (i = 0; i < guid_count; i++)
+ {
+ char curr_dev[20];
+ sprintf(curr_dev, "0x%016I64x", ntohll(ca_guid_array[i]));
+ if (!_stricmp(ib_devguid, curr_dev))
+ {
+ guid_index = i;
+ break;
+ }
+ }
+ if (guid_index == -1)
+ {
+ fprintf(stderr,"device with guid %s was not found\n", ib_devguid);
+ return NULL;
+ }
+ }
+
+ ib_status = ib_open_ca(ctx->al ,ca_guid_array[guid_index] ,NULL,
NULL, //ca_context
&ctx->ca);
printf("\n");
printf("Options:\n");
printf(" -p, --port=<port> listen on/connect to port <port> (default 18515)\n");
+ printf(" -d, --ib-dev=<dev> use IB device <device guid> (default first device found)\n");
printf(" -i, --ib-port=<port> use port <port> of IB device (default 1)\n");
printf(" -c, --connection=<RC/UC> connection type RC/UC/UD (default RC)\n");
printf(" -m, --mtu=<mtu> mtu size (default 1024)\n");
struct pingpong_dest *my_dest;
struct pingpong_dest *rem_dest;
struct user_parameters user_param;
- char *ib_devname = NULL;
+ char *ib_devguid = NULL;
int port = 18515;
int ib_port = 1;
unsigned size = 65536;
WSADATA wsaData;
int iResult;
+ SYSTEM_INFO si;
+ GetSystemInfo(&si);
/* init default values to user's parameters */
memset(&user_param, 0, sizeof(struct user_parameters));
++user_param.use_event;
break;
case 'd':
- ib_devname = _strdup(optarg);
+ ib_devguid = _strdup(optarg);
break;
case 'c':
if (strcmp("UC",optarg)==0)
srand(GetCurrentProcessId() * GetTickCount());
- //TODO: get pagesize from sysinfo
- page_size = 4096;
+ page_size = si.dwPageSize;
- //TODO:get the device names
-
// init the context
- ctx = pp_init_ctx(size, ib_port, &user_param);
+ ctx = pp_init_ctx(size, ib_port, &user_param, ib_devguid);
if (!ctx)
return 1;
..\perf_utils.c \\r
send_lat.c \r
\r
-INCLUDES=..;..\..\..\..\inc;..\..\..\..\inc\user\r
+INCLUDES=..;..\..\..\..\inc;..\..\..\..\inc\user;..\..\..\..\hw\mlx4\user\hca;..\..\..\..\inc\complib\r
\r
RCOPTIONS=/I..\..\win\include\r
\r
#include "getopt.h"
#include "get_clock.h"
#include "perf_defs.h"
+#include "l2w.h"
}
-static struct pingpong_context *pp_init_ctx(unsigned int size,int port,struct user_parameters *user_parm) {
+static struct pingpong_context *pp_init_ctx(unsigned int size,int port,struct user_parameters *user_parm, char* ib_devguid) {
struct pingpong_context *ctx;
ib_api_status_t ib_status = IB_SUCCESS;
size_t guid_count;
ib_net64_t *ca_guid_array;
+ int guid_index = 0;
* Open only the first HCA
*/
/* Open the CA */
- ib_status = ib_open_ca(ctx->al ,ca_guid_array[0] ,NULL,
+ if (ib_devguid)
+ {
+ unsigned int i = 0;
+ guid_index = -1;
+ for (i = 0; i < guid_count; i++)
+ {
+ char curr_dev[20];
+ sprintf(curr_dev, "0x%016I64x", ntohll(ca_guid_array[i]));
+ if (!_stricmp(ib_devguid, curr_dev))
+ {
+ guid_index = i;
+ break;
+ }
+ }
+ if (guid_index == -1)
+ {
+ fprintf(stderr,"device with guid %s was not found\n", ib_devguid);
+ return NULL;
+ }
+ }
+
+
+ ib_status = ib_open_ca(ctx->al ,ca_guid_array[guid_index] ,NULL,
NULL, //ca_context
&ctx->ca);
printf("\n");
printf("Options:\n");
printf(" -p, --port=<port> listen on/connect to port <port> (default 18515)\n");
+ printf(" -d, --ib-dev=<dev> use IB device <device guid> (default first device found)\n");
printf(" -c, --connection=<RC/UC> connection type RC/UC (default RC)\n");
printf(" -m, --mtu=<mtu> mtu size (default 2048)\n");
printf(" -i, --ib-port=<port> use port <port> of IB device (default 1)\n");
struct pingpong_dest *my_dest;
struct pingpong_dest *rem_dest;
struct user_parameters user_param;
- char *ib_devname = NULL;
+ char *ib_devguid = NULL;
int port = 18515;
int ib_port = 1;
unsigned size = 2;
struct report_options report = {0};
+ SYSTEM_INFO si;
+ GetSystemInfo(&si);
+
/* init default values to user's parameters */
memset(&user_param, 0, sizeof(struct user_parameters));
user_param.mtu = 0;
return 0;
break;
case 'd':
- ib_devname = _strdup(optarg);
+ ib_devguid = _strdup(optarg);
break;
case 'i':
srand(GetCurrentProcessId() * GetTickCount());
- //TODO: get pagesize from sysinfo
- page_size = 4096;
-
- //TODO get the device names
+ page_size = si.dwPageSize;
- ctx = pp_init_ctx( size, ib_port,&user_param);
+ ctx = pp_init_ctx( size, ib_port,&user_param, ib_devguid);
if (!ctx)
return 8;
..\perf_utils.c \\r
write_bw.c \r
\r
-INCLUDES=..;..\..\..\..\inc;..\..\..\..\inc\user\r
+INCLUDES=..;..\..\..\..\inc;..\..\..\..\inc\user;..\..\..\..\hw\mlx4\user\hca;..\..\..\..\inc\complib\r
\r
RCOPTIONS=/I..\..\win\include\r
\r
* $Id$
*/
+
#include "getopt.h"
#include "perf_defs.h"
#include "get_clock.h"
-
-
+#include "l2w.h"
struct user_parameters {
const char *servername;
UNUSED_PARAM( cq_context);
return ;
}
-static struct pingpong_context *pp_init_ctx(unsigned size, int port, struct user_parameters *user_parm)
+static struct pingpong_context *pp_init_ctx(unsigned size, int port, struct user_parameters *user_parm, char* ib_devguid)
{
struct pingpong_context *ctx;
size_t guid_count;
ib_net64_t *ca_guid_array;
int counter;
+ int guid_index = 0;
ctx = malloc(sizeof *ctx);
if (!ctx){
* Open only the first HCA
*/
/* Open the CA */
- ib_status = ib_open_ca(ctx->al ,ca_guid_array[0] ,NULL,
+ if (ib_devguid)
+ {
+ unsigned int i = 0;
+ guid_index = -1;
+ for (i = 0; i < guid_count; i++)
+ {
+ char curr_dev[20];
+ sprintf(curr_dev, "0x%016I64x", ntohll(ca_guid_array[i]));
+ if (!_stricmp(ib_devguid, curr_dev))
+ {
+ guid_index = i;
+ break;
+ }
+ }
+ if (guid_index == -1)
+ {
+ fprintf(stderr,"device with guid %s was not found\n", ib_devguid);
+ return NULL;
+ }
+ }
+
+ ib_status = ib_open_ca(ctx->al ,ca_guid_array[guid_index] ,NULL,
NULL, //ca_context
&ctx->ca);
printf("\n");
printf("Options:\n");
printf(" -p, --port=<port> listen on/connect to port <port> (default 18515)\n");
+ printf(" -d, --ib-dev=<dev> use IB device <device guid> (default first device found)\n");
printf(" -i, --ib-port=<port> use port <port> of IB device (default 1)\n");
printf(" -c, --connection=<RC/UC> connection type RC/UC (default RC)\n");
printf(" -m, --mtu=<mtu> mtu size (default 1024)\n");
struct pingpong_dest *my_dest;
struct pingpong_dest *rem_dest;
struct user_parameters user_param;
- char *ib_devname = NULL;
+ char *ib_devguid = NULL;
int port = 18515;
int ib_port = 1;
unsigned size = 65536;
int duplex = 0;
+ SYSTEM_INFO si;
+ GetSystemInfo(&si);
+
/* init default values to user's parameters */
memset(&user_param, 0, sizeof(struct user_parameters));
user_param.mtu = 0;
break;
case 'd':
- ib_devname = _strdup(optarg);
+ ib_devguid = _strdup(optarg);
break;
case 'c':
if (strcmp("UC",optarg)==0)
}
srand(GetCurrentProcessId() * GetTickCount());
- //TODO: get pagesize from sysinfo
- page_size = 4096;
-
- //TODO get the device names
-
-
- ctx = pp_init_ctx(size, ib_port, &user_param);
+ page_size = si.dwPageSize;
+
+ ctx = pp_init_ctx(size, ib_port, &user_param, ib_devguid);
if (!ctx)
return 8;
sockfd = pp_open_port(ctx, user_param.servername, ib_port, port,&my_dest,&rem_dest,&user_param);
..\perf_utils.c \\r
write_lat.c \r
\r
-INCLUDES=..;..\..\..\..\inc;..\..\..\..\inc\user\r
+INCLUDES=..;..\..\..\..\inc;..\..\..\..\inc\user;..\..\..\..\hw\mlx4\user\hca;..\..\..\..\inc\complib\r
\r
RCOPTIONS=/I..\..\win\include\r
\r
#include "getopt.h"
#include "perf_defs.h"
#include "get_clock.h"
+#include "l2w.h"
}
-static struct pingpong_context *pp_init_ctx(unsigned size, int port, struct user_parameters *user_parm)
+static struct pingpong_context *pp_init_ctx(unsigned size, int port, struct user_parameters *user_parm, char* ib_devguid)
{
ib_api_status_t ib_status = IB_SUCCESS;
size_t guid_count;
ib_net64_t *ca_guid_array;
+ int guid_index = 0;
ctx = malloc(sizeof *ctx);
if (!ctx){
* Open only the first HCA
*/
/* Open the CA */
- ib_status = ib_open_ca(ctx->al ,ca_guid_array[0] ,NULL,
+ if (ib_devguid)
+ {
+ unsigned int i = 0;
+ guid_index = -1;
+ for (i = 0; i < guid_count; i++)
+ {
+ char curr_dev[20];
+ sprintf(curr_dev, "0x%016I64x", ntohll(ca_guid_array[i]));
+ if (!_stricmp(ib_devguid, curr_dev))
+ {
+ guid_index = i;
+ break;
+ }
+ }
+ if (guid_index == -1)
+ {
+ fprintf(stderr,"device with guid %s was not found\n", ib_devguid);
+ return NULL;
+ }
+ }
+
+ ib_status = ib_open_ca(ctx->al ,ca_guid_array[guid_index] ,NULL,
NULL, //ca_context
&ctx->ca);
printf("\n");
printf("Options:\n");
printf(" -p, --port=<port> listen on/connect to port <port> (default 18515)\n");
+ printf(" -d, --ib-dev=<dev> use IB device <device guid> (default first device found)\n");
printf(" -c, --connection=<RC/UC> connection type RC/UC (default RC)\n");
printf(" -m, --mtu=<mtu> mtu size (default 1024)\n");
printf(" -i, --ib-port=<port> use port <port> of IB device (default 1)\n");
struct pingpong_dest *my_dest;
struct pingpong_dest *rem_dest;
struct user_parameters user_param;
- char *ib_devname = NULL;
+ char *ib_devguid = NULL;
int port = 18515;
int ib_port = 1;
unsigned size = 2;
int iResult;
struct report_options report = {0};
+ SYSTEM_INFO si;
+ GetSystemInfo(&si);
/* init default values to user's parameters */
memset(&user_param, 0, sizeof(struct user_parameters));
return 0;
break;
case 'd':
- ib_devname = _strdup(optarg);
+ ib_devguid = _strdup(optarg);
break;
case 'i':
}
srand(GetCurrentProcessId() * GetTickCount());
- //TODO: get pagesize from sysinfo
- page_size = 4096;
+ page_size = si.dwPageSize;
- //TODO get the device names
-
-
- ctx = pp_init_ctx( size, ib_port,&user_param);
+ ctx = pp_init_ctx( size, ib_port,&user_param, ib_devguid);
if (!ctx)
return 8;
sockfd = pp_open_port(ctx, user_param.servername, ib_port, port,&my_dest,&rem_dest,&user_param);
printf("------------------------------------------------------------------\n");
free(tstamp);
return 0;
-}
+}
\ No newline at end of file