<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2900.3314" name=GENERATOR></HEAD>
<BODY>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN class=007251712-02092008>Hi 
Leonid, </SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN 
class=007251712-02092008></SPAN></FONT> </DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN class=007251712-02092008>The 
patch fix the behavior of av verbs in case that sgid isn't found at the 
gid_table.</SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN 
class=007251712-02092008>Instead of exit with IB_INVALID_GID </SPAN></FONT><FONT 
face=Arial color=#0000ff size=2><SPAN class=007251712-02092008>it sets the index 
to 0. Please note IB spec 11.2.2.2 regarding av verbs 
definition.</SPAN></FONT></DIV>
<DIV><FONT><SPAN class=007251712-02092008><FONT face=Arial><FONT color=#0000ff 
size=2></FONT></FONT></SPAN></FONT> </DIV>
<DIV><FONT><SPAN class=007251712-02092008><FONT face=Arial><FONT color=#0000ff 
size=2>The patch also used grh.resv2 (rather than resv1) to avoid C4328 
warning (improper member alignment).</FONT></FONT></SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT> </DIV>
<DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2>Signed-off-by: 
Reuven Amitai <A 
href="mailto:reuven@mellanox.co.il">reuven@mellanox.co.il</A></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff 
size=2></FONT> </DIV></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><EM>Thanks, 
Reuven.</EM></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT> </DIV>
<DIV><SPAN class=007251712-02092008><FONT face=Arial color=#0000ff 
size=2>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\</FONT></SPAN></DIV>
<DIV><SPAN class=007251712-02092008><FONT face=Arial color=#0000ff size=2>Index: 
core/al/user/ual_av.c<BR>===================================================================<BR>--- 
core/al/user/ual_av.c (revision 1540)<BR>+++ 
core/al/user/ual_av.c (working copy)<BR>@@ -46,31 +46,28 
@@<BR> #endif<BR> <BR> <BR>-static ib_api_status_t<BR>+static 
void<BR> ual_get_gid_index(<BR>  IN  struct 
_al_ci_ca     *p_ci_ca,<BR>  IN  uint8_t        port_num,<BR>  IN  ib_gid_t       *p_gid,<BR>-  OUT uint16_t       *p_index)<BR>+  OUT uint8_t       *p_index)<BR> {<BR>  ib_port_attr_t  *p_port_attr;<BR>- ib_api_status_t  status 

IB_INVALID_GID;<BR>- uint16_t   i;<BR>+ uint8_t   i;<BR> <BR>  ci_ca_lock_attr( 
p_ci_ca );<BR>  p_port_attr = 
&p_ci_ca->p_pnp_attr->p_port_attr[port_num-1];<BR>+ *p_index = 
0;<BR>  for( i = 0; i < p_port_attr->num_gids; i++ 
)<BR>  {<BR>   if( !cl_memcmp(p_gid, 
&p_port_attr->p_gid_table[i], sizeof(ib_gid_t)) 
)<BR>   {<BR>    *p_index = 
i;<BR>-   status = 
IB_SUCCESS;<BR>    break;<BR>   }<BR>  }<BR>  ci_ca_unlock_attr( 
p_ci_ca );<BR>-<BR>- return 
status;<BR> }<BR> <BR> ib_api_status_t<BR>@@ -85,7 +82,6 
@@<BR>  ib_api_status_t   status = 
IB_ERROR;<BR>  uvp_interface_t   uvp_intf = 
h_pd->obj.p_ci_ca->verbs.user_verbs;<BR>  ib_av_attr_t   av_attr;<BR>- uint16_t    index;<BR> <BR>  AL_ENTER( 
AL_DBG_AV );<BR>  /* Clear the ioctl_buf */<BR>@@ -97,11 +93,8 
@@<BR>  {<BR>   if( p_av_attr->grh_valid 
)<BR>   {<BR>-   status = 
ual_get_gid_index(h_pd->obj.p_ci_ca, 
av_attr.port_num,<BR>-            
&av_attr.grh.src_gid, &index);<BR>-   if( status != 
IB_SUCCESS )<BR>-    goto 
out;<BR>-   av_attr.grh.resv1 = 
index;<BR>+   ual_get_gid_index(h_pd->obj.p_ci_ca, 
av_attr.port_num, 
<BR>+        &av_attr.grh.src_gid, 
&av_attr.grh.resv2);<BR>   }<BR> <BR>   status 
= uvp_intf.pre_create_av( h_pd->h_ci_pd,<BR>@@ -136,7 +129,6 
@@<BR>    status, &h_av->h_ci_av, 
&ioctl_buf.out.umv_buf);<BR>  }<BR> <BR>-out:<BR>  AL_EXIT( 
AL_DBG_AV );<BR>  return status;<BR> }<BR>@@ -269,7 +261,6 
@@<BR>  ib_av_t*    p_av = (ib_av_t*) 
h_av;<BR>  uvp_interface_t   uvp_intf = 
p_av->obj.p_ci_ca->verbs.user_verbs;<BR>  ib_av_attr_t   av_attr;<BR>- uint16_t    index;<BR> <BR>  AL_ENTER( 
AL_DBG_AV );<BR>  /* Clear the ioctl_buf */<BR>@@ -281,11 +272,8 
@@<BR>  {<BR>   if( p_av_attr->grh_valid 
)<BR>   {<BR>-   status = 
ual_get_gid_index(p_av->obj.p_ci_ca, 
av_attr.port_num,<BR>-            
&av_attr.grh.src_gid, &index);<BR>-   if( status != 
IB_SUCCESS )<BR>-    goto 
out;<BR>-   av_attr.grh.resv1 = 
index;<BR>+   ual_get_gid_index(p_av->obj.p_ci_ca, 
av_attr.port_num, 
<BR>+        &av_attr.grh.src_gid, 
&av_attr.grh.resv2);<BR>   }<BR> <BR>   /* 
Pre call to the UVP library */<BR>@@ -336,7 +324,6 
@@<BR>    p_av->h_ci_av, status, 
&ioctl_buf.out.umv_buf 
);<BR>  }<BR> <BR>-out:<BR>  AL_EXIT( AL_DBG_AV 
);<BR>  return status;<BR> }<BR>Index: 
hw/mlx4/user/hca/verbs.c<BR>===================================================================<BR>--- 
hw/mlx4/user/hca/verbs.c (revision 1540)<BR>+++ 
hw/mlx4/user/hca/verbs.c (working copy)<BR>@@ -1088,7 +1088,7 
@@<BR>   p_attr->grh.hop_limit = 
p_av_attr->grh.hop_limit;<BR>   __grh_get_ver_class_flow( 
p_av_attr->grh.ver_class_flow, 
NULL,<BR>         &p_attr->grh.traffic_class, 
&p_attr->grh.flow_label 
);<BR>-  p_attr->grh.sgid_index = (uint8_t) 
p_av_attr->grh.resv1;<BR>+  p_attr->grh.sgid_index = 
p_av_attr->grh.resv2;<BR>   cl_memcpy 
(p_attr->grh.dgid.raw, p_av_attr->grh.dest_gid.raw, 
16);<BR>  }<BR>  else<BR>Index: 
hw/mthca/user/mlnx_ual_av.c<BR>===================================================================<BR>--- 
hw/mthca/user/mlnx_ual_av.c (revision 1540)<BR>+++ 
hw/mthca/user/mlnx_ual_av.c (working copy)<BR>@@ -70,7 +70,7 
@@<BR>   p_attr->grh.hop_limit   = 
p_av_attr->grh.hop_limit;<BR>   ib_grh_get_ver_class_flow( 
p_av_attr->grh.ver_class_flow, 
NULL,<BR>    &p_attr->grh.traffic_class, 
&p_attr->grh.flow_label );<BR>-  p_attr->grh.sgid_index = 
(uint8_t) p_av_attr->grh.resv1;<BR>+  p_attr->grh.sgid_index = 
p_av_attr->grh.resv2;<BR>   cl_memcpy 
(p_attr->grh.dgid.raw, p_av_attr->grh.dest_gid.raw, 
<BR>    sizeof 
(IB_gid_t));<BR>  }else{<BR></FONT></SPAN></DIV></BODY></HTML>