<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=us-ascii" http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 8.00.6001.18702"></HEAD>
<BODY>
<DIV><FONT size=2 face=Arial><SPAN class=931162416-02122009>This patch contains 
the tests that I have been using to check that RDMAoEth 
works.</SPAN></FONT></DIV>
<DIV><FONT size=2 face=Arial><SPAN class=931162416-02122009>It includes two 
tests that have been changes to support RDMAoEth : <FONT 
color=#0000ff>ibv_rc_pingpong.exe  and 
ib_send_Bw.</FONT></SPAN></FONT></DIV>
<DIV><FONT color=#0000ff size=2 face=Arial><SPAN 
class=931162416-02122009></SPAN></FONT> </DIV>
<DIV><FONT color=#0000ff size=2 face=Arial><SPAN class=931162416-02122009>Both 
tests have been using GRH.</SPAN></FONT></DIV>
<DIV><FONT color=#0000ff size=2 face=Arial><SPAN 
class=931162416-02122009></SPAN></FONT> </DIV>
<DIV><FONT color=#0000ff size=2 face=Arial><SPAN class=931162416-02122009>A 
typical command line looks like:</SPAN></FONT></DIV>
<DIV><FONT color=#0000ff size=2 face=Arial><SPAN 
class=931162416-02122009></SPAN></FONT> </DIV>
<DIV><FONT color=#0000ff size=2 face=Arial><SPAN class=931162416-02122009>
<DIV><FONT face=Arial><FONT size=2><FONT color=#0000ff><SPAN 
class=734452611-15112009>running the 
rc_pingpong: </SPAN></FONT></FONT></FONT></DIV>
<DIV><FONT face=Arial><FONT size=2><FONT color=#0000ff><SPAN 
class=734452611-15112009>    sw328: ibv_rc_pingpong.exe -g 
fe800000000000000202c9fffe039cf0 -n 100000 -s 1     
</SPAN></FONT></FONT></FONT></DIV>
<DIV><FONT face=Arial><FONT size=2><FONT color=#0000ff><SPAN 
class=734452611-15112009>    sw327: ibv_rc_pingpong.exe -g 
fe800000000000000202c9fffe039d18 -h 10.4.12.128 -n 100000 -s 
1</SPAN></FONT></FONT></FONT></DIV>
<DIV><SPAN class=734452611-15112009><FONT color=#0000ff size=2 
face=Arial></FONT></SPAN> </DIV>
<DIV><SPAN class=734452611-15112009><FONT color=#0000ff size=2 
face=Arial></FONT></SPAN> </DIV>
<DIV><SPAN class=734452611-15112009><FONT color=#0000ff size=2 face=Arial>sw327: 
ib_send_Bw -a -g fe800000000000000202c9fffe039d18 
10.4.12.128</FONT></SPAN></DIV>
<DIV><SPAN class=734452611-15112009><FONT color=#0000ff size=2 face=Arial>sw328: 
ib_send_bw -g  fe800000000000000202c9fffe039cf0  
-a</FONT></SPAN></DIV></SPAN></FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial><SPAN class=931162416-02122009>Please note that the 
GRH is being created from the mac addresses which in my case 
is:</SPAN></FONT></DIV>
<DIV><FONT size=2 face=Arial><SPAN class=931162416-02122009>sw327 - 
00-02-C9-03-9C-F0</SPAN></FONT></DIV>
<DIV><FONT size=2 face=Arial><SPAN class=931162416-02122009>sw328 - 
00-02-C9-03-9D-18</SPAN></FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial><SPAN 
class=931162416-02122009>Thanks</SPAN></FONT></DIV>
<DIV><FONT size=2 face=Arial><SPAN 
class=931162416-02122009>Tzachi</SPAN></FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial>Index: 
core/al/kernel/al_cm_cep.c<BR>===================================================================<BR>--- 
core/al/kernel/al_cm_cep.c (revision 2617)<BR>+++ 
core/al/kernel/al_cm_cep.c (working copy)<BR>@@ -4390,6 +4390,10 
@@<BR> <BR>  p_av->attr.grh_valid = !ib_gid_is_link_local( 
&p_path->dgid );<BR> <BR>+ // make this same as Linux code: 
p_path->hop_flow_raw >= 2 means grh 
present.<BR>+ if(cl_hton32(p_path->hop_flow_raw) >= 
2)<BR>+  p_av->attr.grh_valid = 1;  
<BR>+<BR>  p_av->attr.static_rate = ib_path_rec_rate( p_path 
);<BR>  p_av->attr.path_bits = (uint8_t)(p_path->slid - 
p_port_cep->base_lid);<BR> <BR>Index: 
tools/perftests/user/perf_defs.h<BR>===================================================================<BR>--- 
tools/perftests/user/perf_defs.h (revision 2617)<BR>+++ 
tools/perftests/user/perf_defs.h (working copy)<BR>@@ -154,4 +154,6 
@@<BR> pp_server_exch_dest(SOCKET sockfd, const struct pingpong_dest 
*my_dest,<BR>   struct pingpong_dest* rem_dest);<BR> <BR>+void 
str2gid(char *grh, ib_gid_t *gid);<BR>+<BR> #endif<BR>Index: 
tools/perftests/user/perf_utils.c<BR>===================================================================<BR>--- 
tools/perftests/user/perf_utils.c (revision 2617)<BR>+++ 
tools/perftests/user/perf_utils.c (working copy)<BR>@@ -238,9 +238,29 
@@<BR>  return pp_write_keys(sockfd, 
my_dest);<BR> }<BR> <BR>+void str2gid(char *grh, ib_gid_t 
*gid)<BR>+{<BR>+ char tmp;<BR> <BR>+ tmp = 
grh[8];<BR>+ grh[8] = 0;<BR>+ (*((ULONG*)&gid->raw[0])) = 
htonl(strtoul(grh, NULL, 16));<BR>+ grh[8] = tmp;<BR> <BR>+ tmp = 
grh[16];<BR>+ grh[16] = 0;<BR>+ (*((ULONG*)&gid->raw[4])) = 
htonl(strtoul(grh + 8, NULL, 16));<BR>+ grh[16] = 
tmp;<BR> <BR>+ tmp = grh[24];<BR>+ grh[24] = 
0;<BR>+ (*((ULONG*)&gid->raw[8])) = htonl(strtoul(grh + 16, NULL, 
16));<BR>+ grh[24] = 
tmp;<BR> <BR>+ (*((ULONG*)&gid->raw[12])) = htonl(strtoul(grh + 
24, NULL, 16));<BR>+}<BR> <BR> <BR>+<BR>+<BR>+<BR>Index: 
tools/perftests/user/send_bw/send_bw.c<BR>===================================================================<BR>--- 
tools/perftests/user/send_bw/send_bw.c (revision 2617)<BR>+++ 
tools/perftests/user/send_bw/send_bw.c (working copy)<BR>@@ -339,6 +339,8 
@@<BR> <BR> }<BR> <BR>+char          
 *grh = NULL;<BR>+<BR> static int pp_connect_ctx(struct 
pingpong_context *ctx, int port, int my_psn,<BR>      
struct pingpong_dest *dest, struct user_parameters *user_parm,int  
index)<BR> {<BR>@@ -379,6 +381,15 
@@<BR>      IB_MOD_QP_RESP_RES 
|<BR>      IB_MOD_QP_PRIMARY_AV;<BR> <BR>+ if(grh)<BR>+ {<BR>+  ib_gid_t 
dgid;<BR>+  str2gid(grh, 
&dgid);<BR>+  attr.state.rtr.primary_av.grh_valid = 
1;<BR>+  attr.state.rtr.primary_av.grh.hop_limit = 
1;<BR>+  attr.state.rtr.primary_av.grh.dest_gid = 
dgid;<BR>+  attr.state.rtr.primary_av.grh.src_gid = 
ctx->ca_attr->p_port_attr->p_gid_table[0];<BR>+ }<BR> <BR>  ib_status 
= ib_modify_qp(ctx->qp[0], &attr);<BR>  if(ib_status != 
IB_SUCCESS){<BR>@@ -505,7 +516,7 @@<BR>   my_dest[i].psn = 
cl_hton32(rand() & 0xffffff);<BR>   if (!my_dest[i].lid) 
{<BR>    fprintf(stderr, "Local lid 0x0 detected. Is an SM 
running?\n");<BR>-   return 1;<BR>+//??   return 
1;<BR>   }<BR>   my_dest[i].qpn = 
ctx->qp_attr[i].num;<BR>   /* TBD this should be changed inot 
VA and different key to each qp */<BR>@@ -977,10 +988,11 
@@<BR>    { "bidirectional", 0, NULL, 'b' 
},<BR>    { "version",  0, NULL, 'V' 
},<BR>    { "events",  0, NULL, 'e' 
},<BR>+   { "grh",  1, NULL, 'g' 
},<BR>    { 0 
}<BR>   };<BR> <BR>-  c = getopt_long(argc, argv, 
"p:d:i:m:c:s:n:t:ebaV", long_options, NULL);<BR>+  c = 
getopt_long(argc, argv, "p:d:i:m:c:s:n:t:g:ebaV", long_options, 
NULL);<BR>   if (c == 
-1)<BR>    break;<BR> <BR>@@ -1049,6 +1061,11 
@@<BR>   case 'b':<BR>    user_param.duplex = 
1;<BR>    break;<BR>+<BR>+  case 
'g':<BR>+   grh = 
_strdup(optarg);<BR>+   break;<BR>+<BR>   case 
'h':<BR>   default:<BR>    usage(argv[0]);<BR>Index: 
ulp/libibverbs/examples/pingpong.c<BR>===================================================================<BR>--- 
ulp/libibverbs/examples/pingpong.c (revision 2617)<BR>+++ 
ulp/libibverbs/examples/pingpong.c (working copy)<BR>@@ -50,3 +50,25 
@@<BR> <BR>  return attr.lid;<BR> }<BR>+<BR>+void 
str2gid(char *grh, union ibv_gid *gid)<BR>+{<BR>+ char 
tmp;<BR>+<BR>+ tmp = grh[8];<BR>+ grh[8] = 
0;<BR>+ (*((ULONG*)&gid->raw[0])) = htonl(strtoul(grh, NULL, 
16));<BR>+ grh[8] = tmp;<BR>+<BR>+ tmp = grh[16];<BR>+ grh[16] = 
0;<BR>+ (*((ULONG*)&gid->raw[4])) = htonl(strtoul(grh + 8, NULL, 
16));<BR>+ grh[16] = tmp;<BR>+<BR>+ tmp = grh[24];<BR>+ grh[24] = 
0;<BR>+ (*((ULONG*)&gid->raw[8])) = htonl(strtoul(grh + 16, NULL, 
16));<BR>+ grh[24] = tmp;<BR>+<BR>+ (*((ULONG*)&gid->raw[12])) 
= htonl(strtoul(grh + 24, NULL, 16));<BR>+}<BR>Index: 
ulp/libibverbs/examples/pingpong.h<BR>===================================================================<BR>--- 
ulp/libibverbs/examples/pingpong.h (revision 2617)<BR>+++ 
ulp/libibverbs/examples/pingpong.h (working copy)<BR>@@ -34,5 +34,6 
@@<BR> <BR> enum ibv_mtu pp_mtu_to_enum(int mtu);<BR> uint16_t 
pp_get_local_lid(struct ibv_context *context, int port);<BR>+void str2gid(char 
*grh, union ibv_gid *gid);<BR> <BR> #endif /* IBV_PINGPONG_H 
*/<BR>Index: 
ulp/libibverbs/examples/rc_pingpong/rc_pingpong.c<BR>===================================================================<BR>--- 
ulp/libibverbs/examples/rc_pingpong/rc_pingpong.c (revision 2617)<BR>+++ 
ulp/libibverbs/examples/rc_pingpong/rc_pingpong.c (working copy)<BR>@@ 
-44,6 +44,8 @@<BR>  PINGPONG_SEND_WRID = 
2,<BR> };<BR> <BR>+char          
 *grh = NULL;<BR>+<BR> struct pingpong_context {<BR>  struct 
ibv_context  *context;<BR>  struct 
ibv_comp_channel *channel;<BR>@@ -55,6 +57,8 
@@<BR>  int      size;<BR>  int      rx_depth;<BR>  int      pending;<BR>+ struct 
ibv_port_attr     portinfo;<BR>+ union 
ibv_gid   dgid;<BR> };<BR> <BR> struct pingpong_dest 
{<BR>@@ -69,6 +73,7 @@<BR> {<BR>  struct ibv_qp_attr 
attr;<BR>  <BR>+ attr.port_num           
= (u8)port;<BR>  attr.qp_state   = 
IBV_QPS_RTR;<BR>  attr.path_mtu   = 
mtu;<BR>  attr.dest_qp_num  = dest->qpn;<BR>@@ -81,6 
+86,15 @@<BR>  attr.ah_attr.src_path_bits = 
0;<BR>  attr.ah_attr.port_num  = (uint8_t) 
port;<BR> <BR>+ if(grh)<BR>+ {<BR>+  str2gid(grh, 
&ctx->dgid);<BR>+  attr.ah_attr.is_global = 
1;<BR>+  attr.ah_attr.grh.hop_limit = 
1;<BR>+  attr.ah_attr.grh.dgid = 
ctx->dgid;<BR>+  attr.ah_attr.grh.sgid_index = 
0;<BR>+ }<BR>+<BR>  if (ibv_modify_qp(ctx->qp, 
&attr,<BR>      
IBV_QP_STATE              
|<BR>      
IBV_QP_AV                 
|<BR>@@ -499,7 +513,7 @@<BR>  while (1) {<BR>   int 
c;<BR> <BR>-  c = getopt(argc, argv, 
"h:p:d:i:s:m:r:n:l:e");<BR>+        c = 
getopt(argc, argv, "h:p:d:i:s:m:r:n:l:g:e");<BR>   if (c == 
-1)<BR>    break;<BR> <BR>@@ -555,6 +569,10 
@@<BR>    servername = 
_strdup(optarg);<BR>    break;<BR> <BR>+  case 
'g':<BR>+   grh = 
_strdup(optarg);<BR>+   break;<BR>+<BR>   default:<BR>    usage(argv[0]);<BR>    return 
1;<BR>@@ -606,7 +624,7 @@<BR>  my_dest.psn = rand() & 
0xffffff;<BR>  if (!my_dest.lid) 
{<BR>   fprintf(stderr, "Couldn't get local 
LID\n");<BR>-  return 1;<BR>+  //return 
1;<BR>  }<BR> <BR>  printf("  local address:  
LID 0x%04x, QPN 0x%06x, PSN 0x%06x\n",<BR></DIV></FONT></BODY></HTML>