diff options
author | Roi Dayan <roid@mellanox.com> | 2013-05-01 09:25:25 -0400 |
---|---|---|
committer | Roland Dreier <roland@purestorage.com> | 2013-05-01 20:34:13 -0400 |
commit | 4f3638826124b722b2c0dde5097bca182bf74125 (patch) | |
tree | 03e301c76a5ca9452b7ba74062e2efb7585d324b /drivers/infiniband/ulp/iser | |
parent | c1d786e68256001abe7b55f5f6831c8a996866b1 (diff) |
IB/iser: Move informational messages from error to info level
Introduce iser_info() and move informational messages that were
printed as errors to use that macro. Also, cleanup printk leftovers to
use the existing macros.
Signed-off-by: Roi Dayan <roid@mellanox.com>
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
[ Use pr_warn(... instead of printk(KERN_WARNING .... - Roland ]
Signed-off-by: Roland Dreier <roland@purestorage.com>
Diffstat (limited to 'drivers/infiniband/ulp/iser')
-rw-r--r-- | drivers/infiniband/ulp/iser/iscsi_iser.c | 18 | ||||
-rw-r--r-- | drivers/infiniband/ulp/iser/iscsi_iser.h | 12 | ||||
-rw-r--r-- | drivers/infiniband/ulp/iser/iser_verbs.c | 29 |
3 files changed, 34 insertions, 25 deletions
diff --git a/drivers/infiniband/ulp/iser/iscsi_iser.c b/drivers/infiniband/ulp/iser/iscsi_iser.c index 69e0d7c3b149..f19b0998a53c 100644 --- a/drivers/infiniband/ulp/iser/iscsi_iser.c +++ b/drivers/infiniband/ulp/iser/iscsi_iser.c | |||
@@ -370,8 +370,8 @@ iscsi_iser_conn_bind(struct iscsi_cls_session *cls_session, | |||
370 | /* binds the iSER connection retrieved from the previously | 370 | /* binds the iSER connection retrieved from the previously |
371 | * connected ep_handle to the iSCSI layer connection. exchanges | 371 | * connected ep_handle to the iSCSI layer connection. exchanges |
372 | * connection pointers */ | 372 | * connection pointers */ |
373 | iser_err("binding iscsi/iser conn %p %p to ib_conn %p\n", | 373 | iser_info("binding iscsi/iser conn %p %p to ib_conn %p\n", |
374 | conn, conn->dd_data, ib_conn); | 374 | conn, conn->dd_data, ib_conn); |
375 | iser_conn = conn->dd_data; | 375 | iser_conn = conn->dd_data; |
376 | ib_conn->iser_conn = iser_conn; | 376 | ib_conn->iser_conn = iser_conn; |
377 | iser_conn->ib_conn = ib_conn; | 377 | iser_conn->ib_conn = ib_conn; |
@@ -475,28 +475,28 @@ iscsi_iser_set_param(struct iscsi_cls_conn *cls_conn, | |||
475 | case ISCSI_PARAM_HDRDGST_EN: | 475 | case ISCSI_PARAM_HDRDGST_EN: |
476 | sscanf(buf, "%d", &value); | 476 | sscanf(buf, "%d", &value); |
477 | if (value) { | 477 | if (value) { |
478 | printk(KERN_ERR "DataDigest wasn't negotiated to None"); | 478 | iser_err("DataDigest wasn't negotiated to None"); |
479 | return -EPROTO; | 479 | return -EPROTO; |
480 | } | 480 | } |
481 | break; | 481 | break; |
482 | case ISCSI_PARAM_DATADGST_EN: | 482 | case ISCSI_PARAM_DATADGST_EN: |
483 | sscanf(buf, "%d", &value); | 483 | sscanf(buf, "%d", &value); |
484 | if (value) { | 484 | if (value) { |
485 | printk(KERN_ERR "DataDigest wasn't negotiated to None"); | 485 | iser_err("DataDigest wasn't negotiated to None"); |
486 | return -EPROTO; | 486 | return -EPROTO; |
487 | } | 487 | } |
488 | break; | 488 | break; |
489 | case ISCSI_PARAM_IFMARKER_EN: | 489 | case ISCSI_PARAM_IFMARKER_EN: |
490 | sscanf(buf, "%d", &value); | 490 | sscanf(buf, "%d", &value); |
491 | if (value) { | 491 | if (value) { |
492 | printk(KERN_ERR "IFMarker wasn't negotiated to No"); | 492 | iser_err("IFMarker wasn't negotiated to No"); |
493 | return -EPROTO; | 493 | return -EPROTO; |
494 | } | 494 | } |
495 | break; | 495 | break; |
496 | case ISCSI_PARAM_OFMARKER_EN: | 496 | case ISCSI_PARAM_OFMARKER_EN: |
497 | sscanf(buf, "%d", &value); | 497 | sscanf(buf, "%d", &value); |
498 | if (value) { | 498 | if (value) { |
499 | printk(KERN_ERR "OFMarker wasn't negotiated to No"); | 499 | iser_err("OFMarker wasn't negotiated to No"); |
500 | return -EPROTO; | 500 | return -EPROTO; |
501 | } | 501 | } |
502 | break; | 502 | break; |
@@ -596,7 +596,7 @@ iscsi_iser_ep_poll(struct iscsi_endpoint *ep, int timeout_ms) | |||
596 | ib_conn->state == ISER_CONN_DOWN)) | 596 | ib_conn->state == ISER_CONN_DOWN)) |
597 | rc = -1; | 597 | rc = -1; |
598 | 598 | ||
599 | iser_err("ib conn %p rc = %d\n", ib_conn, rc); | 599 | iser_info("ib conn %p rc = %d\n", ib_conn, rc); |
600 | 600 | ||
601 | if (rc > 0) | 601 | if (rc > 0) |
602 | return 1; /* success, this is the equivalent of POLLOUT */ | 602 | return 1; /* success, this is the equivalent of POLLOUT */ |
@@ -623,7 +623,7 @@ iscsi_iser_ep_disconnect(struct iscsi_endpoint *ep) | |||
623 | iscsi_suspend_tx(ib_conn->iser_conn->iscsi_conn); | 623 | iscsi_suspend_tx(ib_conn->iser_conn->iscsi_conn); |
624 | 624 | ||
625 | 625 | ||
626 | iser_err("ib conn %p state %d\n",ib_conn, ib_conn->state); | 626 | iser_info("ib conn %p state %d\n", ib_conn, ib_conn->state); |
627 | iser_conn_terminate(ib_conn); | 627 | iser_conn_terminate(ib_conn); |
628 | } | 628 | } |
629 | 629 | ||
@@ -740,7 +740,7 @@ static int __init iser_init(void) | |||
740 | iser_dbg("Starting iSER datamover...\n"); | 740 | iser_dbg("Starting iSER datamover...\n"); |
741 | 741 | ||
742 | if (iscsi_max_lun < 1) { | 742 | if (iscsi_max_lun < 1) { |
743 | printk(KERN_ERR "Invalid max_lun value of %u\n", iscsi_max_lun); | 743 | iser_err("Invalid max_lun value of %u\n", iscsi_max_lun); |
744 | return -EINVAL; | 744 | return -EINVAL; |
745 | } | 745 | } |
746 | 746 | ||
diff --git a/drivers/infiniband/ulp/iser/iscsi_iser.h b/drivers/infiniband/ulp/iser/iscsi_iser.h index 0da04bf82044..1a570886cc03 100644 --- a/drivers/infiniband/ulp/iser/iscsi_iser.h +++ b/drivers/infiniband/ulp/iser/iscsi_iser.h | |||
@@ -42,6 +42,7 @@ | |||
42 | 42 | ||
43 | #include <linux/types.h> | 43 | #include <linux/types.h> |
44 | #include <linux/net.h> | 44 | #include <linux/net.h> |
45 | #include <linux/printk.h> | ||
45 | #include <scsi/libiscsi.h> | 46 | #include <scsi/libiscsi.h> |
46 | #include <scsi/scsi_transport_iscsi.h> | 47 | #include <scsi/scsi_transport_iscsi.h> |
47 | 48 | ||
@@ -69,15 +70,22 @@ | |||
69 | 70 | ||
70 | #define iser_dbg(fmt, arg...) \ | 71 | #define iser_dbg(fmt, arg...) \ |
71 | do { \ | 72 | do { \ |
72 | if (iser_debug_level > 1) \ | 73 | if (iser_debug_level > 2) \ |
73 | printk(KERN_DEBUG PFX "%s:" fmt,\ | 74 | printk(KERN_DEBUG PFX "%s:" fmt,\ |
74 | __func__ , ## arg); \ | 75 | __func__ , ## arg); \ |
75 | } while (0) | 76 | } while (0) |
76 | 77 | ||
77 | #define iser_warn(fmt, arg...) \ | 78 | #define iser_warn(fmt, arg...) \ |
78 | do { \ | 79 | do { \ |
80 | if (iser_debug_level > 1) \ | ||
81 | pr_warn(PFX "%s:" fmt, \ | ||
82 | __func__ , ## arg); \ | ||
83 | } while (0) | ||
84 | |||
85 | #define iser_info(fmt, arg...) \ | ||
86 | do { \ | ||
79 | if (iser_debug_level > 0) \ | 87 | if (iser_debug_level > 0) \ |
80 | printk(KERN_DEBUG PFX "%s:" fmt,\ | 88 | pr_info(PFX "%s:" fmt, \ |
81 | __func__ , ## arg); \ | 89 | __func__ , ## arg); \ |
82 | } while (0) | 90 | } while (0) |
83 | 91 | ||
diff --git a/drivers/infiniband/ulp/iser/iser_verbs.c b/drivers/infiniband/ulp/iser/iser_verbs.c index 4debadc53106..13838ad3ce76 100644 --- a/drivers/infiniband/ulp/iser/iser_verbs.c +++ b/drivers/infiniband/ulp/iser/iser_verbs.c | |||
@@ -74,8 +74,9 @@ static int iser_create_device_ib_res(struct iser_device *device) | |||
74 | struct iser_cq_desc *cq_desc; | 74 | struct iser_cq_desc *cq_desc; |
75 | 75 | ||
76 | device->cqs_used = min(ISER_MAX_CQ, device->ib_device->num_comp_vectors); | 76 | device->cqs_used = min(ISER_MAX_CQ, device->ib_device->num_comp_vectors); |
77 | iser_err("using %d CQs, device %s supports %d vectors\n", device->cqs_used, | 77 | iser_info("using %d CQs, device %s supports %d vectors\n", |
78 | device->ib_device->name, device->ib_device->num_comp_vectors); | 78 | device->cqs_used, device->ib_device->name, |
79 | device->ib_device->num_comp_vectors); | ||
79 | 80 | ||
80 | device->cq_desc = kmalloc(sizeof(struct iser_cq_desc) * device->cqs_used, | 81 | device->cq_desc = kmalloc(sizeof(struct iser_cq_desc) * device->cqs_used, |
81 | GFP_KERNEL); | 82 | GFP_KERNEL); |
@@ -262,7 +263,7 @@ static int iser_create_ib_conn_res(struct iser_conn *ib_conn) | |||
262 | min_index = index; | 263 | min_index = index; |
263 | device->cq_active_qps[min_index]++; | 264 | device->cq_active_qps[min_index]++; |
264 | mutex_unlock(&ig.connlist_mutex); | 265 | mutex_unlock(&ig.connlist_mutex); |
265 | iser_err("cq index %d used for ib_conn %p\n", min_index, ib_conn); | 266 | iser_info("cq index %d used for ib_conn %p\n", min_index, ib_conn); |
266 | 267 | ||
267 | init_attr.event_handler = iser_qp_event_callback; | 268 | init_attr.event_handler = iser_qp_event_callback; |
268 | init_attr.qp_context = (void *)ib_conn; | 269 | init_attr.qp_context = (void *)ib_conn; |
@@ -280,9 +281,9 @@ static int iser_create_ib_conn_res(struct iser_conn *ib_conn) | |||
280 | goto out_err; | 281 | goto out_err; |
281 | 282 | ||
282 | ib_conn->qp = ib_conn->cma_id->qp; | 283 | ib_conn->qp = ib_conn->cma_id->qp; |
283 | iser_err("setting conn %p cma_id %p: fmr_pool %p qp %p\n", | 284 | iser_info("setting conn %p cma_id %p: fmr_pool %p qp %p\n", |
284 | ib_conn, ib_conn->cma_id, | 285 | ib_conn, ib_conn->cma_id, |
285 | ib_conn->fmr_pool, ib_conn->cma_id->qp); | 286 | ib_conn->fmr_pool, ib_conn->cma_id->qp); |
286 | return ret; | 287 | return ret; |
287 | 288 | ||
288 | out_err: | 289 | out_err: |
@@ -299,9 +300,9 @@ static int iser_free_ib_conn_res(struct iser_conn *ib_conn, int can_destroy_id) | |||
299 | int cq_index; | 300 | int cq_index; |
300 | BUG_ON(ib_conn == NULL); | 301 | BUG_ON(ib_conn == NULL); |
301 | 302 | ||
302 | iser_err("freeing conn %p cma_id %p fmr pool %p qp %p\n", | 303 | iser_info("freeing conn %p cma_id %p fmr pool %p qp %p\n", |
303 | ib_conn, ib_conn->cma_id, | 304 | ib_conn, ib_conn->cma_id, |
304 | ib_conn->fmr_pool, ib_conn->qp); | 305 | ib_conn->fmr_pool, ib_conn->qp); |
305 | 306 | ||
306 | /* qp is created only once both addr & route are resolved */ | 307 | /* qp is created only once both addr & route are resolved */ |
307 | if (ib_conn->fmr_pool != NULL) | 308 | if (ib_conn->fmr_pool != NULL) |
@@ -379,7 +380,7 @@ static void iser_device_try_release(struct iser_device *device) | |||
379 | { | 380 | { |
380 | mutex_lock(&ig.device_list_mutex); | 381 | mutex_lock(&ig.device_list_mutex); |
381 | device->refcount--; | 382 | device->refcount--; |
382 | iser_err("device %p refcount %d\n",device,device->refcount); | 383 | iser_info("device %p refcount %d\n", device, device->refcount); |
383 | if (!device->refcount) { | 384 | if (!device->refcount) { |
384 | iser_free_device_ib_res(device); | 385 | iser_free_device_ib_res(device); |
385 | list_del(&device->ig_list); | 386 | list_del(&device->ig_list); |
@@ -558,8 +559,8 @@ static int iser_cma_handler(struct rdma_cm_id *cma_id, struct rdma_cm_event *eve | |||
558 | { | 559 | { |
559 | int ret = 0; | 560 | int ret = 0; |
560 | 561 | ||
561 | iser_err("event %d status %d conn %p id %p\n", | 562 | iser_info("event %d status %d conn %p id %p\n", |
562 | event->event, event->status, cma_id->context, cma_id); | 563 | event->event, event->status, cma_id->context, cma_id); |
563 | 564 | ||
564 | switch (event->event) { | 565 | switch (event->event) { |
565 | case RDMA_CM_EVENT_ADDR_RESOLVED: | 566 | case RDMA_CM_EVENT_ADDR_RESOLVED: |
@@ -619,8 +620,8 @@ int iser_connect(struct iser_conn *ib_conn, | |||
619 | /* the device is known only --after-- address resolution */ | 620 | /* the device is known only --after-- address resolution */ |
620 | ib_conn->device = NULL; | 621 | ib_conn->device = NULL; |
621 | 622 | ||
622 | iser_err("connecting to: %pI4, port 0x%x\n", | 623 | iser_info("connecting to: %pI4, port 0x%x\n", |
623 | &dst_addr->sin_addr, dst_addr->sin_port); | 624 | &dst_addr->sin_addr, dst_addr->sin_port); |
624 | 625 | ||
625 | ib_conn->state = ISER_CONN_PENDING; | 626 | ib_conn->state = ISER_CONN_PENDING; |
626 | 627 | ||