<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 11 (filtered medium)">
<style>
<!--
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:purple;
        text-decoration:underline;}
p.MsoPlainText, li.MsoPlainText, div.MsoPlainText
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";}
pre
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:Arial;
        color:windowtext;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
        {page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext="edit">
  <o:idmap v:ext="edit" data="1" />
 </o:shapelayout></xml><![endif]-->
</head>

<body lang=EN-US link=blue vlink=purple>

<div class=Section1>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>Fix some issues supporting create qp without recv cq handle
or recv qp resources. IB verbs assume a recv_cq handle and uDAPL dapl_ep_create
assumes there is always recv_sge resources specified. <o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>

<pre><font size=2 face="Courier New"><span style='font-size:10.0pt'>Signed-off by: Arlin Davis <a
href="mailto:ardavis@ichips.intel.com">ardavis@ichips.intel.com</a><o:p></o:p></span></font></pre>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>

<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'>Index: dapl/common/dapl_ep_create.c<br>
===================================================================<br>
--- dapl/common/dapl_ep_create.c    (revision 9916)<br>
+++ dapl/common/dapl_ep_create.c    (working copy)<br>
@@ -166,7 +166,7 @@<br>
       (recv_evd_handle != DAT_HANDLE_NULL
&& ep_attr->max_recv_dtos == 0) ||<br>
       (request_evd_handle == DAT_HANDLE_NULL
&& ep_attr->max_request_dtos != 0) ||<br>
       (request_evd_handle != DAT_HANDLE_NULL
&& ep_attr->max_request_dtos == 0) ||<br>
-      ep_attr->max_recv_iov == 0 ||<br>
+      (recv_evd_handle != DAT_HANDLE_NULL &&
ep_attr->max_recv_iov == 0) ||<br>
       ep_attr->max_request_iov == 0 ||<br>
          (DAT_SUCCESS !=
dapl_ep_check_recv_completion_flags (<br>
             
ep_attr->recv_completion_flags)) ))<br>
<br>
Index: dapl/openib_cma/dapl_ib_qp.c<br>
===================================================================<br>
--- dapl/openib_cma/dapl_ib_qp.c    (revision 10032)<br>
+++ dapl/openib_cma/dapl_ib_qp.c    (working copy)<br>
@@ -143,13 +143,21 @@<br>
      /* Setup attributes and create qp */<br>
      dapl_os_memzero((void*)&qp_create,
sizeof(qp_create));<br>
      qp_create.cap.max_send_wr =
attr->max_request_dtos;<br>
-     qp_create.cap.max_recv_wr = attr->max_recv_dtos;<br>
      qp_create.cap.max_send_sge =
attr->max_request_iov;<br>
-     qp_create.cap.max_recv_sge = attr->max_recv_iov;<br>
      qp_create.cap.max_inline_data = <br>
            ia_ptr->hca_ptr->ib_trans.max_inline_send;
<br>
      qp_create.send_cq = req_cq;<br>
-     qp_create.recv_cq = rcv_cq;<br>
+<br>
+     /* ibv assumes rcv_cq is never NULL, set to req_cq */<br>
+     if (rcv_cq == NULL) {<br>
+           qp_create.recv_cq
= req_cq;<br>
+           qp_create.cap.max_recv_wr
= 0;<br>
+           qp_create.cap.max_recv_sge
= 0;<br>
+     } else {<br>
+           qp_create.recv_cq
= rcv_cq;<br>
+           qp_create.cap.max_recv_wr
= attr->max_recv_dtos;<br>
+           qp_create.cap.max_recv_sge
= attr->max_recv_iov;<br>
+     }<br>
      qp_create.qp_type = IBV_QPT_RC;<br>
      qp_create.qp_context = (void*)ep_ptr;<br>
 <br>
<o:p> </o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>

</div>

</body>

</html>