<!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.3243" name=GENERATOR></HEAD>
<BODY>
<DIV><SPAN class=148165614-01092008><FONT face=Arial color=#0000ff size=2>Done
in rev.1549, thank you.</FONT></SPAN></DIV><BR>
<BLOCKQUOTE dir=ltr
style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #0000ff 2px solid; MARGIN-RIGHT: 0px">
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> Reuven Amitai <BR><B>Sent:</B> Sunday,
August 31, 2008 5:39 PM<BR><B>To:</B> Leonid Keller<BR><B>Cc:</B>
ofw@lists.openfabrics.org<BR><B>Subject:</B> [PATCH] IBAL - fix
ual_get_gid_index()<BR></FONT><BR></DIV>
<DIV></DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN class=290103414-31082008>Hi
Leonid,</SPAN></FONT></DIV><BR>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left><SPAN
class=702563616-27082008><FONT face=Arial color=#0000ff size=2><SPAN
class=290103414-31082008>The patch fix accessing p_user_attr field which lead
to access violation, t</SPAN></FONT></SPAN><SPAN
class=702563616-27082008><FONT face=Arial color=#0000ff size=2><SPAN
class=290103414-31082008>he actual field is
p_pnp_attr.</SPAN></FONT></SPAN></DIV>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left><SPAN
class=702563616-27082008><FONT face=Arial color=#0000ff size=2><SPAN
class=290103414-31082008>It also moves port checking to the head of the
function stack.</SPAN></FONT></SPAN></DIV>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left><SPAN
class=702563616-27082008><FONT face=Arial color=#0000ff size=2><SPAN
class=290103414-31082008></SPAN></FONT></SPAN> </DIV>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left><SPAN
class=702563616-27082008><FONT face=Arial color=#0000ff size=2><SPAN
class=290103414-31082008>Thanks, Reuven.</SPAN></FONT></SPAN></DIV>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left><SPAN
class=702563616-27082008><FONT face=Arial color=#0000ff size=2><SPAN
class=290103414-31082008></SPAN></FONT></SPAN> </DIV>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left><SPAN
class=702563616-27082008><FONT face=Arial color=#0000ff size=2><SPAN
class=290103414-31082008>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>></SPAN></FONT></SPAN></DIV>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left><SPAN
class=702563616-27082008><FONT face=Arial color=#0000ff size=2><SPAN
class=290103414-31082008>Index:
core/al/al_av.c<BR>===================================================================<BR>---
core/al/al_av.c (revision 1534)<BR>+++ core/al/al_av.c (working
copy)<BR>@@ -112,7 +112,23 @@<BR> }<BR> <BR> <BR>+static
ib_api_status_t<BR>+__check_av_port(<BR>+ IN const al_ci_ca_t* const p_ci_ca,<BR>+ IN const ib_av_attr_t*
const p_av_attr )<BR>+{<BR>+ ib_api_status_t status =
IB_SUCCESS;<BR> <BR>+ if (p_av_attr->port_num == 0 ||
p_av_attr->port_num >
p_ci_ca->num_ports)<BR>+ {<BR>+ AL_PRINT(TRACE_LEVEL_WARNING
,AL_DBG_AV,<BR>+ ("invalid port number specified (%d)\n",
p_av_attr->port_num) );<BR>+ status =
IB_INVALID_PORT;<BR>+ }<BR>+ return
status;<BR>+}<BR>+<BR>+<BR> ib_api_status_t<BR> create_av(<BR> IN const ib_pd_handle_t h_pd,<BR>@@
-137,6 +153,13 @@<BR> return
IB_INVALID_PD_HANDLE;<BR> }<BR> <BR>+ status =
__check_av_port(h_pd->obj.p_ci_ca, p_av_attr);<BR>+ if( status !=
IB_SUCCESS )<BR>+ {<BR>+ AL_PRINT_EXIT( TRACE_LEVEL_ERROR,
AL_DBG_ERROR, ("IB_INVALID_PORT\n") );<BR>+ return
status;<BR>+ }<BR>+ <BR> /* Get an AV tracking structure.
*/<BR> h_av = alloc_av();<BR> if( !h_av )<BR>@@ -302,6
+325,13 @@<BR> return
IB_INVALID_PARAMETER;<BR> }<BR> <BR>+ status =
__check_av_port(h_av->obj.p_ci_ca, p_av_mod);<BR>+ if( status !=
IB_SUCCESS )<BR>+ {<BR>+ AL_PRINT_EXIT( TRACE_LEVEL_ERROR,
AL_DBG_ERROR, ("IB_INVALID_PORT\n") );<BR>+ return
status;<BR>+ }<BR>+<BR> status = verbs_modify_av(h_av,
p_av_mod);<BR> <BR> /* Record av for special qp access
*/<BR>Index:
core/al/user/ual_av.c<BR>===================================================================<BR>---
core/al/user/ual_av.c (revision 1534)<BR>+++
core/al/user/ual_av.c (working copy)<BR>@@ -58,17 +58,7
@@<BR> uint16_t i;<BR> <BR> ci_ca_lock_attr(
p_ci_ca );<BR>-<BR>- // sanity check<BR>- if (port_num == 0 ||
port_num >
p_ci_ca->p_user_attr->num_ports)<BR>- {<BR>- AL_PRINT(TRACE_LEVEL_WARNING
,AL_DBG_AV,<BR>- ("UAL_GET_GID_INDEX: invalid port number
specified (%d)\n", port_num) );<BR>- status =
IB_INVALID_PORT;<BR>- goto
out;<BR>- }<BR>-<BR>- p_port_attr =
&p_ci_ca->p_user_attr->p_port_attr[port_num];<BR>+ p_port_attr
= &p_ci_ca->p_pnp_attr->p_port_attr[port_num];<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>@@ -78,8 +68,6
@@<BR> break;<BR> }<BR> }<BR>-<BR>-out:<BR> ci_ca_unlock_attr(
p_ci_ca );<BR> <BR> return
status;<BR></SPAN></FONT></SPAN></DIV></BLOCKQUOTE></BODY></HTML>