aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband
diff options
context:
space:
mode:
authorJack Morgenstein <jackm@dev.mellanox.co.il>2012-06-19 04:21:35 -0400
committerRoland Dreier <roland@purestorage.com>2012-07-08 21:05:06 -0400
commitb1d8eb5a213640f1be98a90e73a241d15b70045c (patch)
treec9bb2f511c0cddfec0e56da9f7c29e5f22ad1a40 /drivers/infiniband
parent752a50cab600c6d46c5a1921c6a6d2fb116c8a4b (diff)
IB/mlx4: Add debug prints
Define pr_fmt and add some pr_debug prints. Signed-off-by: Jack Morgenstein <jackm@dev.mellanox.co.il> Signed-off-by: Roland Dreier <roland@purestorage.com>
Diffstat (limited to 'drivers/infiniband')
-rw-r--r--drivers/infiniband/hw/mlx4/mad.c19
-rw-r--r--drivers/infiniband/hw/mlx4/main.c2
-rw-r--r--drivers/infiniband/hw/mlx4/mlx4_ib.h10
-rw-r--r--drivers/infiniband/hw/mlx4/qp.c27
4 files changed, 55 insertions, 3 deletions
diff --git a/drivers/infiniband/hw/mlx4/mad.c b/drivers/infiniband/hw/mlx4/mad.c
index 259b0670b51c..84786a9fb64f 100644
--- a/drivers/infiniband/hw/mlx4/mad.c
+++ b/drivers/infiniband/hw/mlx4/mad.c
@@ -242,6 +242,25 @@ static int ib_process_mad(struct ib_device *ibdev, int mad_flags, u8 port_num,
242 int err; 242 int err;
243 struct ib_port_attr pattr; 243 struct ib_port_attr pattr;
244 244
245 if (in_wc && in_wc->qp->qp_num) {
246 pr_debug("received MAD: slid:%d sqpn:%d "
247 "dlid_bits:%d dqpn:%d wc_flags:0x%x, cls %x, mtd %x, atr %x\n",
248 in_wc->slid, in_wc->src_qp,
249 in_wc->dlid_path_bits,
250 in_wc->qp->qp_num,
251 in_wc->wc_flags,
252 in_mad->mad_hdr.mgmt_class, in_mad->mad_hdr.method,
253 be16_to_cpu(in_mad->mad_hdr.attr_id));
254 if (in_wc->wc_flags & IB_WC_GRH) {
255 pr_debug("sgid_hi:0x%016llx sgid_lo:0x%016llx\n",
256 be64_to_cpu(in_grh->sgid.global.subnet_prefix),
257 be64_to_cpu(in_grh->sgid.global.interface_id));
258 pr_debug("dgid_hi:0x%016llx dgid_lo:0x%016llx\n",
259 be64_to_cpu(in_grh->dgid.global.subnet_prefix),
260 be64_to_cpu(in_grh->dgid.global.interface_id));
261 }
262 }
263
245 slid = in_wc ? in_wc->slid : be16_to_cpu(IB_LID_PERMISSIVE); 264 slid = in_wc ? in_wc->slid : be16_to_cpu(IB_LID_PERMISSIVE);
246 265
247 if (in_mad->mad_hdr.method == IB_MGMT_METHOD_TRAP && slid == 0) { 266 if (in_mad->mad_hdr.method == IB_MGMT_METHOD_TRAP && slid == 0) {
diff --git a/drivers/infiniband/hw/mlx4/main.c b/drivers/infiniband/hw/mlx4/main.c
index 3530c41fcd1f..5266b49c46ee 100644
--- a/drivers/infiniband/hw/mlx4/main.c
+++ b/drivers/infiniband/hw/mlx4/main.c
@@ -50,7 +50,7 @@
50#include "mlx4_ib.h" 50#include "mlx4_ib.h"
51#include "user.h" 51#include "user.h"
52 52
53#define DRV_NAME "mlx4_ib" 53#define DRV_NAME MLX4_IB_DRV_NAME
54#define DRV_VERSION "1.0" 54#define DRV_VERSION "1.0"
55#define DRV_RELDATE "April 4, 2008" 55#define DRV_RELDATE "April 4, 2008"
56 56
diff --git a/drivers/infiniband/hw/mlx4/mlx4_ib.h b/drivers/infiniband/hw/mlx4/mlx4_ib.h
index ff36655d23d3..5f298afaa81f 100644
--- a/drivers/infiniband/hw/mlx4/mlx4_ib.h
+++ b/drivers/infiniband/hw/mlx4/mlx4_ib.h
@@ -44,6 +44,16 @@
44#include <linux/mlx4/device.h> 44#include <linux/mlx4/device.h>
45#include <linux/mlx4/doorbell.h> 45#include <linux/mlx4/doorbell.h>
46 46
47#define MLX4_IB_DRV_NAME "mlx4_ib"
48
49#ifdef pr_fmt
50#undef pr_fmt
51#endif
52#define pr_fmt(fmt) "<" MLX4_IB_DRV_NAME "> %s: " fmt, __func__
53
54#define mlx4_ib_warn(ibdev, format, arg...) \
55 dev_warn((ibdev)->dma_device, MLX4_IB_DRV_NAME ": " format, ## arg)
56
47enum { 57enum {
48 MLX4_IB_SQ_MIN_WQE_SHIFT = 6, 58 MLX4_IB_SQ_MIN_WQE_SHIFT = 6,
49 MLX4_IB_MAX_HEADROOM = 2048 59 MLX4_IB_MAX_HEADROOM = 2048
diff --git a/drivers/infiniband/hw/mlx4/qp.c b/drivers/infiniband/hw/mlx4/qp.c
index 8d4ed24aef93..84b26963c8d4 100644
--- a/drivers/infiniband/hw/mlx4/qp.c
+++ b/drivers/infiniband/hw/mlx4/qp.c
@@ -1335,11 +1335,21 @@ int mlx4_ib_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr,
1335 cur_state = attr_mask & IB_QP_CUR_STATE ? attr->cur_qp_state : qp->state; 1335 cur_state = attr_mask & IB_QP_CUR_STATE ? attr->cur_qp_state : qp->state;
1336 new_state = attr_mask & IB_QP_STATE ? attr->qp_state : cur_state; 1336 new_state = attr_mask & IB_QP_STATE ? attr->qp_state : cur_state;
1337 1337
1338 if (!ib_modify_qp_is_ok(cur_state, new_state, ibqp->qp_type, attr_mask)) 1338 if (!ib_modify_qp_is_ok(cur_state, new_state, ibqp->qp_type, attr_mask)) {
1339 pr_debug("qpn 0x%x: invalid attribute mask specified "
1340 "for transition %d to %d. qp_type %d,"
1341 " attr_mask 0x%x\n",
1342 ibqp->qp_num, cur_state, new_state,
1343 ibqp->qp_type, attr_mask);
1339 goto out; 1344 goto out;
1345 }
1340 1346
1341 if ((attr_mask & IB_QP_PORT) && 1347 if ((attr_mask & IB_QP_PORT) &&
1342 (attr->port_num == 0 || attr->port_num > dev->dev->caps.num_ports)) { 1348 (attr->port_num == 0 || attr->port_num > dev->dev->caps.num_ports)) {
1349 pr_debug("qpn 0x%x: invalid port number (%d) specified "
1350 "for transition %d to %d. qp_type %d\n",
1351 ibqp->qp_num, attr->port_num, cur_state,
1352 new_state, ibqp->qp_type);
1343 goto out; 1353 goto out;
1344 } 1354 }
1345 1355
@@ -1350,17 +1360,30 @@ int mlx4_ib_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr,
1350 1360
1351 if (attr_mask & IB_QP_PKEY_INDEX) { 1361 if (attr_mask & IB_QP_PKEY_INDEX) {
1352 int p = attr_mask & IB_QP_PORT ? attr->port_num : qp->port; 1362 int p = attr_mask & IB_QP_PORT ? attr->port_num : qp->port;
1353 if (attr->pkey_index >= dev->dev->caps.pkey_table_len[p]) 1363 if (attr->pkey_index >= dev->dev->caps.pkey_table_len[p]) {
1364 pr_debug("qpn 0x%x: invalid pkey index (%d) specified "
1365 "for transition %d to %d. qp_type %d\n",
1366 ibqp->qp_num, attr->pkey_index, cur_state,
1367 new_state, ibqp->qp_type);
1354 goto out; 1368 goto out;
1369 }
1355 } 1370 }
1356 1371
1357 if (attr_mask & IB_QP_MAX_QP_RD_ATOMIC && 1372 if (attr_mask & IB_QP_MAX_QP_RD_ATOMIC &&
1358 attr->max_rd_atomic > dev->dev->caps.max_qp_init_rdma) { 1373 attr->max_rd_atomic > dev->dev->caps.max_qp_init_rdma) {
1374 pr_debug("qpn 0x%x: max_rd_atomic (%d) too large. "
1375 "Transition %d to %d. qp_type %d\n",
1376 ibqp->qp_num, attr->max_rd_atomic, cur_state,
1377 new_state, ibqp->qp_type);
1359 goto out; 1378 goto out;
1360 } 1379 }
1361 1380
1362 if (attr_mask & IB_QP_MAX_DEST_RD_ATOMIC && 1381 if (attr_mask & IB_QP_MAX_DEST_RD_ATOMIC &&
1363 attr->max_dest_rd_atomic > dev->dev->caps.max_qp_dest_rdma) { 1382 attr->max_dest_rd_atomic > dev->dev->caps.max_qp_dest_rdma) {
1383 pr_debug("qpn 0x%x: max_dest_rd_atomic (%d) too large. "
1384 "Transition %d to %d. qp_type %d\n",
1385 ibqp->qp_num, attr->max_dest_rd_atomic, cur_state,
1386 new_state, ibqp->qp_type);
1364 goto out; 1387 goto out;
1365 } 1388 }
1366 1389