Hi Dotan,<br>

Thanks for your reply!<br>
I used a non-zero value for min_rnr_timer like this:<br>
qp_attr.min_rnr_timer = /*0*/ IB_RNR_NAK_TIMER_2_56;<br>
And to be simple, I put the sender and the receiver in the same process
rather than synchronized tow processes. The data was transferred
correctly as proved by printing out the contents of the buffers.<br>
However I got another question:  the "number of bytes transferred"
of the CQE VAPI_CQE_RQ_SEND_DATA was the same as the number of the Recv
request. But the one of the CQE VAPI_CQE_SQ_SEND_DATA was zero, which
was not what I expected. What is the matter do you think?<br>
Thanks very much!<br>
<br>
Here are the relative codes:<br>
<br>
===========print the WC descriptor ========<br>
void print_wc_desc(VAPI_wc_desc_t *wc_desc_p)<br>
{<br>
    if (wc_desc_p != NULL) {<br>
        printf("status: %d\n", wc_desc_p->status);<br>
        printf("id: %lu\n", wc_desc_p->id);<br>
        printf("opcode: %s\n", get_cqe_opcode_str(wc_desc_p->opcode));<br>
        printf("Num. of bytes transferred: %d\n", wc_desc_p->byte_len);<br>
        printf("...");<br>
    }<br>
}<br>
======= wait the Send to complete =========<br>
do {    poll_cnt++;<br>
        res = VAPI_poll_cq(hca_hndl, s_cq_hndl, &wc_desc);<br>
       if (res != VAPI_OK && res != VAPI_CQ_EMPTY) {<br>
            PRINT_ERR("Poll CQ block failed\n");<br>
            VAPIERR(res);<br>
            return -1;<br>
        }<br>
    } while(res == VAPI_CQ_EMPTY && poll_cnt < 10);<br>
        if (wc_desc.status != VAPI_SUCCESS) {<br>
           
PRINT_ERR("Req unsuccess: %s\n", VAPI_wc_status_sym(wc_desc.status));<br>
            print_wc_desc(&wc_desc);<br>
            return -1;<br>
        }<br>
    PRINT_TRACE("Req success\n");<br>
    print_wc_desc(&wc_desc);<br>
<br>
<br><div><span class="gmail_quote">On 2/19/06, <b class="gmail_sendername">Dotan Barak</b> <<a href="mailto:dotanb@mellanox.co.il">dotanb@mellanox.co.il</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div>
















  <font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;">I believe that the problem is that the <span>min_rnr_timer</span> value is 0 (which means infinite timeout
between the <span>rnr</span> retries) and there is <span>rnr</span> <span>nak</span> between the two sides
(because you don't sync between the sides, and this is the reason for the
empty CQ …</span></font>



<p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;"> <br>
Let me describe the problem: <br>
</span></font></p>

<p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;">The sender sent a send message which
should consume RR (Receive Request) at the receiver side, but when the message
have reached to the receiver there wasn't any RR in the RQ, so he sent to
the sender <span>rnr-nack</span>, the sender got the <span>rnr-nack</span> and is waiting the <span>min_rnr_timer</span>
which is infinite …</span></font></p>

<p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;"> </span></font></p>

<p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;">You should do the following things:</span></font></p>

<ul type="disc">
 <li style="color: navy;"><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">Put a non zero value in the <span>min_rnr_timer</span>
     (you may get completion with bad status: <span>rnr</span> exceeded
     if the receiver won't be ready in time …)</span></font></li>
 <li style="color: navy;"><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">Post RR in the responder in the init state</span></font></li>
 <li style="color: navy;"><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">Optional: sync between the sides (post SR at the sender only when
     there is RR in the receiver side).</span></font></li>
</ul>

<p><font color="navy" face="Times New Roman" size="3"><span style="font-size: 12pt; color: navy;"> </span></font></p>

<p><span><font face="Times New Roman" size="3"><span style="font-size: 12pt;">Dotan</span></font></span><br>
<span> </span></p>

</div>





</blockquote></div><br><br clear="all"><br>-- <br>Ian Jiang<br><a href="mailto:ianjiang.ict@gmail.com">ianjiang.ict@gmail.com</a><br><br>Laboratory of Spatial Information Technology<br>Division of System Architecture<br>
Institute of Computing Technology<br>Chinese Academy of Sciences