[ofw] FW: [patch] Updated ibv_XXXX_bw/ ibv_XXXX_lat tools - ibv_write_bw, ibv_write_lat

Irena Kruchkovsky irena at mellanox.co.il
Wed Sep 1 08:32:48 PDT 2010


Attached are the differences between the new tools and the Linux version of them.

Ibv_write_bw

3,4c3,4
<  * Copyright (c) 2005 Mellanox Technologies Ltd.  All rights reserved.
<  * 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.
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$
37,40d31
< #if HAVE_CONFIG_H
< #  include <config.h>
< #endif /* HAVE_CONFIG_H */
<
43d33
< #include <unistd.h>
49a40,43
> #include <windows.h>
>
> #include <ws2tcpip.h>
> #include <winsock2.h>
52a47,49
> #include "l2w.h"
> #include "..\..\etc\user\getopt.c"
>
57c54
< static int sl = 0;
---
> static uint8_t sl = 0;
95c92
<                             my_dest[i].psn   = lrand48() & 0xffffff;
---
>                             my_dest[i].psn   = rand() & 0xffffff;
132c129
<             if(params->sockfd < 0) {
---
>             if(params->sockfd == INVALID_SOCKET) {
153c150
<
---
>
158c155
<
---
>
163c160
<
---
>
174c171
<             free(ctx->buf);
---
>             posix_memfree(ctx->buf);
206c203
<             ctx->buf = memalign(page_size, BUFF_SIZE(size) * 2 * user_parm->num_of_qps);
---
>             posix_memalign(&(ctx->buf),page_size, BUFF_SIZE(size) * 2 * user_parm->num_of_qps);
319c316
<                             attr.ah_attr.grh.sgid_index = user_parm->gid_index;
---
>                             attr.ah_attr.grh.sgid_index = (uint8_t)user_parm->gid_index;
440,441c437
<             cycles_to_units = get_cpu_mhz(no_cpu_freq_fail) * 1000000;
<
---
>             cycles_to_units = get_cpu_mhz();
445c441,442
<                    tsize*iters*user_param->num_of_qps*cycles_to_units/(tcompleted[(iters*user_param->num_of_qps) - 1] - tposted[0]) / 0x100000);
---
>              (uint64_t)tsize*iters*user_param->num_of_qps*cycles_to_units/(tcompleted[(iters*user_param->num_of_qps) - 1] - tposted[0]) / 0x100000);
>
582c579
< int main(int argc, char *argv[])
---
> int __cdecl main(int argc, char *argv[])
590c587
<             long long                   size = 65536;
---
>             unsigned                    size = 65536;
601a599,601
>             SYSTEM_INFO si;
>             GetSystemInfo(&si);
>
619c619
<
---
>
621,639c621,639
<                                             { .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 = "qp",             .has_arg = 1, .val = 'q' },
<                                             { .name = "post",           .has_arg = 1, .val = 'g' },
<                                             { .name = "connection",     .has_arg = 1, .val = 'c' },
<                                             { .name = "size",           .has_arg = 1, .val = 's' },
<                                             { .name = "iters",          .has_arg = 1, .val = 'n' },
<                                             { .name = "tx-depth",       .has_arg = 1, .val = 't' },
<                                             { .name = "inline_size",    .has_arg = 1, .val = 'I' },
<                                             { .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 = "noPeak",         .has_arg = 0, .val = 'N' },
<                                             { .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' },
>                                             {  "qp",                                                  1, NULL, 'q' },
>                                             {  "post",                                                              1, NULL, 'g' },
>                                             {  "connection",                                1, NULL, 'c' },
>                                             {  "size",                                                               1, NULL, 's' },
>                                             {  "iters",                                                              1, NULL, 'n' },
>                                             {  "tx-depth",                                     1, NULL, 't' },
>                                             {  "inline_size",                  1, NULL, 'I' },
>                                             {  "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' },
>                                             {  "noPeak",                            0, NULL, 'N' },
>                                             {  "CPU-freq",                                    0, NULL, 'F' },
643c643
<                             c = getopt_long(argc, argv, "p:d:i:m:q:g:c:s:n:t:I:u:S:x:baVNF", long_options, NULL);
---
>                             c = getopt_long(argc, argv, "p:d:i:m:q:g:c:s:n:t:I:u:S:x:baVNF", long_options, NULL);
645a646,651
>
>                             if (c == EINVAL)
>                             {
>                                             usage(argv[0]);
>                                             return 7;
>                             }
657c663
<                                             ib_devname = strdupa(optarg);
---
>                                             ib_devname = _strdup(optarg);
681c687
<                                             user_param.ib_port = strtol(optarg, NULL, 0);
---
>                                             user_param.ib_port = (uint8_t)(strtol(optarg, NULL, 0));
689c695
<                                             size = strtoll(optarg, NULL, 0);
---
>                                             size = strtol(optarg, NULL, 0);
732c738
<                                             user_param.qp_timeout = strtol(optarg, NULL, 0);
---
>                                             user_param.qp_timeout = (uint8_t)(strtol(optarg, NULL, 0));
736c742
<                                             sl = strtol(optarg, NULL, 0);
---
>                                             sl = (uint8_t)(strtol(optarg, NULL, 0));
741c747
<                                             user_param.gid_index = strtol(optarg, NULL, 0);
---
>                                             user_param.gid_index = (uint8_t)(strtol(optarg, NULL, 0));
755c761
<                             servername = strdupa(argv[optind]);
---
>                             servername = _strdup(argv[optind]);
791d796
<             srand48(getpid() * time(NULL));
793c798
<             page_size = sysconf(_SC_PAGESIZE);
---
>             page_size = si.dwPageSize;

Ibv_write_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 */
<
44c34,38
< #include <unistd.h>
---
> #include <windows.h>
>
> #include <ws2tcpip.h>
> #include <winsock2.h>
>
49a44
> #include <errno.h>
51c46,47
< #include "get_clock.h"
---
> #include "..\..\tools\perftests\user\get_clock.h"
> #include "..\..\etc\user\getopt.c"
52a49
> #include "l2w.h"
58c55
< static int sl = 0;
---
> static uint8_t sl = 0;
91c88
<             int port  = user_parm->ib_port;
---
>             uint8_t port  = user_parm->ib_port;
100c97
<             my_dest->psn   = lrand48() & 0xffffff;
---
>             my_dest->psn   = rand() & 0xffffff;
131c128
<             if(params->sockfd < 0) {
---
>             if(params->sockfd == INVALID_SOCKET) {
174c171
<             ctx->buf = memalign(page_size, size * 2);
---
>             posix_memalign(&(ctx->buf),page_size,size * 2);
254,259c251,256
<                             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_WRITE
<                             };
---
>                             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_WRITE;
>
322c319
<                             attr.ah_attr.grh.sgid_index = user_parm->gid_index;
---
>                             attr.ah_attr.grh.sgid_index = (uint8_t)user_parm->gid_index;
410,434d406
< /*
<  * 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;
<
< }
<
457c429
<                             cycles_to_units = get_cpu_mhz(no_cpu_freq_fail);
---
>                             cycles_to_units = get_cpu_mhz()/1000000;
571c543
< int main(int argc, char *argv[])
---
> int __cdecl main(int argc, char *argv[])
576c548
<             struct report_options    report = {};
---
>             struct report_options    report;
585a558,560
>             SYSTEM_INFO si;
>             GetSystemInfo(&si);
>
596a572,576
>
>             report.cycles = 0;
>             report.histogram = 0;
>             report.unsorted = 0;
>
602,619c582,599
<                                             { .name = "port",           .has_arg = 1, .val = 'p' },
<                                             { .name = "connection",     .has_arg = 1, .val = 'c' },
<                                             { .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 = "tx-depth",       .has_arg = 1, .val = 't' },
<                                             { .name = "inline_size",    .has_arg = 1, .val = 'I' },
<                                             { .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 = "CPU-freq",       .has_arg = 0, .val = 'F' },
---
>                                             {  "port",                                                              1, NULL, 'p' },
>                                             {  "connection",                                1, NULL, 'c' },
>                                             {  "mtu",                                                               1, NULL, 'm' },
>                                             {  "ib-dev",                                          1, NULL, 'd' },
>                                             {  "ib-port",                                         1, NULL, 'i' },
>                                             {  "size",                                                               1, NULL, 's' },
>                                             {  "iters",                                                              1, NULL, 'n' },
>                                             {  "tx-depth",                                     1, NULL, 't' },
>                                             {  "inline_size",                  1, NULL, 'I' },
>                                             {  "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' },
>                                             {  "CPU-freq",                                    0, NULL, 'F' },
626a607,612
>                             if (c == EINVAL)
>                             {
>                                             usage(argv[0]);
>                                             return 7;
>                             }
>
652c638
<                                             ib_devname = strdupa(optarg);
---
>                                             ib_devname = _strdup(optarg);
656c642
<                                             user_param.ib_port = strtol(optarg, NULL, 0);
---
>                                             user_param.ib_port = (uint8_t)(strtol(optarg, NULL, 0));
710c696
<                                             user_param.qp_timeout = strtol(optarg, NULL, 0);
---
>                                             user_param.qp_timeout =  (uint8_t)(strtol(optarg, NULL, 0));
713c699
<                                             sl = strtol(optarg, NULL, 0);
---
>                                             sl =  (uint8_t)(strtol(optarg, NULL, 0));
732c718
<                             servername = strdupa(argv[optind]);
---
>                             servername = _strdup(argv[optind]);
760,761c746,747
<             srand48(getpid() * time(NULL));
<             page_size = sysconf(_SC_PAGESIZE);
---
>
>             page_size = si.dwPageSize;
820c806
<             close(user_param.sockfd);
---
>             closesocket(user_param.sockfd);



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:39 PM
To: ofw at lists.openfabrics.org
Subject: [ofw] [patch] Updated ibv_XXXX_bw/ ibv_XXXX_lat tools - ibv_write_bw, ibv_write_lat


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openfabrics.org/pipermail/ofw/attachments/20100901/fa51726e/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ibv_write.patch
Type: application/octet-stream
Size: 103805 bytes
Desc: ibv_write.patch
URL: <http://lists.openfabrics.org/pipermail/ofw/attachments/20100901/fa51726e/attachment.obj>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: ATT00001..txt
URL: <http://lists.openfabrics.org/pipermail/ofw/attachments/20100901/fa51726e/attachment.txt>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ibv_write_bw_from_linux.diff
Type: application/octet-stream
Size: 5662 bytes
Desc: ibv_write_bw_from_linux.diff
URL: <http://lists.openfabrics.org/pipermail/ofw/attachments/20100901/fa51726e/attachment-0001.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ibv_write_lat_from_linux.diff
Type: application/octet-stream
Size: 6085 bytes
Desc: ibv_write_lat_from_linux.diff
URL: <http://lists.openfabrics.org/pipermail/ofw/attachments/20100901/fa51726e/attachment-0002.obj>


More information about the ofw mailing list