]> git.openfabrics.org - ~shefty/rdma-win.git/commitdiff
[IBAL] Send RMPP ACK if RMPP response is sent with a busy status.
authorftillier <ftillier@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Mon, 7 Aug 2006 23:04:40 +0000 (23:04 +0000)
committerftillier <ftillier@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Mon, 7 Aug 2006 23:04:40 +0000 (23:04 +0000)
git-svn-id: svn://openib.tc.cornell.edu/gen1@443 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86

trunk/core/al/al_mad.c

index 69ef0b7733afb4c76a175e65fb3d7cadecb60dca..38a549bb630a42a91224ef6fe271f82ebc8c83f8 100644 (file)
@@ -2161,18 +2161,6 @@ __mad_svc_recv_done(
                return;\r
        }\r
 \r
-       /*\r
-        * If the response indicates that the responder was busy, continue\r
-        * retrying the request.\r
-        */\r
-       if( p_mad_hdr->status & IB_MAD_STATUS_BUSY )\r
-       {\r
-               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR,\r
-                       ("responder busy TID:0x%I64x\n", p_mad_hdr->trans_id) );\r
-               ib_put_mad( p_mad_element );\r
-               return;\r
-       }\r
-\r
        /* Fully reassemble received MADs before completing them. */\r
        if( __recv_requires_rmpp( h_mad_svc->svc_type, p_mad_element ) )\r
        {\r
@@ -2193,6 +2181,18 @@ __mad_svc_recv_done(
                p_mad_hdr = ib_get_mad_buf( p_mad_element );\r
        }\r
 \r
+       /*\r
+        * If the response indicates that the responder was busy, continue\r
+        * retrying the request.\r
+        */\r
+       if( p_mad_hdr->status & IB_MAD_STATUS_BUSY )\r
+       {\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR,\r
+                       ("responder busy TID:0x%I64x\n", p_mad_hdr->trans_id) );\r
+               ib_put_mad( p_mad_element );\r
+               return;\r
+       }\r
+\r
        /*\r
         * See if the MAD was sent in response to a previously sent MAD.  Note\r
         * that trap repress messages are responses, even though the response\r
@@ -2750,6 +2750,9 @@ __get_rmpp_ack(
        cl_memcpy( &p_ack_rmpp_hdr->common_hdr, &p_data_rmpp_hdr->common_hdr,\r
                sizeof( ib_mad_t ) );\r
 \r
+       /* Reset the status (in case the BUSY bit is set). */\r
+       p_ack_rmpp_hdr->common_hdr.status = 0;\r
+\r
        /* Flip the response bit in the method */\r
        p_ack_rmpp_hdr->common_hdr.method ^= IB_MAD_METHOD_RESP_MASK;\r
 \r
@@ -2761,10 +2764,15 @@ __get_rmpp_ack(
 \r
        p_ack_rmpp_hdr->seg_num = cl_hton32( p_rmpp->expected_seg - 1 );\r
 \r
-       if (p_rmpp->seg_limit == p_rmpp->expected_seg - 1 )\r
+       if (p_rmpp->seg_limit == p_rmpp->expected_seg - 1 &&\r
+               !ib_rmpp_is_flag_set( p_data_rmpp_hdr, IB_RMPP_FLAG_LAST ) )\r
+       {\r
                p_ack_rmpp_hdr->paylen_newwin = cl_hton32( 1 + p_rmpp->seg_limit);\r
+       }\r
        else\r
+       {\r
                p_ack_rmpp_hdr->paylen_newwin = cl_hton32( p_rmpp->seg_limit );\r
+       }\r
 \r
        return p_mad_element;\r
 }\r