提交 4f363882 编写于 作者: R Roi Dayan 提交者: Roland Dreier

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: NRoi Dayan <roid@mellanox.com>
Signed-off-by: NOr Gerlitz <ogerlitz@mellanox.com>

[ Use pr_warn(... instead of printk(KERN_WARNING ....  - Roland ]
Signed-off-by: NRoland Dreier <roland@purestorage.com>
上级 c1d786e6
...@@ -370,8 +370,8 @@ iscsi_iser_conn_bind(struct iscsi_cls_session *cls_session, ...@@ -370,8 +370,8 @@ iscsi_iser_conn_bind(struct iscsi_cls_session *cls_session,
/* binds the iSER connection retrieved from the previously /* binds the iSER connection retrieved from the previously
* connected ep_handle to the iSCSI layer connection. exchanges * connected ep_handle to the iSCSI layer connection. exchanges
* connection pointers */ * connection pointers */
iser_err("binding iscsi/iser conn %p %p to ib_conn %p\n", iser_info("binding iscsi/iser conn %p %p to ib_conn %p\n",
conn, conn->dd_data, ib_conn); conn, conn->dd_data, ib_conn);
iser_conn = conn->dd_data; iser_conn = conn->dd_data;
ib_conn->iser_conn = iser_conn; ib_conn->iser_conn = iser_conn;
iser_conn->ib_conn = ib_conn; iser_conn->ib_conn = ib_conn;
...@@ -475,28 +475,28 @@ iscsi_iser_set_param(struct iscsi_cls_conn *cls_conn, ...@@ -475,28 +475,28 @@ iscsi_iser_set_param(struct iscsi_cls_conn *cls_conn,
case ISCSI_PARAM_HDRDGST_EN: case ISCSI_PARAM_HDRDGST_EN:
sscanf(buf, "%d", &value); sscanf(buf, "%d", &value);
if (value) { if (value) {
printk(KERN_ERR "DataDigest wasn't negotiated to None"); iser_err("DataDigest wasn't negotiated to None");
return -EPROTO; return -EPROTO;
} }
break; break;
case ISCSI_PARAM_DATADGST_EN: case ISCSI_PARAM_DATADGST_EN:
sscanf(buf, "%d", &value); sscanf(buf, "%d", &value);
if (value) { if (value) {
printk(KERN_ERR "DataDigest wasn't negotiated to None"); iser_err("DataDigest wasn't negotiated to None");
return -EPROTO; return -EPROTO;
} }
break; break;
case ISCSI_PARAM_IFMARKER_EN: case ISCSI_PARAM_IFMARKER_EN:
sscanf(buf, "%d", &value); sscanf(buf, "%d", &value);
if (value) { if (value) {
printk(KERN_ERR "IFMarker wasn't negotiated to No"); iser_err("IFMarker wasn't negotiated to No");
return -EPROTO; return -EPROTO;
} }
break; break;
case ISCSI_PARAM_OFMARKER_EN: case ISCSI_PARAM_OFMARKER_EN:
sscanf(buf, "%d", &value); sscanf(buf, "%d", &value);
if (value) { if (value) {
printk(KERN_ERR "OFMarker wasn't negotiated to No"); iser_err("OFMarker wasn't negotiated to No");
return -EPROTO; return -EPROTO;
} }
break; break;
...@@ -596,7 +596,7 @@ iscsi_iser_ep_poll(struct iscsi_endpoint *ep, int timeout_ms) ...@@ -596,7 +596,7 @@ iscsi_iser_ep_poll(struct iscsi_endpoint *ep, int timeout_ms)
ib_conn->state == ISER_CONN_DOWN)) ib_conn->state == ISER_CONN_DOWN))
rc = -1; rc = -1;
iser_err("ib conn %p rc = %d\n", ib_conn, rc); iser_info("ib conn %p rc = %d\n", ib_conn, rc);
if (rc > 0) if (rc > 0)
return 1; /* success, this is the equivalent of POLLOUT */ return 1; /* success, this is the equivalent of POLLOUT */
...@@ -623,7 +623,7 @@ iscsi_iser_ep_disconnect(struct iscsi_endpoint *ep) ...@@ -623,7 +623,7 @@ iscsi_iser_ep_disconnect(struct iscsi_endpoint *ep)
iscsi_suspend_tx(ib_conn->iser_conn->iscsi_conn); iscsi_suspend_tx(ib_conn->iser_conn->iscsi_conn);
iser_err("ib conn %p state %d\n",ib_conn, ib_conn->state); iser_info("ib conn %p state %d\n", ib_conn, ib_conn->state);
iser_conn_terminate(ib_conn); iser_conn_terminate(ib_conn);
} }
...@@ -740,7 +740,7 @@ static int __init iser_init(void) ...@@ -740,7 +740,7 @@ static int __init iser_init(void)
iser_dbg("Starting iSER datamover...\n"); iser_dbg("Starting iSER datamover...\n");
if (iscsi_max_lun < 1) { if (iscsi_max_lun < 1) {
printk(KERN_ERR "Invalid max_lun value of %u\n", iscsi_max_lun); iser_err("Invalid max_lun value of %u\n", iscsi_max_lun);
return -EINVAL; return -EINVAL;
} }
......
...@@ -42,6 +42,7 @@ ...@@ -42,6 +42,7 @@
#include <linux/types.h> #include <linux/types.h>
#include <linux/net.h> #include <linux/net.h>
#include <linux/printk.h>
#include <scsi/libiscsi.h> #include <scsi/libiscsi.h>
#include <scsi/scsi_transport_iscsi.h> #include <scsi/scsi_transport_iscsi.h>
...@@ -69,15 +70,22 @@ ...@@ -69,15 +70,22 @@
#define iser_dbg(fmt, arg...) \ #define iser_dbg(fmt, arg...) \
do { \ do { \
if (iser_debug_level > 1) \ if (iser_debug_level > 2) \
printk(KERN_DEBUG PFX "%s:" fmt,\ printk(KERN_DEBUG PFX "%s:" fmt,\
__func__ , ## arg); \ __func__ , ## arg); \
} while (0) } while (0)
#define iser_warn(fmt, arg...) \ #define iser_warn(fmt, arg...) \
do { \
if (iser_debug_level > 1) \
pr_warn(PFX "%s:" fmt, \
__func__ , ## arg); \
} while (0)
#define iser_info(fmt, arg...) \
do { \ do { \
if (iser_debug_level > 0) \ if (iser_debug_level > 0) \
printk(KERN_DEBUG PFX "%s:" fmt,\ pr_info(PFX "%s:" fmt, \
__func__ , ## arg); \ __func__ , ## arg); \
} while (0) } while (0)
......
...@@ -74,8 +74,9 @@ static int iser_create_device_ib_res(struct iser_device *device) ...@@ -74,8 +74,9 @@ static int iser_create_device_ib_res(struct iser_device *device)
struct iser_cq_desc *cq_desc; struct iser_cq_desc *cq_desc;
device->cqs_used = min(ISER_MAX_CQ, device->ib_device->num_comp_vectors); device->cqs_used = min(ISER_MAX_CQ, device->ib_device->num_comp_vectors);
iser_err("using %d CQs, device %s supports %d vectors\n", device->cqs_used, iser_info("using %d CQs, device %s supports %d vectors\n",
device->ib_device->name, device->ib_device->num_comp_vectors); device->cqs_used, device->ib_device->name,
device->ib_device->num_comp_vectors);
device->cq_desc = kmalloc(sizeof(struct iser_cq_desc) * device->cqs_used, device->cq_desc = kmalloc(sizeof(struct iser_cq_desc) * device->cqs_used,
GFP_KERNEL); GFP_KERNEL);
...@@ -262,7 +263,7 @@ static int iser_create_ib_conn_res(struct iser_conn *ib_conn) ...@@ -262,7 +263,7 @@ static int iser_create_ib_conn_res(struct iser_conn *ib_conn)
min_index = index; min_index = index;
device->cq_active_qps[min_index]++; device->cq_active_qps[min_index]++;
mutex_unlock(&ig.connlist_mutex); mutex_unlock(&ig.connlist_mutex);
iser_err("cq index %d used for ib_conn %p\n", min_index, ib_conn); iser_info("cq index %d used for ib_conn %p\n", min_index, ib_conn);
init_attr.event_handler = iser_qp_event_callback; init_attr.event_handler = iser_qp_event_callback;
init_attr.qp_context = (void *)ib_conn; init_attr.qp_context = (void *)ib_conn;
...@@ -280,9 +281,9 @@ static int iser_create_ib_conn_res(struct iser_conn *ib_conn) ...@@ -280,9 +281,9 @@ static int iser_create_ib_conn_res(struct iser_conn *ib_conn)
goto out_err; goto out_err;
ib_conn->qp = ib_conn->cma_id->qp; ib_conn->qp = ib_conn->cma_id->qp;
iser_err("setting conn %p cma_id %p: fmr_pool %p qp %p\n", iser_info("setting conn %p cma_id %p: fmr_pool %p qp %p\n",
ib_conn, ib_conn->cma_id, ib_conn, ib_conn->cma_id,
ib_conn->fmr_pool, ib_conn->cma_id->qp); ib_conn->fmr_pool, ib_conn->cma_id->qp);
return ret; return ret;
out_err: out_err:
...@@ -299,9 +300,9 @@ static int iser_free_ib_conn_res(struct iser_conn *ib_conn, int can_destroy_id) ...@@ -299,9 +300,9 @@ static int iser_free_ib_conn_res(struct iser_conn *ib_conn, int can_destroy_id)
int cq_index; int cq_index;
BUG_ON(ib_conn == NULL); BUG_ON(ib_conn == NULL);
iser_err("freeing conn %p cma_id %p fmr pool %p qp %p\n", iser_info("freeing conn %p cma_id %p fmr pool %p qp %p\n",
ib_conn, ib_conn->cma_id, ib_conn, ib_conn->cma_id,
ib_conn->fmr_pool, ib_conn->qp); ib_conn->fmr_pool, ib_conn->qp);
/* qp is created only once both addr & route are resolved */ /* qp is created only once both addr & route are resolved */
if (ib_conn->fmr_pool != NULL) if (ib_conn->fmr_pool != NULL)
...@@ -379,7 +380,7 @@ static void iser_device_try_release(struct iser_device *device) ...@@ -379,7 +380,7 @@ static void iser_device_try_release(struct iser_device *device)
{ {
mutex_lock(&ig.device_list_mutex); mutex_lock(&ig.device_list_mutex);
device->refcount--; device->refcount--;
iser_err("device %p refcount %d\n",device,device->refcount); iser_info("device %p refcount %d\n", device, device->refcount);
if (!device->refcount) { if (!device->refcount) {
iser_free_device_ib_res(device); iser_free_device_ib_res(device);
list_del(&device->ig_list); 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,8 +559,8 @@ static int iser_cma_handler(struct rdma_cm_id *cma_id, struct rdma_cm_event *eve
{ {
int ret = 0; int ret = 0;
iser_err("event %d status %d conn %p id %p\n", iser_info("event %d status %d conn %p id %p\n",
event->event, event->status, cma_id->context, cma_id); event->event, event->status, cma_id->context, cma_id);
switch (event->event) { switch (event->event) {
case RDMA_CM_EVENT_ADDR_RESOLVED: case RDMA_CM_EVENT_ADDR_RESOLVED:
...@@ -619,8 +620,8 @@ int iser_connect(struct iser_conn *ib_conn, ...@@ -619,8 +620,8 @@ int iser_connect(struct iser_conn *ib_conn,
/* the device is known only --after-- address resolution */ /* the device is known only --after-- address resolution */
ib_conn->device = NULL; ib_conn->device = NULL;
iser_err("connecting to: %pI4, port 0x%x\n", iser_info("connecting to: %pI4, port 0x%x\n",
&dst_addr->sin_addr, dst_addr->sin_port); &dst_addr->sin_addr, dst_addr->sin_port);
ib_conn->state = ISER_CONN_PENDING; ib_conn->state = ISER_CONN_PENDING;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册