diff options
author | Sagi Grimberg <sagig@mellanox.com> | 2014-12-07 06:12:03 -0500 |
---|---|---|
committer | Nicholas Bellinger <nab@linux-iscsi.org> | 2014-12-13 02:32:34 -0500 |
commit | 4c22e07ffdc947be61085c2a55bf564b9a8d50ee (patch) | |
tree | b003192979c4875b5f814a18a84eb152c3e69ccf /drivers/infiniband | |
parent | 24f412dd3838a1fecad7c702ee76039b818b310a (diff) |
iser-target: Adjust log levels and prettify some prints
debug_level 1 (warn): Include warning messages.
debug_level 2 (info): Include relevant info for control plane.
debug_level 3 (debug): Include relevant info in the IO path.
Also, added/removed some logging messages.
Signed-off-by: Sagi Grimberg <sagig@mellanox.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'drivers/infiniband')
-rw-r--r-- | drivers/infiniband/ulp/isert/ib_isert.c | 217 |
1 files changed, 108 insertions, 109 deletions
diff --git a/drivers/infiniband/ulp/isert/ib_isert.c b/drivers/infiniband/ulp/isert/ib_isert.c index 87b5e8983c19..0de507c40c5c 100644 --- a/drivers/infiniband/ulp/isert/ib_isert.c +++ b/drivers/infiniband/ulp/isert/ib_isert.c | |||
@@ -78,13 +78,13 @@ isert_qp_event_callback(struct ib_event *e, void *context) | |||
78 | { | 78 | { |
79 | struct isert_conn *isert_conn = (struct isert_conn *)context; | 79 | struct isert_conn *isert_conn = (struct isert_conn *)context; |
80 | 80 | ||
81 | isert_err("isert_qp_event_callback event: %d\n", e->event); | 81 | isert_err("conn %p event: %d\n", isert_conn, e->event); |
82 | switch (e->event) { | 82 | switch (e->event) { |
83 | case IB_EVENT_COMM_EST: | 83 | case IB_EVENT_COMM_EST: |
84 | rdma_notify(isert_conn->conn_cm_id, IB_EVENT_COMM_EST); | 84 | rdma_notify(isert_conn->conn_cm_id, IB_EVENT_COMM_EST); |
85 | break; | 85 | break; |
86 | case IB_EVENT_QP_LAST_WQE_REACHED: | 86 | case IB_EVENT_QP_LAST_WQE_REACHED: |
87 | isert_warn("Reached TX IB_EVENT_QP_LAST_WQE_REACHED:\n"); | 87 | isert_warn("Reached TX IB_EVENT_QP_LAST_WQE_REACHED\n"); |
88 | break; | 88 | break; |
89 | default: | 89 | default: |
90 | break; | 90 | break; |
@@ -149,18 +149,12 @@ isert_conn_setup_qp(struct isert_conn *isert_conn, struct rdma_cm_id *cma_id) | |||
149 | if (device->pi_capable) | 149 | if (device->pi_capable) |
150 | attr.create_flags |= IB_QP_CREATE_SIGNATURE_EN; | 150 | attr.create_flags |= IB_QP_CREATE_SIGNATURE_EN; |
151 | 151 | ||
152 | isert_dbg("isert_conn_setup_qp cma_id->device: %p\n", | ||
153 | cma_id->device); | ||
154 | isert_dbg("isert_conn_setup_qp conn_pd->device: %p\n", | ||
155 | isert_conn->conn_pd->device); | ||
156 | |||
157 | ret = rdma_create_qp(cma_id, isert_conn->conn_pd, &attr); | 152 | ret = rdma_create_qp(cma_id, isert_conn->conn_pd, &attr); |
158 | if (ret) { | 153 | if (ret) { |
159 | isert_err("rdma_create_qp failed for cma_id %d\n", ret); | 154 | isert_err("rdma_create_qp failed for cma_id %d\n", ret); |
160 | goto err; | 155 | goto err; |
161 | } | 156 | } |
162 | isert_conn->conn_qp = cma_id->qp; | 157 | isert_conn->conn_qp = cma_id->qp; |
163 | isert_dbg("rdma_create_qp() returned success >>>>>>>>>>>>>>>>>>>>>>>>>.\n"); | ||
164 | 158 | ||
165 | return 0; | 159 | return 0; |
166 | err: | 160 | err: |
@@ -174,7 +168,7 @@ err: | |||
174 | static void | 168 | static void |
175 | isert_cq_event_callback(struct ib_event *e, void *context) | 169 | isert_cq_event_callback(struct ib_event *e, void *context) |
176 | { | 170 | { |
177 | isert_dbg("isert_cq_event_callback event: %d\n", e->event); | 171 | isert_dbg("event: %d\n", e->event); |
178 | } | 172 | } |
179 | 173 | ||
180 | static int | 174 | static int |
@@ -208,6 +202,7 @@ isert_alloc_rx_descriptors(struct isert_conn *isert_conn) | |||
208 | } | 202 | } |
209 | 203 | ||
210 | isert_conn->conn_rx_desc_head = 0; | 204 | isert_conn->conn_rx_desc_head = 0; |
205 | |||
211 | return 0; | 206 | return 0; |
212 | 207 | ||
213 | dma_map_fail: | 208 | dma_map_fail: |
@@ -219,6 +214,8 @@ dma_map_fail: | |||
219 | kfree(isert_conn->conn_rx_descs); | 214 | kfree(isert_conn->conn_rx_descs); |
220 | isert_conn->conn_rx_descs = NULL; | 215 | isert_conn->conn_rx_descs = NULL; |
221 | fail: | 216 | fail: |
217 | isert_err("conn %p failed to allocate rx descriptors\n", isert_conn); | ||
218 | |||
222 | return -ENOMEM; | 219 | return -ENOMEM; |
223 | } | 220 | } |
224 | 221 | ||
@@ -350,6 +347,7 @@ isert_device_try_release(struct isert_device *device) | |||
350 | { | 347 | { |
351 | mutex_lock(&device_list_mutex); | 348 | mutex_lock(&device_list_mutex); |
352 | device->refcount--; | 349 | device->refcount--; |
350 | isert_info("device %p refcount %d\n", device, device->refcount); | ||
353 | if (!device->refcount) { | 351 | if (!device->refcount) { |
354 | isert_free_device_ib_res(device); | 352 | isert_free_device_ib_res(device); |
355 | list_del(&device->dev_node); | 353 | list_del(&device->dev_node); |
@@ -368,6 +366,8 @@ isert_device_find_by_ib_dev(struct rdma_cm_id *cma_id) | |||
368 | list_for_each_entry(device, &device_list, dev_node) { | 366 | list_for_each_entry(device, &device_list, dev_node) { |
369 | if (device->ib_device->node_guid == cma_id->device->node_guid) { | 367 | if (device->ib_device->node_guid == cma_id->device->node_guid) { |
370 | device->refcount++; | 368 | device->refcount++; |
369 | isert_info("Found iser device %p refcount %d\n", | ||
370 | device, device->refcount); | ||
371 | mutex_unlock(&device_list_mutex); | 371 | mutex_unlock(&device_list_mutex); |
372 | return device; | 372 | return device; |
373 | } | 373 | } |
@@ -391,6 +391,8 @@ isert_device_find_by_ib_dev(struct rdma_cm_id *cma_id) | |||
391 | 391 | ||
392 | device->refcount++; | 392 | device->refcount++; |
393 | list_add_tail(&device->dev_node, &device_list); | 393 | list_add_tail(&device->dev_node, &device_list); |
394 | isert_info("Created a new iser device %p refcount %d\n", | ||
395 | device, device->refcount); | ||
394 | mutex_unlock(&device_list_mutex); | 396 | mutex_unlock(&device_list_mutex); |
395 | 397 | ||
396 | return device; | 398 | return device; |
@@ -405,7 +407,7 @@ isert_conn_free_fastreg_pool(struct isert_conn *isert_conn) | |||
405 | if (list_empty(&isert_conn->conn_fr_pool)) | 407 | if (list_empty(&isert_conn->conn_fr_pool)) |
406 | return; | 408 | return; |
407 | 409 | ||
408 | isert_dbg("Freeing conn %p fastreg pool", isert_conn); | 410 | isert_info("Freeing conn %p fastreg pool", isert_conn); |
409 | 411 | ||
410 | list_for_each_entry_safe(fr_desc, tmp, | 412 | list_for_each_entry_safe(fr_desc, tmp, |
411 | &isert_conn->conn_fr_pool, list) { | 413 | &isert_conn->conn_fr_pool, list) { |
@@ -497,14 +499,14 @@ isert_create_fr_desc(struct ib_device *ib_device, struct ib_pd *pd, | |||
497 | ISCSI_ISER_SG_TABLESIZE); | 499 | ISCSI_ISER_SG_TABLESIZE); |
498 | if (IS_ERR(fr_desc->data_frpl)) { | 500 | if (IS_ERR(fr_desc->data_frpl)) { |
499 | isert_err("Failed to allocate data frpl err=%ld\n", | 501 | isert_err("Failed to allocate data frpl err=%ld\n", |
500 | PTR_ERR(fr_desc->data_frpl)); | 502 | PTR_ERR(fr_desc->data_frpl)); |
501 | return PTR_ERR(fr_desc->data_frpl); | 503 | return PTR_ERR(fr_desc->data_frpl); |
502 | } | 504 | } |
503 | 505 | ||
504 | fr_desc->data_mr = ib_alloc_fast_reg_mr(pd, ISCSI_ISER_SG_TABLESIZE); | 506 | fr_desc->data_mr = ib_alloc_fast_reg_mr(pd, ISCSI_ISER_SG_TABLESIZE); |
505 | if (IS_ERR(fr_desc->data_mr)) { | 507 | if (IS_ERR(fr_desc->data_mr)) { |
506 | isert_err("Failed to allocate data frmr err=%ld\n", | 508 | isert_err("Failed to allocate data frmr err=%ld\n", |
507 | PTR_ERR(fr_desc->data_mr)); | 509 | PTR_ERR(fr_desc->data_mr)); |
508 | ret = PTR_ERR(fr_desc->data_mr); | 510 | ret = PTR_ERR(fr_desc->data_mr); |
509 | goto err_data_frpl; | 511 | goto err_data_frpl; |
510 | } | 512 | } |
@@ -585,7 +587,7 @@ isert_connect_request(struct rdma_cm_id *cma_id, struct rdma_cm_event *event) | |||
585 | } | 587 | } |
586 | spin_unlock_bh(&np->np_thread_lock); | 588 | spin_unlock_bh(&np->np_thread_lock); |
587 | 589 | ||
588 | isert_dbg("Entering isert_connect_request cma_id: %p, context: %p\n", | 590 | isert_dbg("cma_id: %p, portal: %p\n", |
589 | cma_id, cma_id->context); | 591 | cma_id, cma_id->context); |
590 | 592 | ||
591 | isert_conn = kzalloc(sizeof(struct isert_conn), GFP_KERNEL); | 593 | isert_conn = kzalloc(sizeof(struct isert_conn), GFP_KERNEL); |
@@ -720,7 +722,7 @@ isert_connect_release(struct isert_conn *isert_conn) | |||
720 | struct ib_device *ib_dev = isert_conn->conn_cm_id->device; | 722 | struct ib_device *ib_dev = isert_conn->conn_cm_id->device; |
721 | struct isert_device *device = isert_conn->conn_device; | 723 | struct isert_device *device = isert_conn->conn_device; |
722 | 724 | ||
723 | isert_dbg("Entering isert_connect_release(): >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n"); | 725 | isert_dbg("conn %p\n", isert_conn); |
724 | 726 | ||
725 | if (device && device->use_fastreg) | 727 | if (device && device->use_fastreg) |
726 | isert_conn_free_fastreg_pool(isert_conn); | 728 | isert_conn_free_fastreg_pool(isert_conn); |
@@ -754,8 +756,6 @@ isert_connect_release(struct isert_conn *isert_conn) | |||
754 | 756 | ||
755 | if (device) | 757 | if (device) |
756 | isert_device_try_release(device); | 758 | isert_device_try_release(device); |
757 | |||
758 | isert_dbg("Leaving isert_connect_release >>>>>>>>>>>>\n"); | ||
759 | } | 759 | } |
760 | 760 | ||
761 | static void | 761 | static void |
@@ -782,8 +782,8 @@ isert_release_conn_kref(struct kref *kref) | |||
782 | struct isert_conn *isert_conn = container_of(kref, | 782 | struct isert_conn *isert_conn = container_of(kref, |
783 | struct isert_conn, conn_kref); | 783 | struct isert_conn, conn_kref); |
784 | 784 | ||
785 | isert_dbg("Calling isert_connect_release for final kref %s/%d\n", | 785 | isert_info("conn %p final kref %s/%d\n", isert_conn, current->comm, |
786 | current->comm, current->pid); | 786 | current->pid); |
787 | 787 | ||
788 | isert_connect_release(isert_conn); | 788 | isert_connect_release(isert_conn); |
789 | } | 789 | } |
@@ -891,15 +891,14 @@ isert_cma_handler(struct rdma_cm_id *cma_id, struct rdma_cm_event *event) | |||
891 | { | 891 | { |
892 | int ret = 0; | 892 | int ret = 0; |
893 | 893 | ||
894 | isert_dbg("isert_cma_handler: event %d status %d conn %p id %p\n", | 894 | isert_info("event %d status %d id %p np %p\n", event->event, |
895 | event->event, event->status, cma_id->context, cma_id); | 895 | event->status, cma_id, cma_id->context); |
896 | 896 | ||
897 | switch (event->event) { | 897 | switch (event->event) { |
898 | case RDMA_CM_EVENT_CONNECT_REQUEST: | 898 | case RDMA_CM_EVENT_CONNECT_REQUEST: |
899 | ret = isert_connect_request(cma_id, event); | 899 | ret = isert_connect_request(cma_id, event); |
900 | if (ret) | 900 | if (ret) |
901 | isert_err("isert_cma_handler failed RDMA_CM_EVENT: 0x%08x %d\n", | 901 | isert_err("failed handle connect request %d\n", ret); |
902 | event->event, ret); | ||
903 | break; | 902 | break; |
904 | case RDMA_CM_EVENT_ESTABLISHED: | 903 | case RDMA_CM_EVENT_ESTABLISHED: |
905 | isert_connected_handler(cma_id); | 904 | isert_connected_handler(cma_id); |
@@ -1021,9 +1020,9 @@ isert_init_tx_hdrs(struct isert_conn *isert_conn, | |||
1021 | tx_desc->tx_sg[0].length = ISER_HEADERS_LEN; | 1020 | tx_desc->tx_sg[0].length = ISER_HEADERS_LEN; |
1022 | tx_desc->tx_sg[0].lkey = isert_conn->conn_mr->lkey; | 1021 | tx_desc->tx_sg[0].lkey = isert_conn->conn_mr->lkey; |
1023 | 1022 | ||
1024 | isert_dbg("isert_init_tx_hdrs: Setup tx_sg[0].addr: 0x%llx length: %u" | 1023 | isert_dbg("Setup tx_sg[0].addr: 0x%llx length: %u lkey: 0x%x\n", |
1025 | " lkey: 0x%08x\n", tx_desc->tx_sg[0].addr, | 1024 | tx_desc->tx_sg[0].addr, tx_desc->tx_sg[0].length, |
1026 | tx_desc->tx_sg[0].length, tx_desc->tx_sg[0].lkey); | 1025 | tx_desc->tx_sg[0].lkey); |
1027 | 1026 | ||
1028 | return 0; | 1027 | return 0; |
1029 | } | 1028 | } |
@@ -1069,7 +1068,6 @@ isert_rdma_post_recvl(struct isert_conn *isert_conn) | |||
1069 | isert_conn->post_recv_buf_count--; | 1068 | isert_conn->post_recv_buf_count--; |
1070 | } | 1069 | } |
1071 | 1070 | ||
1072 | isert_dbg("ib_post_recv(): returned success >>>>>>>>>>>>>>>>>>>>>>>>\n"); | ||
1073 | return ret; | 1071 | return ret; |
1074 | } | 1072 | } |
1075 | 1073 | ||
@@ -1181,8 +1179,9 @@ isert_rx_login_req(struct isert_conn *isert_conn) | |||
1181 | memcpy(&login->req[0], (void *)&rx_desc->iscsi_header, ISCSI_HDR_LEN); | 1179 | memcpy(&login->req[0], (void *)&rx_desc->iscsi_header, ISCSI_HDR_LEN); |
1182 | 1180 | ||
1183 | size = min(rx_buflen, MAX_KEY_VALUE_PAIRS); | 1181 | size = min(rx_buflen, MAX_KEY_VALUE_PAIRS); |
1184 | isert_dbg("Using login payload size: %d, rx_buflen: %d MAX_KEY_VALUE_PAIRS: %d\n", | 1182 | isert_dbg("Using login payload size: %d, rx_buflen: %d " |
1185 | size, rx_buflen, MAX_KEY_VALUE_PAIRS); | 1183 | "MAX_KEY_VALUE_PAIRS: %d\n", size, rx_buflen, |
1184 | MAX_KEY_VALUE_PAIRS); | ||
1186 | memcpy(login->req_buf, &rx_desc->data[0], size); | 1185 | memcpy(login->req_buf, &rx_desc->data[0], size); |
1187 | 1186 | ||
1188 | if (login->first_request) { | 1187 | if (login->first_request) { |
@@ -1245,7 +1244,7 @@ isert_handle_scsi_cmd(struct isert_conn *isert_conn, | |||
1245 | sg_nents = max(1UL, DIV_ROUND_UP(imm_data_len, PAGE_SIZE)); | 1244 | sg_nents = max(1UL, DIV_ROUND_UP(imm_data_len, PAGE_SIZE)); |
1246 | 1245 | ||
1247 | isert_dbg("Copying Immediate SG: %p sg_nents: %u from %p imm_data_len: %d\n", | 1246 | isert_dbg("Copying Immediate SG: %p sg_nents: %u from %p imm_data_len: %d\n", |
1248 | sg, sg_nents, &rx_desc->data[0], imm_data_len); | 1247 | sg, sg_nents, &rx_desc->data[0], imm_data_len); |
1249 | 1248 | ||
1250 | sg_copy_from_buffer(sg, sg_nents, &rx_desc->data[0], imm_data_len); | 1249 | sg_copy_from_buffer(sg, sg_nents, &rx_desc->data[0], imm_data_len); |
1251 | 1250 | ||
@@ -1294,8 +1293,10 @@ isert_handle_iscsi_dataout(struct isert_conn *isert_conn, | |||
1294 | return -1; | 1293 | return -1; |
1295 | } | 1294 | } |
1296 | 1295 | ||
1297 | isert_dbg("Unsolicited DataOut unsol_data_len: %u, write_data_done: %u, data_length: %u\n", | 1296 | isert_dbg("Unsolicited DataOut unsol_data_len: %u, " |
1298 | unsol_data_len, cmd->write_data_done, cmd->se_cmd.data_length); | 1297 | "write_data_done: %u, data_length: %u\n", |
1298 | unsol_data_len, cmd->write_data_done, | ||
1299 | cmd->se_cmd.data_length); | ||
1299 | 1300 | ||
1300 | sg_off = cmd->write_data_done / PAGE_SIZE; | 1301 | sg_off = cmd->write_data_done / PAGE_SIZE; |
1301 | sg_start = &cmd->se_cmd.t_data_sg[sg_off]; | 1302 | sg_start = &cmd->se_cmd.t_data_sg[sg_off]; |
@@ -1305,12 +1306,13 @@ isert_handle_iscsi_dataout(struct isert_conn *isert_conn, | |||
1305 | * FIXME: Non page-aligned unsolicited_data out | 1306 | * FIXME: Non page-aligned unsolicited_data out |
1306 | */ | 1307 | */ |
1307 | if (page_off) { | 1308 | if (page_off) { |
1308 | isert_err("Received unexpected non-page aligned data payload\n"); | 1309 | isert_err("unexpected non-page aligned data payload\n"); |
1309 | dump_stack(); | 1310 | dump_stack(); |
1310 | return -1; | 1311 | return -1; |
1311 | } | 1312 | } |
1312 | isert_dbg("Copying DataOut: sg_start: %p, sg_off: %u sg_nents: %u from %p %u\n", | 1313 | isert_dbg("Copying DataOut: sg_start: %p, sg_off: %u " |
1313 | sg_start, sg_off, sg_nents, &rx_desc->data[0], unsol_data_len); | 1314 | "sg_nents: %u from %p %u\n", sg_start, sg_off, |
1315 | sg_nents, &rx_desc->data[0], unsol_data_len); | ||
1314 | 1316 | ||
1315 | sg_copy_from_buffer(sg_start, sg_nents, &rx_desc->data[0], | 1317 | sg_copy_from_buffer(sg_start, sg_nents, &rx_desc->data[0], |
1316 | unsol_data_len); | 1318 | unsol_data_len); |
@@ -1358,7 +1360,7 @@ isert_handle_text_cmd(struct isert_conn *isert_conn, struct isert_cmd *isert_cmd | |||
1358 | text_in = kzalloc(payload_length, GFP_KERNEL); | 1360 | text_in = kzalloc(payload_length, GFP_KERNEL); |
1359 | if (!text_in) { | 1361 | if (!text_in) { |
1360 | isert_err("Unable to allocate text_in of payload_length: %u\n", | 1362 | isert_err("Unable to allocate text_in of payload_length: %u\n", |
1361 | payload_length); | 1363 | payload_length); |
1362 | return -ENOMEM; | 1364 | return -ENOMEM; |
1363 | } | 1365 | } |
1364 | cmd->text_in_ptr = text_in; | 1366 | cmd->text_in_ptr = text_in; |
@@ -1384,7 +1386,7 @@ isert_rx_opcode(struct isert_conn *isert_conn, struct iser_rx_desc *rx_desc, | |||
1384 | if (sess->sess_ops->SessionType && | 1386 | if (sess->sess_ops->SessionType && |
1385 | (!(opcode & ISCSI_OP_TEXT) || !(opcode & ISCSI_OP_LOGOUT))) { | 1387 | (!(opcode & ISCSI_OP_TEXT) || !(opcode & ISCSI_OP_LOGOUT))) { |
1386 | isert_err("Got illegal opcode: 0x%02x in SessionType=Discovery," | 1388 | isert_err("Got illegal opcode: 0x%02x in SessionType=Discovery," |
1387 | " ignoring\n", opcode); | 1389 | " ignoring\n", opcode); |
1388 | return 0; | 1390 | return 0; |
1389 | } | 1391 | } |
1390 | 1392 | ||
@@ -1462,14 +1464,14 @@ isert_rx_do_work(struct iser_rx_desc *rx_desc, struct isert_conn *isert_conn) | |||
1462 | if (iser_hdr->flags & ISER_RSV) { | 1464 | if (iser_hdr->flags & ISER_RSV) { |
1463 | read_stag = be32_to_cpu(iser_hdr->read_stag); | 1465 | read_stag = be32_to_cpu(iser_hdr->read_stag); |
1464 | read_va = be64_to_cpu(iser_hdr->read_va); | 1466 | read_va = be64_to_cpu(iser_hdr->read_va); |
1465 | isert_dbg("ISER_RSV: read_stag: 0x%08x read_va: 0x%16llx\n", | 1467 | isert_dbg("ISER_RSV: read_stag: 0x%x read_va: 0x%llx\n", |
1466 | read_stag, (unsigned long long)read_va); | 1468 | read_stag, (unsigned long long)read_va); |
1467 | } | 1469 | } |
1468 | if (iser_hdr->flags & ISER_WSV) { | 1470 | if (iser_hdr->flags & ISER_WSV) { |
1469 | write_stag = be32_to_cpu(iser_hdr->write_stag); | 1471 | write_stag = be32_to_cpu(iser_hdr->write_stag); |
1470 | write_va = be64_to_cpu(iser_hdr->write_va); | 1472 | write_va = be64_to_cpu(iser_hdr->write_va); |
1471 | isert_dbg("ISER_WSV: write__stag: 0x%08x write_va: 0x%16llx\n", | 1473 | isert_dbg("ISER_WSV: write_stag: 0x%x write_va: 0x%llx\n", |
1472 | write_stag, (unsigned long long)write_va); | 1474 | write_stag, (unsigned long long)write_va); |
1473 | } | 1475 | } |
1474 | 1476 | ||
1475 | isert_dbg("ISER ISCSI_CTRL PDU\n"); | 1477 | isert_dbg("ISER ISCSI_CTRL PDU\n"); |
@@ -1498,12 +1500,12 @@ isert_rx_completion(struct iser_rx_desc *desc, struct isert_conn *isert_conn, | |||
1498 | if ((char *)desc == isert_conn->login_req_buf) { | 1500 | if ((char *)desc == isert_conn->login_req_buf) { |
1499 | rx_dma = isert_conn->login_req_dma; | 1501 | rx_dma = isert_conn->login_req_dma; |
1500 | rx_buflen = ISER_RX_LOGIN_SIZE; | 1502 | rx_buflen = ISER_RX_LOGIN_SIZE; |
1501 | isert_dbg("ISER login_buf: Using rx_dma: 0x%llx, rx_buflen: %d\n", | 1503 | isert_dbg("login_buf: Using rx_dma: 0x%llx, rx_buflen: %d\n", |
1502 | rx_dma, rx_buflen); | 1504 | rx_dma, rx_buflen); |
1503 | } else { | 1505 | } else { |
1504 | rx_dma = desc->dma_addr; | 1506 | rx_dma = desc->dma_addr; |
1505 | rx_buflen = ISER_RX_PAYLOAD_SIZE; | 1507 | rx_buflen = ISER_RX_PAYLOAD_SIZE; |
1506 | isert_dbg("ISER req_buf: Using rx_dma: 0x%llx, rx_buflen: %d\n", | 1508 | isert_dbg("req_buf: Using rx_dma: 0x%llx, rx_buflen: %d\n", |
1507 | rx_dma, rx_buflen); | 1509 | rx_dma, rx_buflen); |
1508 | } | 1510 | } |
1509 | 1511 | ||
@@ -1533,8 +1535,8 @@ isert_rx_completion(struct iser_rx_desc *desc, struct isert_conn *isert_conn, | |||
1533 | DMA_FROM_DEVICE); | 1535 | DMA_FROM_DEVICE); |
1534 | 1536 | ||
1535 | isert_conn->post_recv_buf_count--; | 1537 | isert_conn->post_recv_buf_count--; |
1536 | isert_dbg("iSERT: Decremented post_recv_buf_count: %d\n", | 1538 | isert_dbg("Decremented post_recv_buf_count: %d\n", |
1537 | isert_conn->post_recv_buf_count); | 1539 | isert_conn->post_recv_buf_count); |
1538 | 1540 | ||
1539 | if ((char *)desc == isert_conn->login_req_buf) | 1541 | if ((char *)desc == isert_conn->login_req_buf) |
1540 | return; | 1542 | return; |
@@ -1579,7 +1581,7 @@ isert_map_data_buf(struct isert_conn *isert_conn, struct isert_cmd *isert_cmd, | |||
1579 | } | 1581 | } |
1580 | 1582 | ||
1581 | isert_dbg("Mapped cmd: %p count: %u sg: %p sg_nents: %u rdma_len %d\n", | 1583 | isert_dbg("Mapped cmd: %p count: %u sg: %p sg_nents: %u rdma_len %d\n", |
1582 | isert_cmd, data->dma_nents, data->sg, data->nents, data->len); | 1584 | isert_cmd, data->dma_nents, data->sg, data->nents, data->len); |
1583 | 1585 | ||
1584 | return 0; | 1586 | return 0; |
1585 | } | 1587 | } |
@@ -1600,21 +1602,21 @@ isert_unmap_cmd(struct isert_cmd *isert_cmd, struct isert_conn *isert_conn) | |||
1600 | { | 1602 | { |
1601 | struct isert_rdma_wr *wr = &isert_cmd->rdma_wr; | 1603 | struct isert_rdma_wr *wr = &isert_cmd->rdma_wr; |
1602 | 1604 | ||
1603 | isert_dbg("isert_unmap_cmd: %p\n", isert_cmd); | 1605 | isert_dbg("Cmd %p\n", isert_cmd); |
1604 | 1606 | ||
1605 | if (wr->data.sg) { | 1607 | if (wr->data.sg) { |
1606 | isert_dbg("isert_unmap_cmd: %p unmap_sg op\n", isert_cmd); | 1608 | isert_dbg("Cmd %p unmap_sg op\n", isert_cmd); |
1607 | isert_unmap_data_buf(isert_conn, &wr->data); | 1609 | isert_unmap_data_buf(isert_conn, &wr->data); |
1608 | } | 1610 | } |
1609 | 1611 | ||
1610 | if (wr->send_wr) { | 1612 | if (wr->send_wr) { |
1611 | isert_dbg("isert_unmap_cmd: %p free send_wr\n", isert_cmd); | 1613 | isert_dbg("Cmd %p free send_wr\n", isert_cmd); |
1612 | kfree(wr->send_wr); | 1614 | kfree(wr->send_wr); |
1613 | wr->send_wr = NULL; | 1615 | wr->send_wr = NULL; |
1614 | } | 1616 | } |
1615 | 1617 | ||
1616 | if (wr->ib_sge) { | 1618 | if (wr->ib_sge) { |
1617 | isert_dbg("isert_unmap_cmd: %p free ib_sge\n", isert_cmd); | 1619 | isert_dbg("Cmd %p free ib_sge\n", isert_cmd); |
1618 | kfree(wr->ib_sge); | 1620 | kfree(wr->ib_sge); |
1619 | wr->ib_sge = NULL; | 1621 | wr->ib_sge = NULL; |
1620 | } | 1622 | } |
@@ -1626,11 +1628,10 @@ isert_unreg_rdma(struct isert_cmd *isert_cmd, struct isert_conn *isert_conn) | |||
1626 | struct isert_rdma_wr *wr = &isert_cmd->rdma_wr; | 1628 | struct isert_rdma_wr *wr = &isert_cmd->rdma_wr; |
1627 | LIST_HEAD(unmap_list); | 1629 | LIST_HEAD(unmap_list); |
1628 | 1630 | ||
1629 | isert_dbg("unreg_fastreg_cmd: %p\n", isert_cmd); | 1631 | isert_dbg("Cmd %p\n", isert_cmd); |
1630 | 1632 | ||
1631 | if (wr->fr_desc) { | 1633 | if (wr->fr_desc) { |
1632 | isert_dbg("unreg_fastreg_cmd: %p free fr_desc %p\n", | 1634 | isert_dbg("Cmd %p free fr_desc %p\n", isert_cmd, wr->fr_desc); |
1633 | isert_cmd, wr->fr_desc); | ||
1634 | if (wr->fr_desc->ind & ISERT_PROTECTED) { | 1635 | if (wr->fr_desc->ind & ISERT_PROTECTED) { |
1635 | isert_unmap_data_buf(isert_conn, &wr->prot); | 1636 | isert_unmap_data_buf(isert_conn, &wr->prot); |
1636 | wr->fr_desc->ind &= ~ISERT_PROTECTED; | 1637 | wr->fr_desc->ind &= ~ISERT_PROTECTED; |
@@ -1642,7 +1643,7 @@ isert_unreg_rdma(struct isert_cmd *isert_cmd, struct isert_conn *isert_conn) | |||
1642 | } | 1643 | } |
1643 | 1644 | ||
1644 | if (wr->data.sg) { | 1645 | if (wr->data.sg) { |
1645 | isert_dbg("unreg_fastreg_cmd: %p unmap_sg op\n", isert_cmd); | 1646 | isert_dbg("Cmd %p unmap_sg op\n", isert_cmd); |
1646 | isert_unmap_data_buf(isert_conn, &wr->data); | 1647 | isert_unmap_data_buf(isert_conn, &wr->data); |
1647 | } | 1648 | } |
1648 | 1649 | ||
@@ -1658,7 +1659,7 @@ isert_put_cmd(struct isert_cmd *isert_cmd, bool comp_err) | |||
1658 | struct iscsi_conn *conn = isert_conn->conn; | 1659 | struct iscsi_conn *conn = isert_conn->conn; |
1659 | struct isert_device *device = isert_conn->conn_device; | 1660 | struct isert_device *device = isert_conn->conn_device; |
1660 | 1661 | ||
1661 | isert_dbg("Entering isert_put_cmd: %p\n", isert_cmd); | 1662 | isert_dbg("Cmd %p\n", isert_cmd); |
1662 | 1663 | ||
1663 | switch (cmd->iscsi_opcode) { | 1664 | switch (cmd->iscsi_opcode) { |
1664 | case ISCSI_OP_SCSI_CMD: | 1665 | case ISCSI_OP_SCSI_CMD: |
@@ -1727,7 +1728,7 @@ static void | |||
1727 | isert_unmap_tx_desc(struct iser_tx_desc *tx_desc, struct ib_device *ib_dev) | 1728 | isert_unmap_tx_desc(struct iser_tx_desc *tx_desc, struct ib_device *ib_dev) |
1728 | { | 1729 | { |
1729 | if (tx_desc->dma_addr != 0) { | 1730 | if (tx_desc->dma_addr != 0) { |
1730 | isert_dbg("Calling ib_dma_unmap_single for tx_desc->dma_addr\n"); | 1731 | isert_dbg("unmap single for tx_desc->dma_addr\n"); |
1731 | ib_dma_unmap_single(ib_dev, tx_desc->dma_addr, | 1732 | ib_dma_unmap_single(ib_dev, tx_desc->dma_addr, |
1732 | ISER_HEADERS_LEN, DMA_TO_DEVICE); | 1733 | ISER_HEADERS_LEN, DMA_TO_DEVICE); |
1733 | tx_desc->dma_addr = 0; | 1734 | tx_desc->dma_addr = 0; |
@@ -1739,7 +1740,7 @@ isert_completion_put(struct iser_tx_desc *tx_desc, struct isert_cmd *isert_cmd, | |||
1739 | struct ib_device *ib_dev, bool comp_err) | 1740 | struct ib_device *ib_dev, bool comp_err) |
1740 | { | 1741 | { |
1741 | if (isert_cmd->pdu_buf_dma != 0) { | 1742 | if (isert_cmd->pdu_buf_dma != 0) { |
1742 | isert_dbg("Calling ib_dma_unmap_single for isert_cmd->pdu_buf_dma\n"); | 1743 | isert_dbg("unmap single for isert_cmd->pdu_buf_dma\n"); |
1743 | ib_dma_unmap_single(ib_dev, isert_cmd->pdu_buf_dma, | 1744 | ib_dma_unmap_single(ib_dev, isert_cmd->pdu_buf_dma, |
1744 | isert_cmd->pdu_buf_len, DMA_TO_DEVICE); | 1745 | isert_cmd->pdu_buf_len, DMA_TO_DEVICE); |
1745 | isert_cmd->pdu_buf_dma = 0; | 1746 | isert_cmd->pdu_buf_dma = 0; |
@@ -1780,12 +1781,12 @@ isert_check_pi_status(struct se_cmd *se_cmd, struct ib_mr *sig_mr) | |||
1780 | do_div(sec_offset_err, block_size); | 1781 | do_div(sec_offset_err, block_size); |
1781 | se_cmd->bad_sector = sec_offset_err + se_cmd->t_task_lba; | 1782 | se_cmd->bad_sector = sec_offset_err + se_cmd->t_task_lba; |
1782 | 1783 | ||
1783 | isert_err("isert: PI error found type %d at sector 0x%llx " | 1784 | isert_err("PI error found type %d at sector 0x%llx " |
1784 | "expected 0x%x vs actual 0x%x\n", | 1785 | "expected 0x%x vs actual 0x%x\n", |
1785 | mr_status.sig_err.err_type, | 1786 | mr_status.sig_err.err_type, |
1786 | (unsigned long long)se_cmd->bad_sector, | 1787 | (unsigned long long)se_cmd->bad_sector, |
1787 | mr_status.sig_err.expected, | 1788 | mr_status.sig_err.expected, |
1788 | mr_status.sig_err.actual); | 1789 | mr_status.sig_err.actual); |
1789 | ret = 1; | 1790 | ret = 1; |
1790 | } | 1791 | } |
1791 | 1792 | ||
@@ -1863,32 +1864,30 @@ isert_do_control_comp(struct work_struct *work) | |||
1863 | struct ib_device *ib_dev = isert_conn->conn_cm_id->device; | 1864 | struct ib_device *ib_dev = isert_conn->conn_cm_id->device; |
1864 | struct iscsi_cmd *cmd = isert_cmd->iscsi_cmd; | 1865 | struct iscsi_cmd *cmd = isert_cmd->iscsi_cmd; |
1865 | 1866 | ||
1867 | isert_dbg("Cmd %p i_state %d\n", isert_cmd, cmd->i_state); | ||
1868 | |||
1866 | switch (cmd->i_state) { | 1869 | switch (cmd->i_state) { |
1867 | case ISTATE_SEND_TASKMGTRSP: | 1870 | case ISTATE_SEND_TASKMGTRSP: |
1868 | isert_dbg("Calling iscsit_tmr_post_handler >>>>>>>>>>>>>>>>>\n"); | ||
1869 | |||
1870 | iscsit_tmr_post_handler(cmd, cmd->conn); | 1871 | iscsit_tmr_post_handler(cmd, cmd->conn); |
1871 | |||
1872 | cmd->i_state = ISTATE_SENT_STATUS; | 1872 | cmd->i_state = ISTATE_SENT_STATUS; |
1873 | isert_completion_put(&isert_cmd->tx_desc, isert_cmd, ib_dev, false); | 1873 | isert_completion_put(&isert_cmd->tx_desc, isert_cmd, |
1874 | ib_dev, false); | ||
1874 | break; | 1875 | break; |
1875 | case ISTATE_SEND_REJECT: | 1876 | case ISTATE_SEND_REJECT: |
1876 | isert_dbg("Got isert_do_control_comp ISTATE_SEND_REJECT: >>>\n"); | ||
1877 | |||
1878 | cmd->i_state = ISTATE_SENT_STATUS; | 1877 | cmd->i_state = ISTATE_SENT_STATUS; |
1879 | isert_completion_put(&isert_cmd->tx_desc, isert_cmd, ib_dev, false); | 1878 | isert_completion_put(&isert_cmd->tx_desc, isert_cmd, |
1879 | ib_dev, false); | ||
1880 | break; | 1880 | break; |
1881 | case ISTATE_SEND_LOGOUTRSP: | 1881 | case ISTATE_SEND_LOGOUTRSP: |
1882 | isert_dbg("Calling iscsit_logout_post_handler >>>>>>>>>>>>>>\n"); | ||
1883 | |||
1884 | iscsit_logout_post_handler(cmd, cmd->conn); | 1882 | iscsit_logout_post_handler(cmd, cmd->conn); |
1885 | break; | 1883 | break; |
1886 | case ISTATE_SEND_TEXTRSP: | 1884 | case ISTATE_SEND_TEXTRSP: |
1887 | cmd->i_state = ISTATE_SENT_STATUS; | 1885 | cmd->i_state = ISTATE_SENT_STATUS; |
1888 | isert_completion_put(&isert_cmd->tx_desc, isert_cmd, ib_dev, false); | 1886 | isert_completion_put(&isert_cmd->tx_desc, isert_cmd, |
1887 | ib_dev, false); | ||
1889 | break; | 1888 | break; |
1890 | default: | 1889 | default: |
1891 | isert_err("Unknown do_control_comp i_state %d\n", cmd->i_state); | 1890 | isert_err("Unknown i_state %d\n", cmd->i_state); |
1892 | dump_stack(); | 1891 | dump_stack(); |
1893 | break; | 1892 | break; |
1894 | } | 1893 | } |
@@ -1931,27 +1930,25 @@ isert_send_completion(struct iser_tx_desc *tx_desc, | |||
1931 | } | 1930 | } |
1932 | wr = &isert_cmd->rdma_wr; | 1931 | wr = &isert_cmd->rdma_wr; |
1933 | 1932 | ||
1933 | isert_dbg("Cmd %p iser_ib_op %d\n", isert_cmd, wr->iser_ib_op); | ||
1934 | |||
1934 | switch (wr->iser_ib_op) { | 1935 | switch (wr->iser_ib_op) { |
1935 | case ISER_IB_RECV: | 1936 | case ISER_IB_RECV: |
1936 | isert_err("isert_send_completion: Got ISER_IB_RECV\n"); | 1937 | isert_err("Got ISER_IB_RECV\n"); |
1937 | dump_stack(); | 1938 | dump_stack(); |
1938 | break; | 1939 | break; |
1939 | case ISER_IB_SEND: | 1940 | case ISER_IB_SEND: |
1940 | isert_dbg("isert_send_completion: Got ISER_IB_SEND\n"); | ||
1941 | isert_response_completion(tx_desc, isert_cmd, | 1941 | isert_response_completion(tx_desc, isert_cmd, |
1942 | isert_conn, ib_dev); | 1942 | isert_conn, ib_dev); |
1943 | break; | 1943 | break; |
1944 | case ISER_IB_RDMA_WRITE: | 1944 | case ISER_IB_RDMA_WRITE: |
1945 | isert_dbg("isert_send_completion: Got ISER_IB_RDMA_WRITE\n"); | ||
1946 | isert_completion_rdma_write(tx_desc, isert_cmd); | 1945 | isert_completion_rdma_write(tx_desc, isert_cmd); |
1947 | break; | 1946 | break; |
1948 | case ISER_IB_RDMA_READ: | 1947 | case ISER_IB_RDMA_READ: |
1949 | isert_dbg("isert_send_completion: Got ISER_IB_RDMA_READ:\n"); | ||
1950 | |||
1951 | isert_completion_rdma_read(tx_desc, isert_cmd); | 1948 | isert_completion_rdma_read(tx_desc, isert_cmd); |
1952 | break; | 1949 | break; |
1953 | default: | 1950 | default: |
1954 | isert_err("Unknown wr->iser_ib_op: 0x%02x\n", wr->iser_ib_op); | 1951 | isert_err("Unknown wr->iser_ib_op: 0x%x\n", wr->iser_ib_op); |
1955 | dump_stack(); | 1952 | dump_stack(); |
1956 | break; | 1953 | break; |
1957 | } | 1954 | } |
@@ -2121,7 +2118,7 @@ isert_put_response(struct iscsi_conn *conn, struct iscsi_cmd *cmd) | |||
2121 | 2118 | ||
2122 | isert_init_send_wr(isert_conn, isert_cmd, send_wr); | 2119 | isert_init_send_wr(isert_conn, isert_cmd, send_wr); |
2123 | 2120 | ||
2124 | isert_dbg("Posting SCSI Response IB_WR_SEND >>>>>>>>>>>>>>>>>>>>>>\n"); | 2121 | isert_dbg("Posting SCSI Response\n"); |
2125 | 2122 | ||
2126 | return isert_post_response(isert_conn, isert_cmd); | 2123 | return isert_post_response(isert_conn, isert_cmd); |
2127 | } | 2124 | } |
@@ -2179,7 +2176,7 @@ isert_put_nopin(struct iscsi_cmd *cmd, struct iscsi_conn *conn, | |||
2179 | isert_init_tx_hdrs(isert_conn, &isert_cmd->tx_desc); | 2176 | isert_init_tx_hdrs(isert_conn, &isert_cmd->tx_desc); |
2180 | isert_init_send_wr(isert_conn, isert_cmd, send_wr); | 2177 | isert_init_send_wr(isert_conn, isert_cmd, send_wr); |
2181 | 2178 | ||
2182 | isert_dbg("Posting NOPIN Response IB_WR_SEND >>>>>>>>>>>>>>>>>>>>>>\n"); | 2179 | isert_dbg("conn %p Posting NOPIN Response\n", isert_conn); |
2183 | 2180 | ||
2184 | return isert_post_response(isert_conn, isert_cmd); | 2181 | return isert_post_response(isert_conn, isert_cmd); |
2185 | } | 2182 | } |
@@ -2197,7 +2194,7 @@ isert_put_logout_rsp(struct iscsi_cmd *cmd, struct iscsi_conn *conn) | |||
2197 | isert_init_tx_hdrs(isert_conn, &isert_cmd->tx_desc); | 2194 | isert_init_tx_hdrs(isert_conn, &isert_cmd->tx_desc); |
2198 | isert_init_send_wr(isert_conn, isert_cmd, send_wr); | 2195 | isert_init_send_wr(isert_conn, isert_cmd, send_wr); |
2199 | 2196 | ||
2200 | isert_dbg("Posting Logout Response IB_WR_SEND >>>>>>>>>>>>>>>>>>>>>>\n"); | 2197 | isert_dbg("conn %p Posting Logout Response\n", isert_conn); |
2201 | 2198 | ||
2202 | return isert_post_response(isert_conn, isert_cmd); | 2199 | return isert_post_response(isert_conn, isert_cmd); |
2203 | } | 2200 | } |
@@ -2215,7 +2212,7 @@ isert_put_tm_rsp(struct iscsi_cmd *cmd, struct iscsi_conn *conn) | |||
2215 | isert_init_tx_hdrs(isert_conn, &isert_cmd->tx_desc); | 2212 | isert_init_tx_hdrs(isert_conn, &isert_cmd->tx_desc); |
2216 | isert_init_send_wr(isert_conn, isert_cmd, send_wr); | 2213 | isert_init_send_wr(isert_conn, isert_cmd, send_wr); |
2217 | 2214 | ||
2218 | isert_dbg("Posting Task Management Response IB_WR_SEND >>>>>>>>>>>>>>>>>>>>>>\n"); | 2215 | isert_dbg("conn %p Posting Task Management Response\n", isert_conn); |
2219 | 2216 | ||
2220 | return isert_post_response(isert_conn, isert_cmd); | 2217 | return isert_post_response(isert_conn, isert_cmd); |
2221 | } | 2218 | } |
@@ -2247,7 +2244,7 @@ isert_put_reject(struct iscsi_cmd *cmd, struct iscsi_conn *conn) | |||
2247 | 2244 | ||
2248 | isert_init_send_wr(isert_conn, isert_cmd, send_wr); | 2245 | isert_init_send_wr(isert_conn, isert_cmd, send_wr); |
2249 | 2246 | ||
2250 | isert_dbg("Posting Reject IB_WR_SEND >>>>>>>>>>>>>>>>>>>>>>\n"); | 2247 | isert_dbg("conn %p Posting Reject\n", isert_conn); |
2251 | 2248 | ||
2252 | return isert_post_response(isert_conn, isert_cmd); | 2249 | return isert_post_response(isert_conn, isert_cmd); |
2253 | } | 2250 | } |
@@ -2287,7 +2284,7 @@ isert_put_text_rsp(struct iscsi_cmd *cmd, struct iscsi_conn *conn) | |||
2287 | } | 2284 | } |
2288 | isert_init_send_wr(isert_conn, isert_cmd, send_wr); | 2285 | isert_init_send_wr(isert_conn, isert_cmd, send_wr); |
2289 | 2286 | ||
2290 | isert_dbg("Posting Text Response IB_WR_SEND >>>>>>>>>>>>>>>>>>>>>>\n"); | 2287 | isert_dbg("conn %p Text Reject\n", isert_conn); |
2291 | 2288 | ||
2292 | return isert_post_response(isert_conn, isert_cmd); | 2289 | return isert_post_response(isert_conn, isert_cmd); |
2293 | } | 2290 | } |
@@ -2315,17 +2312,18 @@ isert_build_rdma_wr(struct isert_conn *isert_conn, struct isert_cmd *isert_cmd, | |||
2315 | * Perform mapping of TCM scatterlist memory ib_sge dma_addr. | 2312 | * Perform mapping of TCM scatterlist memory ib_sge dma_addr. |
2316 | */ | 2313 | */ |
2317 | for_each_sg(sg_start, tmp_sg, sg_nents, i) { | 2314 | for_each_sg(sg_start, tmp_sg, sg_nents, i) { |
2318 | isert_dbg("ISER RDMA from SGL dma_addr: 0x%16llx dma_len: %u, page_off: %u\n", | 2315 | isert_dbg("RDMA from SGL dma_addr: 0x%llx dma_len: %u, " |
2319 | (unsigned long long)tmp_sg->dma_address, | 2316 | "page_off: %u\n", |
2320 | tmp_sg->length, page_off); | 2317 | (unsigned long long)tmp_sg->dma_address, |
2318 | tmp_sg->length, page_off); | ||
2321 | 2319 | ||
2322 | ib_sge->addr = ib_sg_dma_address(ib_dev, tmp_sg) + page_off; | 2320 | ib_sge->addr = ib_sg_dma_address(ib_dev, tmp_sg) + page_off; |
2323 | ib_sge->length = min_t(u32, data_left, | 2321 | ib_sge->length = min_t(u32, data_left, |
2324 | ib_sg_dma_len(ib_dev, tmp_sg) - page_off); | 2322 | ib_sg_dma_len(ib_dev, tmp_sg) - page_off); |
2325 | ib_sge->lkey = isert_conn->conn_mr->lkey; | 2323 | ib_sge->lkey = isert_conn->conn_mr->lkey; |
2326 | 2324 | ||
2327 | isert_dbg("RDMA ib_sge: addr: 0x%16llx length: %u lkey: %08x\n", | 2325 | isert_dbg("RDMA ib_sge: addr: 0x%llx length: %u lkey: %x\n", |
2328 | ib_sge->addr, ib_sge->length, ib_sge->lkey); | 2326 | ib_sge->addr, ib_sge->length, ib_sge->lkey); |
2329 | page_off = 0; | 2327 | page_off = 0; |
2330 | data_left -= ib_sge->length; | 2328 | data_left -= ib_sge->length; |
2331 | ib_sge++; | 2329 | ib_sge++; |
@@ -2333,7 +2331,7 @@ isert_build_rdma_wr(struct isert_conn *isert_conn, struct isert_cmd *isert_cmd, | |||
2333 | } | 2331 | } |
2334 | 2332 | ||
2335 | isert_dbg("Set outgoing sg_list: %p num_sg: %u from TCM SGLs\n", | 2333 | isert_dbg("Set outgoing sg_list: %p num_sg: %u from TCM SGLs\n", |
2336 | send_wr->sg_list, send_wr->num_sge); | 2334 | send_wr->sg_list, send_wr->num_sge); |
2337 | 2335 | ||
2338 | return sg_nents; | 2336 | return sg_nents; |
2339 | } | 2337 | } |
@@ -2439,9 +2437,9 @@ isert_map_fr_pagelist(struct ib_device *ib_dev, | |||
2439 | chunk_start = start_addr; | 2437 | chunk_start = start_addr; |
2440 | end_addr = start_addr + ib_sg_dma_len(ib_dev, tmp_sg); | 2438 | end_addr = start_addr + ib_sg_dma_len(ib_dev, tmp_sg); |
2441 | 2439 | ||
2442 | isert_dbg("SGL[%d] dma_addr: 0x%16llx len: %u\n", | 2440 | isert_dbg("SGL[%d] dma_addr: 0x%llx len: %u\n", |
2443 | i, (unsigned long long)tmp_sg->dma_address, | 2441 | i, (unsigned long long)tmp_sg->dma_address, |
2444 | tmp_sg->length); | 2442 | tmp_sg->length); |
2445 | 2443 | ||
2446 | if ((end_addr & ~PAGE_MASK) && i < last_ent) { | 2444 | if ((end_addr & ~PAGE_MASK) && i < last_ent) { |
2447 | new_chunk = 0; | 2445 | new_chunk = 0; |
@@ -2452,8 +2450,8 @@ isert_map_fr_pagelist(struct ib_device *ib_dev, | |||
2452 | page = chunk_start & PAGE_MASK; | 2450 | page = chunk_start & PAGE_MASK; |
2453 | do { | 2451 | do { |
2454 | fr_pl[n_pages++] = page; | 2452 | fr_pl[n_pages++] = page; |
2455 | isert_dbg("Mapped page_list[%d] page_addr: 0x%16llx\n", | 2453 | isert_dbg("Mapped page_list[%d] page_addr: 0x%llx\n", |
2456 | n_pages - 1, page); | 2454 | n_pages - 1, page); |
2457 | page += PAGE_SIZE; | 2455 | page += PAGE_SIZE; |
2458 | } while (page < end_addr); | 2456 | } while (page < end_addr); |
2459 | } | 2457 | } |
@@ -2481,9 +2479,8 @@ isert_fast_reg_mr(struct isert_conn *isert_conn, | |||
2481 | sge->lkey = isert_conn->conn_mr->lkey; | 2479 | sge->lkey = isert_conn->conn_mr->lkey; |
2482 | sge->addr = ib_sg_dma_address(ib_dev, &mem->sg[0]); | 2480 | sge->addr = ib_sg_dma_address(ib_dev, &mem->sg[0]); |
2483 | sge->length = ib_sg_dma_len(ib_dev, &mem->sg[0]); | 2481 | sge->length = ib_sg_dma_len(ib_dev, &mem->sg[0]); |
2484 | isert_dbg("%s:%d sge: addr: 0x%llx length: %u lkey: %x\n", | 2482 | isert_dbg("sge: addr: 0x%llx length: %u lkey: %x\n", |
2485 | __func__, __LINE__, sge->addr, sge->length, | 2483 | sge->addr, sge->length, sge->lkey); |
2486 | sge->lkey); | ||
2487 | return 0; | 2484 | return 0; |
2488 | } | 2485 | } |
2489 | 2486 | ||
@@ -2500,7 +2497,7 @@ isert_fast_reg_mr(struct isert_conn *isert_conn, | |||
2500 | page_off = mem->offset % PAGE_SIZE; | 2497 | page_off = mem->offset % PAGE_SIZE; |
2501 | 2498 | ||
2502 | isert_dbg("Use fr_desc %p sg_nents %d offset %u\n", | 2499 | isert_dbg("Use fr_desc %p sg_nents %d offset %u\n", |
2503 | fr_desc, mem->nents, mem->offset); | 2500 | fr_desc, mem->nents, mem->offset); |
2504 | 2501 | ||
2505 | pagelist_len = isert_map_fr_pagelist(ib_dev, mem->sg, mem->nents, | 2502 | pagelist_len = isert_map_fr_pagelist(ib_dev, mem->sg, mem->nents, |
2506 | &frpl->page_list[0]); | 2503 | &frpl->page_list[0]); |
@@ -2544,9 +2541,8 @@ isert_fast_reg_mr(struct isert_conn *isert_conn, | |||
2544 | sge->addr = frpl->page_list[0] + page_off; | 2541 | sge->addr = frpl->page_list[0] + page_off; |
2545 | sge->length = mem->len; | 2542 | sge->length = mem->len; |
2546 | 2543 | ||
2547 | isert_dbg("%s:%d sge: addr: 0x%llx length: %u lkey: %x\n", | 2544 | isert_dbg("sge: addr: 0x%llx length: %u lkey: %x\n", |
2548 | __func__, __LINE__, sge->addr, sge->length, | 2545 | sge->addr, sge->length, sge->lkey); |
2549 | sge->lkey); | ||
2550 | 2546 | ||
2551 | return ret; | 2547 | return ret; |
2552 | } | 2548 | } |
@@ -2835,6 +2831,7 @@ isert_put_datain(struct iscsi_conn *conn, struct iscsi_cmd *cmd) | |||
2835 | 2831 | ||
2836 | isert_dbg("Cmd: %p RDMA_WRITE data_length: %u\n", | 2832 | isert_dbg("Cmd: %p RDMA_WRITE data_length: %u\n", |
2837 | isert_cmd, se_cmd->data_length); | 2833 | isert_cmd, se_cmd->data_length); |
2834 | |||
2838 | wr->iser_ib_op = ISER_IB_RDMA_WRITE; | 2835 | wr->iser_ib_op = ISER_IB_RDMA_WRITE; |
2839 | rc = device->reg_rdma_mem(conn, cmd, wr); | 2836 | rc = device->reg_rdma_mem(conn, cmd, wr); |
2840 | if (rc) { | 2837 | if (rc) { |
@@ -3053,16 +3050,12 @@ isert_rdma_accept(struct isert_conn *isert_conn) | |||
3053 | cp.retry_count = 7; | 3050 | cp.retry_count = 7; |
3054 | cp.rnr_retry_count = 7; | 3051 | cp.rnr_retry_count = 7; |
3055 | 3052 | ||
3056 | isert_dbg("Before rdma_accept >>>>>>>>>>>>>>>>>>>>.\n"); | ||
3057 | |||
3058 | ret = rdma_accept(cm_id, &cp); | 3053 | ret = rdma_accept(cm_id, &cp); |
3059 | if (ret) { | 3054 | if (ret) { |
3060 | isert_err("rdma_accept() failed with: %d\n", ret); | 3055 | isert_err("rdma_accept() failed with: %d\n", ret); |
3061 | return ret; | 3056 | return ret; |
3062 | } | 3057 | } |
3063 | 3058 | ||
3064 | isert_dbg("After rdma_accept >>>>>>>>>>>>>>>>>>>>>.\n"); | ||
3065 | |||
3066 | return 0; | 3059 | return 0; |
3067 | } | 3060 | } |
3068 | 3061 | ||
@@ -3239,6 +3232,8 @@ isert_wait4logout(struct isert_conn *isert_conn) | |||
3239 | { | 3232 | { |
3240 | struct iscsi_conn *conn = isert_conn->conn; | 3233 | struct iscsi_conn *conn = isert_conn->conn; |
3241 | 3234 | ||
3235 | isert_info("conn %p\n", isert_conn); | ||
3236 | |||
3242 | if (isert_conn->logout_posted) { | 3237 | if (isert_conn->logout_posted) { |
3243 | isert_info("conn %p wait for conn_logout_comp\n", isert_conn); | 3238 | isert_info("conn %p wait for conn_logout_comp\n", isert_conn); |
3244 | wait_for_completion_timeout(&conn->conn_logout_comp, | 3239 | wait_for_completion_timeout(&conn->conn_logout_comp, |
@@ -3249,6 +3244,8 @@ isert_wait4logout(struct isert_conn *isert_conn) | |||
3249 | static void | 3244 | static void |
3250 | isert_wait4cmds(struct iscsi_conn *conn) | 3245 | isert_wait4cmds(struct iscsi_conn *conn) |
3251 | { | 3246 | { |
3247 | isert_info("iscsi_conn %p\n", conn); | ||
3248 | |||
3252 | if (conn->sess) { | 3249 | if (conn->sess) { |
3253 | target_sess_cmd_list_set_waiting(conn->sess->se_sess); | 3250 | target_sess_cmd_list_set_waiting(conn->sess->se_sess); |
3254 | target_wait_for_sess_cmds(conn->sess->se_sess); | 3251 | target_wait_for_sess_cmds(conn->sess->se_sess); |
@@ -3260,6 +3257,8 @@ isert_wait4flush(struct isert_conn *isert_conn) | |||
3260 | { | 3257 | { |
3261 | struct ib_recv_wr *bad_wr; | 3258 | struct ib_recv_wr *bad_wr; |
3262 | 3259 | ||
3260 | isert_info("conn %p\n", isert_conn); | ||
3261 | |||
3263 | init_completion(&isert_conn->conn_wait_comp_err); | 3262 | init_completion(&isert_conn->conn_wait_comp_err); |
3264 | isert_conn->beacon.wr_id = ISER_BEACON_WRID; | 3263 | isert_conn->beacon.wr_id = ISER_BEACON_WRID; |
3265 | /* post an indication that all flush errors were consumed */ | 3264 | /* post an indication that all flush errors were consumed */ |
@@ -3275,7 +3274,7 @@ static void isert_wait_conn(struct iscsi_conn *conn) | |||
3275 | { | 3274 | { |
3276 | struct isert_conn *isert_conn = conn->context; | 3275 | struct isert_conn *isert_conn = conn->context; |
3277 | 3276 | ||
3278 | isert_dbg("isert_wait_conn: Starting\n"); | 3277 | isert_info("Starting conn %p\n", isert_conn); |
3279 | 3278 | ||
3280 | mutex_lock(&isert_conn->conn_mutex); | 3279 | mutex_lock(&isert_conn->conn_mutex); |
3281 | /* | 3280 | /* |
@@ -3361,7 +3360,7 @@ static void __exit isert_exit(void) | |||
3361 | destroy_workqueue(isert_release_wq); | 3360 | destroy_workqueue(isert_release_wq); |
3362 | destroy_workqueue(isert_comp_wq); | 3361 | destroy_workqueue(isert_comp_wq); |
3363 | iscsit_unregister_transport(&iser_target_transport); | 3362 | iscsit_unregister_transport(&iser_target_transport); |
3364 | isert_dbg("iSER_TARGET[0] - Released iser_target_transport\n"); | 3363 | isert_info("iSER_TARGET[0] - Released iser_target_transport\n"); |
3365 | } | 3364 | } |
3366 | 3365 | ||
3367 | MODULE_DESCRIPTION("iSER-Target for mainline target infrastructure"); | 3366 | MODULE_DESCRIPTION("iSER-Target for mainline target infrastructure"); |