[ofw] FW: [patch] Updated ibv_XXXX_bw/ ibv_XXXX_lat tools - ibv_read_bw, ibv_read_lat
Irena Kruchkovsky
irena at mellanox.co.il
Wed Sep 1 08:30:25 PDT 2010
Attached are the differences between the new tools and the Linux version of them.
Ibv_read_bw
4c4
< * Copyright (c) 2009 HNR Consulting. All rights reserved.
---
> * Copyright (c) 2008-2009 Intel Corporation. All rights reserved.
6,10c6,7
< * This software is available to you under a choice of one of two
< * licenses. You may choose to be licensed under the terms of the GNU
< * General Public License (GPL) Version 2, available from the file
< * COPYING in the main directory of this source tree, or the
< * OpenIB.org BSD license below:
---
> * This software is available to you under the OpenIB.org BSD license
> * below:
27c24
< * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
---
> * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AWV
33,34d29
< *
< * $Id$
36,38d30
< #if HAVE_CONFIG_H
< # include <config.h>
< #endif /* HAVE_CONFIG_H */
42c34
< #include <unistd.h>
---
>
48a41,45
> #include <windows.h>
>
> #include <ws2tcpip.h>
> #include <winsock2.h>
>
51a49,50
> #include "l2w.h"
> #include "..\..\etc\user\getopt.c"
55c54
< static int sl = 0;
---
> static uint8_t sl = 0;
67c66
< void *buf;
---
> void* __ptr64 buf;
90c89
< my_dest->psn = lrand48() & 0xffffff;
---
> my_dest->psn = rand() & 0xffffff;
120c119
< if(params->sockfd < 0) {
---
> if (params->sockfd == INVALID_SOCKET) {
166c165
< free(ctx->buf);
---
> posix_memfree(ctx->buf);
188c187
< ctx->buf = memalign(page_size, BUFF_SIZE(size) * 2);
---
> posix_memalign(&(ctx->buf),page_size, BUFF_SIZE(size) * 2);
296c295
< attr.max_dest_rd_atomic = dest->out_reads;
---
> attr.max_dest_rd_atomic = (uint8_t)(dest->out_reads);
304c303
< attr.ah_attr.grh.sgid_index = user_parm->gid_index;
---
> attr.ah_attr.grh.sgid_index = (uint8_t)user_parm->gid_index;
326c325
< attr.max_rd_atomic = my_out_reads;
---
> attr.max_rd_atomic = (uint8_t)my_out_reads;
376c375
< int i, j;
---
> unsigned int i, j;
395c394
< cycles_to_units = get_cpu_mhz(no_cpu_freq_fail) * 1000000;
---
> cycles_to_units = get_cpu_mhz();
399,400c398,401
< printf(REPORT_FMT,size,iters,tsize * cycles_to_units / opt_delta / 0x100000,
< tsize * iters * cycles_to_units /(tcompleted[iters - 1] - tposted[0]) / 0x100000);
---
>
> printf(REPORT_FMT,size,iters, tsize * cycles_to_units / opt_delta / 0x100000,
> (uint64_t)tsize*iters*cycles_to_units/(tcompleted[iters - 1] - tposted[0]) / 0x100000);
>
432c433
< my_addr = (uint64_t)ctx->buf;
---
> my_addr = (uint64_t)(ctx->buf);
487c488
< int main(int argc, char *argv[])
---
> int __cdecl main(int argc, char *argv[])
495c496
< long long size = 65536;
---
> unsigned size = 65536;
500a502,504
>
> SYSTEM_INFO si;
> GetSystemInfo(&si);
523,538c527,542
< { .name = "port", .has_arg = 1, .val = 'p' },
< { .name = "ib-dev", .has_arg = 1, .val = 'd' },
< { .name = "ib-port", .has_arg = 1, .val = 'i' },
< { .name = "mtu", .has_arg = 1, .val = 'm' },
< { .name = "outs", .has_arg = 1, .val = 'o' },
< { .name = "size", .has_arg = 1, .val = 's' },
< { .name = "iters", .has_arg = 1, .val = 'n' },
< { .name = "tx-depth", .has_arg = 1, .val = 't' },
< { .name = "qp-timeout", .has_arg = 1, .val = 'u' },
< { .name = "sl", .has_arg = 1, .val = 'S' },
< { .name = "gid-index", .has_arg = 1, .val = 'x' },
< { .name = "all", .has_arg = 0, .val = 'a' },
< { .name = "bidirectional", .has_arg = 0, .val = 'b' },
< { .name = "version", .has_arg = 0, .val = 'V' },
< { .name = "events", .has_arg = 0, .val = 'e' },
< { .name = "CPU-freq", .has_arg = 0, .val = 'F' },
---
> { "port", 1, NULL, 'p' },
> { "ib-dev", 1, NULL, 'd' },
> { "ib-port", 1, NULL,'i' },
> { "mtu", 1, NULL,'m' },
> { "outs", 1, NULL,'o' },
> { "size", 1, NULL,'s' },
> { "iters", 1, NULL,'n' },
> { "tx-depth", 1, NULL,'t' },
> { "qp-timeout", 1, NULL,'u' },
> { "sl", 1, NULL,'S' },
> { "gid-index", 1, NULL,'x' },
> { "all", 0, NULL, 'a' },
> { "bidirectional", 0, NULL, 'b' },
> { "version", 0, NULL, 'V' },
> { "events", 0, NULL, 'e' },
> { "CPU-freq", 0, NULL, 'F' },
556c560
< ib_devname = strdupa(optarg);
---
> ib_devname = _strdup(optarg);
575c579
< user_param.ib_port = strtol(optarg, NULL, 0);
---
> user_param.ib_port = (uint8_t)(strtol(optarg, NULL, 0));
583c587
< size = strtoll(optarg, NULL, 0);
---
> size = strtol(optarg, NULL, 0);
613c617
< user_param.qp_timeout = strtol(optarg, NULL, 0);
---
> user_param.qp_timeout = (uint8_t)(strtol(optarg, NULL, 0));
617c621
< sl = strtol(optarg, NULL, 0);
---
> sl = (uint8_t)(strtol(optarg, NULL, 0));
636c640
< servername = strdupa(argv[optind]);
---
> servername = _strdup(argv[optind]);
658,660c662
< srand48(getpid() * time(NULL));
<
< page_size = sysconf(_SC_PAGESIZE);
---
> page_size = si.dwPageSize;
Ibv_read_lat
3,5c3,4
< * Copyright (c) 2005 Mellanox Technologies Ltd. All rights reserved.
< * Copyright (c) 2005 Hewlett Packard, Inc (Grant Grundler)
< * Copyright (c) 2009 HNR Consulting. All rights reserved.
---
> * Copyright (c) 2006 Mellanox Technologies Ltd. All rights reserved.
> * Copyright (c) 2008-2009 Intel Corporation. All rights reserved.
7,11c6,7
< * This software is available to you under a choice of one of two
< * licenses. You may choose to be licensed under the terms of the GNU
< * General Public License (GPL) Version 2, available from the file
< * COPYING in the main directory of this source tree, or the
< * OpenIB.org BSD license below:
---
> * This software is available to you under the OpenIB.org BSD license
> * below:
28c24
< * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
---
> * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AWV
34,35d29
< *
< * $Id$
38,41d31
< #if HAVE_CONFIG_H
< #include <config.h>
< #endif /* HAVE_CONFIG_H */
<
44d33
< #include <unistd.h>
49a39,42
> #include <windows.h>
>
> #include <ws2tcpip.h>
> #include <winsock2.h>
51c44,46
< #include "get_clock.h"
---
>
> #include "..\..\tools\perftests\user\get_clock.h"
> #include "..\..\etc\user\getopt.c"
52a48
> #include "l2w.h"
57c53
< static int sl = 0;
---
> static uint8_t sl = 0;
91c87
< int port = user_parm->ib_port;
---
> uint8_t port = user_parm->ib_port;
101c97
< my_dest->psn = lrand48() & 0xffffff;
---
> my_dest->psn = rand() & 0xffffff;
132c128
< if(params->sockfd < 0) {
---
> if (params->sockfd == INVALID_SOCKET) {
172c168
< ctx->buf = memalign(page_size, size * 2);
---
> posix_memalign(&(ctx->buf),page_size, size * 2);
259,264c255,259
< struct ibv_qp_attr attr = {
< .qp_state = IBV_QPS_INIT,
< .pkey_index = 0,
< .port_num = user_parm->ib_port,
< .qp_access_flags = IBV_ACCESS_REMOTE_READ
< };
---
> struct ibv_qp_attr attr;
> attr.qp_state = IBV_QPS_INIT;
> attr.pkey_index = 0;
> attr.port_num = user_parm->ib_port;
> attr.qp_access_flags = IBV_ACCESS_REMOTE_READ;
314c309
< attr.max_dest_rd_atomic = dest->out_reads;
---
> attr.max_dest_rd_atomic = (uint8_t)(dest->out_reads);
322c317
< attr.ah_attr.grh.sgid_index = user_parm->gid_index;
---
> attr.ah_attr.grh.sgid_index = (uint8_t)(user_parm->gid_index);
343c338
< attr.max_rd_atomic = my_reads;
---
> attr.max_rd_atomic = (uint8_t)my_reads;
345c340
< attr.max_rd_atomic = my_reads;
---
> attr.max_rd_atomic = (uint8_t)my_reads;
388,411d382
< /*
< * When there is an
< * odd number of samples, the median is the middle number.
< * even number of samples, the median is the mean of the
< * two middle numbers.
< *
< */
< static inline cycles_t get_median(int n, cycles_t delta[])
< {
< if ((n - 1) % 2)
< return (delta[n / 2] + delta[n / 2 - 1]) / 2;
< else
< return delta[n / 2];
< }
<
< static int cycles_compare(const void * aptr, const void * bptr)
< {
< const cycles_t *a = aptr;
< const cycles_t *b = bptr;
< if (*a < *b) return -1;
< if (*a > *b) return 1;
< return 0;
<
< }
435c406
< cycles_to_units = get_cpu_mhz(no_cpu_freq_fail);
---
> cycles_to_units = get_cpu_mhz()/1000000;
543c514
< int main(int argc, char *argv[]) {
---
> int __cdecl main(int argc, char *argv[]) {
549c520
< struct report_options report = {};
---
> struct report_options report;
557a529,531
>
> SYSTEM_INFO si;
> GetSystemInfo(&si);
568a543,547
>
> report.cycles = 0;
> report.histogram = 0;
> report.unsorted = 0;
>
574,591c553,570
< { .name = "port", .has_arg = 1, .val = 'p' },
< { .name = "mtu", .has_arg = 1, .val = 'm' },
< { .name = "ib-dev", .has_arg = 1, .val = 'd' },
< { .name = "ib-port", .has_arg = 1, .val = 'i' },
< { .name = "size", .has_arg = 1, .val = 's' },
< { .name = "iters", .has_arg = 1, .val = 'n' },
< { .name = "outs", .has_arg = 1, .val = 'o' },
< { .name = "tx-depth", .has_arg = 1, .val = 't' },
< { .name = "qp-timeout", .has_arg = 1, .val = 'u' },
< { .name = "sl", .has_arg = 1, .val = 'S' },
< { .name = "gid-index", .has_arg = 1, .val = 'x' },
< { .name = "all", .has_arg = 0, .val = 'a' },
< { .name = "report-cycles", .has_arg = 0, .val = 'C' },
< { .name = "report-histogram",.has_arg = 0, .val = 'H' },
< { .name = "report-unsorted",.has_arg = 0, .val = 'U' },
< { .name = "version", .has_arg = 0, .val = 'V' },
< { .name = "events", .has_arg = 0, .val = 'e' },
< { .name = "CPU-freq", .has_arg = 0, .val = 'F' },
---
> { "port", 1, NULL, 'p' },
> { "mtu", 1, NULL, 'm' },
> { "ib-dev", 1, NULL, 'd' },
> { "ib-port", 1, NULL, 'i' },
> { "size", 1, NULL, 's' },
> { "iters", 1, NULL, 'n' },
> { "outs", 1, NULL, 'o' },
> { "tx-depth", 1, NULL, 't' },
> { "qp-timeout", 1, NULL, 'u' },
> { "sl", 1, NULL, 'S' },
> { "gid-index", 1, NULL, 'x' },
> { "all", 0, NULL, 'a' },
> { "report-cycles", 0, NULL, 'C' },
> { "report-histogram", 0, NULL, 'H' },
> { "report-unsorted", 0, NULL, 'U' },
> { "version", 0, NULL, 'V' },
> { "events", 0, NULL, 'e' },
> { "CPU-freq", 0, NULL, 'F' },
625c604
< ib_devname = strdupa(optarg);
---
> ib_devname = _strdup(optarg);
629c608
< user_param.ib_port = strtol(optarg, NULL, 0);
---
> user_param.ib_port = (uint8_t)(strtol(optarg, NULL, 0));
676c655
< user_param.qp_timeout = strtol(optarg, NULL, 0);
---
> user_param.qp_timeout = (uint8_t)(strtol(optarg, NULL, 0));
680c659
< sl = strtol(optarg, NULL, 0);
---
> sl = (uint8_t)(strtol(optarg, NULL, 0));
699c678
< servername = strdupa(argv[optind]);
---
> servername = _strdup(argv[optind]);
726,727c705,706
< srand48(getpid() * time(NULL));
< page_size = sysconf(_SC_PAGESIZE);
---
>
> page_size = si.dwPageSize;
From: ofw-bounces at lists.openfabrics.org [mailto:ofw-bounces at lists.openfabrics.org] On Behalf Of Irena Kruchkovsky
Sent: Tuesday, August 31, 2010 3:38 PM
To: ofw at lists.openfabrics.org
Subject: [ofw] [patch] Updated ibv_XXXX_bw/ ibv_XXXX_lat tools - ibv_read_bw, ibv_read_lat
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openfabrics.org/pipermail/ofw/attachments/20100901/a9cb7306/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ibv_read.patch
Type: application/octet-stream
Size: 92152 bytes
Desc: ibv_read.patch
URL: <http://lists.openfabrics.org/pipermail/ofw/attachments/20100901/a9cb7306/attachment.obj>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: ATT00001..txt
URL: <http://lists.openfabrics.org/pipermail/ofw/attachments/20100901/a9cb7306/attachment.txt>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ibv_read_bw_from_linux.diff
Type: application/octet-stream
Size: 5109 bytes
Desc: ibv_read_bw_from_linux.diff
URL: <http://lists.openfabrics.org/pipermail/ofw/attachments/20100901/a9cb7306/attachment-0001.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ibv_read_lat_from_linux.diff
Type: application/octet-stream
Size: 6287 bytes
Desc: ibv_read_lat_from_linux.diff
URL: <http://lists.openfabrics.org/pipermail/ofw/attachments/20100901/a9cb7306/attachment-0002.obj>
More information about the ofw
mailing list