[MTHCA] bugfix: don't set unnecessary required parameters in modify_QP in RTS-RTS...
authorleonidk <leonidk@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Wed, 16 Aug 2006 09:49:44 +0000 (09:49 +0000)
committerleonidk <leonidk@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Wed, 16 Aug 2006 09:49:44 +0000 (09:49 +0000)
git-svn-id: svn://openib.tc.cornell.edu/gen1/trunk@456 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86

hw/mthca/kernel/hca_data.c

index 939cd39..5d29dca 100644 (file)
@@ -626,9 +626,10 @@ mlnx_conv_qp_modify_attr(
 \r
                switch (qp_type) {\r
                        case IB_QPT_RELIABLE_CONN:\r
 \r
                switch (qp_type) {\r
                        case IB_QPT_RELIABLE_CONN:\r
-                               *qp_attr_mask_p |= /* required flags */\r
-                                       IB_QP_SQ_PSN |IB_QP_MAX_QP_RD_ATOMIC | IB_QP_TIMEOUT |\r
-                                       IB_QP_RETRY_CNT |IB_QP_RNR_RETRY;\r
+                               if (qp_p->state != IBQPS_RTS)\r
+                                       *qp_attr_mask_p |= /* required flags */\r
+                                               IB_QP_SQ_PSN |IB_QP_MAX_QP_RD_ATOMIC | IB_QP_TIMEOUT |\r
+                                               IB_QP_RETRY_CNT |IB_QP_RNR_RETRY;\r
 \r
                                // IB_QP_MAX_QP_RD_ATOMIC\r
                                qp_attr_p->max_rd_atomic        = modify_attr_p->state.rts.init_depth;\r
 \r
                                // IB_QP_MAX_QP_RD_ATOMIC\r
                                qp_attr_p->max_rd_atomic        = modify_attr_p->state.rts.init_depth;\r
@@ -691,8 +692,9 @@ mlnx_conv_qp_modify_attr(
                                break;\r
                                \r
                        case IB_QPT_UNRELIABLE_CONN:\r
                                break;\r
                                \r
                        case IB_QPT_UNRELIABLE_CONN:\r
-                               *qp_attr_mask_p |= /* required flags */\r
-                                       IB_QP_SQ_PSN;\r
+                               if (qp_p->state != IBQPS_RTS)\r
+                                       *qp_attr_mask_p |= /* required flags */\r
+                                               IB_QP_SQ_PSN;\r
 \r
                                // IB_QP_MAX_DEST_RD_ATOMIC: Update the responder resources for RDMA/ATOMIC (optional for SQD->RTS)\r
                                if (modify_attr_p->state.rts.opts & IB_MOD_QP_RESP_RES) {\r
 \r
                                // IB_QP_MAX_DEST_RD_ATOMIC: Update the responder resources for RDMA/ATOMIC (optional for SQD->RTS)\r
                                if (modify_attr_p->state.rts.opts & IB_MOD_QP_RESP_RES) {\r
@@ -739,8 +741,9 @@ mlnx_conv_qp_modify_attr(
                        case IB_QPT_QP0:\r
                        case IB_QPT_QP1:\r
                        default:        \r
                        case IB_QPT_QP0:\r
                        case IB_QPT_QP1:\r
                        default:        \r
-                               *qp_attr_mask_p |= /* required flags */\r
-                                       IB_QP_SQ_PSN;\r
+                               if (qp_p->state != IBQPS_RTS)\r
+                                       *qp_attr_mask_p |= /* required flags */\r
+                                               IB_QP_SQ_PSN;\r
 \r
                                // IB_QP_QKEY\r
                                if (modify_attr_p->state.rts.opts & IB_MOD_QP_QKEY) {\r
 \r
                                // IB_QP_QKEY\r
                                if (modify_attr_p->state.rts.opts & IB_MOD_QP_QKEY) {\r