IB/mlx4: Add debug prints
[deliverable/linux.git] / drivers / infiniband / hw / mlx4 / qp.c
index 8d4ed24aef931e1e89186a9a5cdfccbfaf268771..84b26963c8d4ae04cbfafe9e66d5f4e5da7d9ce3 100644 (file)
@@ -1335,11 +1335,21 @@ int mlx4_ib_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr,
        cur_state = attr_mask & IB_QP_CUR_STATE ? attr->cur_qp_state : qp->state;
        new_state = attr_mask & IB_QP_STATE ? attr->qp_state : cur_state;
 
-       if (!ib_modify_qp_is_ok(cur_state, new_state, ibqp->qp_type, attr_mask))
+       if (!ib_modify_qp_is_ok(cur_state, new_state, ibqp->qp_type, attr_mask)) {
+               pr_debug("qpn 0x%x: invalid attribute mask specified "
+                        "for transition %d to %d. qp_type %d,"
+                        " attr_mask 0x%x\n",
+                        ibqp->qp_num, cur_state, new_state,
+                        ibqp->qp_type, attr_mask);
                goto out;
+       }
 
        if ((attr_mask & IB_QP_PORT) &&
            (attr->port_num == 0 || attr->port_num > dev->dev->caps.num_ports)) {
+               pr_debug("qpn 0x%x: invalid port number (%d) specified "
+                        "for transition %d to %d. qp_type %d\n",
+                        ibqp->qp_num, attr->port_num, cur_state,
+                        new_state, ibqp->qp_type);
                goto out;
        }
 
@@ -1350,17 +1360,30 @@ int mlx4_ib_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr,
 
        if (attr_mask & IB_QP_PKEY_INDEX) {
                int p = attr_mask & IB_QP_PORT ? attr->port_num : qp->port;
-               if (attr->pkey_index >= dev->dev->caps.pkey_table_len[p])
+               if (attr->pkey_index >= dev->dev->caps.pkey_table_len[p]) {
+                       pr_debug("qpn 0x%x: invalid pkey index (%d) specified "
+                                "for transition %d to %d. qp_type %d\n",
+                                ibqp->qp_num, attr->pkey_index, cur_state,
+                                new_state, ibqp->qp_type);
                        goto out;
+               }
        }
 
        if (attr_mask & IB_QP_MAX_QP_RD_ATOMIC &&
            attr->max_rd_atomic > dev->dev->caps.max_qp_init_rdma) {
+               pr_debug("qpn 0x%x: max_rd_atomic (%d) too large. "
+                        "Transition %d to %d. qp_type %d\n",
+                        ibqp->qp_num, attr->max_rd_atomic, cur_state,
+                        new_state, ibqp->qp_type);
                goto out;
        }
 
        if (attr_mask & IB_QP_MAX_DEST_RD_ATOMIC &&
            attr->max_dest_rd_atomic > dev->dev->caps.max_qp_dest_rdma) {
+               pr_debug("qpn 0x%x: max_dest_rd_atomic (%d) too large. "
+                        "Transition %d to %d. qp_type %d\n",
+                        ibqp->qp_num, attr->max_dest_rd_atomic, cur_state,
+                        new_state, ibqp->qp_type);
                goto out;
        }
 
This page took 0.039492 seconds and 5 git commands to generate.