<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=US-ASCII">
<META NAME="Generator" CONTENT="MS Exchange Server version 5.5.2654.45">
<TITLE>[PATCH] create cq with invalid CQ</TITLE>
</HEAD>
<BODY>
<P><FONT SIZE=2>Fab</FONT>
</P>
<BR>
<P><FONT SIZE=2>Our verification team found that creating RC QP with invalid CQ hang the machine.</FONT>
<BR><FONT SIZE=2>We found that the cid field is initialized only in init_conn_qp , so if you call the function with invalid cq </FONT>
<BR><FONT SIZE=2>the code will call the destroy function that in case of connected QP will test and set the cid field ( which is uninitialized)</FONT></P>
<P><FONT SIZE=2>[line 1086 in al_qp.c)</FONT>
<BR><FONT SIZE=2>That will cause the cep destroy function to be called .... and the machine hang.</FONT>
</P>
<P><FONT SIZE=2>Here is patch that fix this.</FONT>
</P>
<P><FONT SIZE=2>Thanks</FONT>
<BR><FONT SIZE=2>Yossi </FONT>
</P>
<P><FONT SIZE=2>Signed-off-by: Yossi Leybovich (sleybo@mellanox.co.il)</FONT>
</P>
<P><FONT SIZE=2>Index: al_qp.c</FONT>
<BR><FONT SIZE=2>===================================================================</FONT>
<BR><FONT SIZE=2>--- al_qp.c (revision 346)</FONT>
<BR><FONT SIZE=2>+++ al_qp.c (working copy)</FONT>
<BR><FONT SIZE=2>@@ -623,6 +623,9 @@</FONT>
<BR><FONT SIZE=2> p_qp->pfn_init_dgrm_svc = al_bad_init_dgrm_svc;</FONT>
<BR><FONT SIZE=2> p_qp->pfn_join_mcast = al_bad_join_mcast;</FONT>
<BR><FONT SIZE=2> </FONT>
<BR><FONT SIZE=2>+ if(p_qp->type == IB_QPT_RELIABLE_CONN ||</FONT>
<BR><FONT SIZE=2>+ p_qp->type == IB_QPT_UNRELIABLE_CONN) </FONT>
<BR><FONT SIZE=2>+ ((al_conn_qp_t*)p_qp)->cid = AL_INVALID_CID;</FONT>
<BR><FONT SIZE=2> return status;</FONT>
<BR><FONT SIZE=2> }</FONT>
<BR><FONT SIZE=2> </FONT>
<BR><FONT SIZE=2>@@ -723,8 +726,7 @@</FONT>
<BR><FONT SIZE=2> status = init_raw_qp( &p_conn_qp->qp, h_pd, UNBOUND_PORT_GUID,</FONT>
<BR><FONT SIZE=2> p_qp_create, p_umv_buf );</FONT>
<BR><FONT SIZE=2> </FONT>
<BR><FONT SIZE=2>- p_conn_qp->cid = AL_INVALID_CID;</FONT>
<BR><FONT SIZE=2>-</FONT>
<BR><FONT SIZE=2>+ </FONT>
<BR><FONT SIZE=2> return status;</FONT>
<BR><FONT SIZE=2> }</FONT>
<BR><FONT SIZE=2> </FONT>
</P>
<P><FONT FACE="Arial" SIZE=2 COLOR="#000000"></FONT>
</BODY>
</HTML>