bnxt_re: Fix update of qplib_qp.mtu when modified
authorDevesh Sharma <devesh.sharma@broadcom.com>
Thu, 31 Aug 2017 03:57:28 +0000 (09:27 +0530)
committerDoug Ledford <dledford@redhat.com>
Fri, 22 Sep 2017 17:57:32 +0000 (13:57 -0400)
The MTU value in the qplib_qp.mtu should be
consistent with whatever mtu was set during
INIT to RTR.The Next PSN and number of packets
are calculated based on this member in the qplib_qp structure.

Signed-off-by: Narender Reddy <narender.reddy@broadcom.com>
Signed-off-by: Devesh Sharma <devesh.sharma@broadcom.com>
Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
drivers/infiniband/hw/bnxt_re/ib_verbs.c

index 03caf48af8e2531773a657122f88e7e698a5e82f..11bbf3e748b046edb07ec9a52f6e78392ddf7690 100644 (file)
@@ -1436,11 +1436,14 @@ int bnxt_re_modify_qp(struct ib_qp *ib_qp, struct ib_qp_attr *qp_attr,
                qp->qplib_qp.modify_flags |=
                                CMDQ_MODIFY_QP_MODIFY_MASK_PATH_MTU;
                qp->qplib_qp.path_mtu = __from_ib_mtu(qp_attr->path_mtu);
+               qp->qplib_qp.mtu = ib_mtu_enum_to_int(qp_attr->path_mtu);
        } else if (qp_attr->qp_state == IB_QPS_RTR) {
                qp->qplib_qp.modify_flags |=
                        CMDQ_MODIFY_QP_MODIFY_MASK_PATH_MTU;
                qp->qplib_qp.path_mtu =
                        __from_ib_mtu(iboe_get_mtu(rdev->netdev->mtu));
+               qp->qplib_qp.mtu =
+                       ib_mtu_enum_to_int(iboe_get_mtu(rdev->netdev->mtu));
        }
 
        if (qp_attr_mask & IB_QP_TIMEOUT) {