diff options
| -rw-r--r-- | drivers/infiniband/ulp/isert/ib_isert.c | 360 | ||||
| -rw-r--r-- | drivers/infiniband/ulp/isert/ib_isert.h | 27 |
2 files changed, 209 insertions, 178 deletions
diff --git a/drivers/infiniband/ulp/isert/ib_isert.c b/drivers/infiniband/ulp/isert/ib_isert.c index 108548437c9f..87b5e8983c19 100644 --- a/drivers/infiniband/ulp/isert/ib_isert.c +++ b/drivers/infiniband/ulp/isert/ib_isert.c | |||
| @@ -38,6 +38,10 @@ | |||
| 38 | #define ISER_MAX_CQ_LEN (ISER_MAX_RX_CQ_LEN + ISER_MAX_TX_CQ_LEN + \ | 38 | #define ISER_MAX_CQ_LEN (ISER_MAX_RX_CQ_LEN + ISER_MAX_TX_CQ_LEN + \ |
| 39 | ISERT_MAX_CONN) | 39 | ISERT_MAX_CONN) |
| 40 | 40 | ||
| 41 | int isert_debug_level = 0; | ||
| 42 | module_param_named(debug_level, isert_debug_level, int, 0644); | ||
| 43 | MODULE_PARM_DESC(debug_level, "Enable debug tracing if > 0 (default:0)"); | ||
| 44 | |||
| 41 | static DEFINE_MUTEX(device_list_mutex); | 45 | static DEFINE_MUTEX(device_list_mutex); |
| 42 | static LIST_HEAD(device_list); | 46 | static LIST_HEAD(device_list); |
| 43 | static struct workqueue_struct *isert_comp_wq; | 47 | static struct workqueue_struct *isert_comp_wq; |
| @@ -74,13 +78,13 @@ isert_qp_event_callback(struct ib_event *e, void *context) | |||
| 74 | { | 78 | { |
| 75 | struct isert_conn *isert_conn = (struct isert_conn *)context; | 79 | struct isert_conn *isert_conn = (struct isert_conn *)context; |
| 76 | 80 | ||
| 77 | pr_err("isert_qp_event_callback event: %d\n", e->event); | 81 | isert_err("isert_qp_event_callback event: %d\n", e->event); |
| 78 | switch (e->event) { | 82 | switch (e->event) { |
| 79 | case IB_EVENT_COMM_EST: | 83 | case IB_EVENT_COMM_EST: |
| 80 | rdma_notify(isert_conn->conn_cm_id, IB_EVENT_COMM_EST); | 84 | rdma_notify(isert_conn->conn_cm_id, IB_EVENT_COMM_EST); |
| 81 | break; | 85 | break; |
| 82 | case IB_EVENT_QP_LAST_WQE_REACHED: | 86 | case IB_EVENT_QP_LAST_WQE_REACHED: |
| 83 | pr_warn("Reached TX IB_EVENT_QP_LAST_WQE_REACHED:\n"); | 87 | isert_warn("Reached TX IB_EVENT_QP_LAST_WQE_REACHED:\n"); |
| 84 | break; | 88 | break; |
| 85 | default: | 89 | default: |
| 86 | break; | 90 | break; |
| @@ -94,11 +98,11 @@ isert_query_device(struct ib_device *ib_dev, struct ib_device_attr *devattr) | |||
| 94 | 98 | ||
| 95 | ret = ib_query_device(ib_dev, devattr); | 99 | ret = ib_query_device(ib_dev, devattr); |
| 96 | if (ret) { | 100 | if (ret) { |
| 97 | pr_err("ib_query_device() failed: %d\n", ret); | 101 | isert_err("ib_query_device() failed: %d\n", ret); |
| 98 | return ret; | 102 | return ret; |
| 99 | } | 103 | } |
| 100 | pr_debug("devattr->max_sge: %d\n", devattr->max_sge); | 104 | isert_dbg("devattr->max_sge: %d\n", devattr->max_sge); |
| 101 | pr_debug("devattr->max_sge_rd: %d\n", devattr->max_sge_rd); | 105 | isert_dbg("devattr->max_sge_rd: %d\n", devattr->max_sge_rd); |
| 102 | 106 | ||
| 103 | return 0; | 107 | return 0; |
| 104 | } | 108 | } |
| @@ -118,7 +122,7 @@ isert_conn_setup_qp(struct isert_conn *isert_conn, struct rdma_cm_id *cma_id) | |||
| 118 | min = i; | 122 | min = i; |
| 119 | comp = &device->comps[min]; | 123 | comp = &device->comps[min]; |
| 120 | comp->active_qps++; | 124 | comp->active_qps++; |
| 121 | pr_info("conn %p, using comp %p min_index: %d\n", | 125 | isert_info("conn %p, using comp %p min_index: %d\n", |
| 122 | isert_conn, comp, min); | 126 | isert_conn, comp, min); |
| 123 | mutex_unlock(&device_list_mutex); | 127 | mutex_unlock(&device_list_mutex); |
| 124 | 128 | ||
| @@ -145,18 +149,18 @@ isert_conn_setup_qp(struct isert_conn *isert_conn, struct rdma_cm_id *cma_id) | |||
| 145 | if (device->pi_capable) | 149 | if (device->pi_capable) |
| 146 | attr.create_flags |= IB_QP_CREATE_SIGNATURE_EN; | 150 | attr.create_flags |= IB_QP_CREATE_SIGNATURE_EN; |
| 147 | 151 | ||
| 148 | pr_debug("isert_conn_setup_qp cma_id->device: %p\n", | 152 | isert_dbg("isert_conn_setup_qp cma_id->device: %p\n", |
| 149 | cma_id->device); | 153 | cma_id->device); |
| 150 | pr_debug("isert_conn_setup_qp conn_pd->device: %p\n", | 154 | isert_dbg("isert_conn_setup_qp conn_pd->device: %p\n", |
| 151 | isert_conn->conn_pd->device); | 155 | isert_conn->conn_pd->device); |
| 152 | 156 | ||
| 153 | ret = rdma_create_qp(cma_id, isert_conn->conn_pd, &attr); | 157 | ret = rdma_create_qp(cma_id, isert_conn->conn_pd, &attr); |
| 154 | if (ret) { | 158 | if (ret) { |
| 155 | pr_err("rdma_create_qp failed for cma_id %d\n", ret); | 159 | isert_err("rdma_create_qp failed for cma_id %d\n", ret); |
| 156 | goto err; | 160 | goto err; |
| 157 | } | 161 | } |
| 158 | isert_conn->conn_qp = cma_id->qp; | 162 | isert_conn->conn_qp = cma_id->qp; |
| 159 | pr_debug("rdma_create_qp() returned success >>>>>>>>>>>>>>>>>>>>>>>>>.\n"); | 163 | isert_dbg("rdma_create_qp() returned success >>>>>>>>>>>>>>>>>>>>>>>>>.\n"); |
| 160 | 164 | ||
| 161 | return 0; | 165 | return 0; |
| 162 | err: | 166 | err: |
| @@ -170,7 +174,7 @@ err: | |||
| 170 | static void | 174 | static void |
| 171 | isert_cq_event_callback(struct ib_event *e, void *context) | 175 | isert_cq_event_callback(struct ib_event *e, void *context) |
| 172 | { | 176 | { |
| 173 | pr_debug("isert_cq_event_callback event: %d\n", e->event); | 177 | isert_dbg("isert_cq_event_callback event: %d\n", e->event); |
| 174 | } | 178 | } |
| 175 | 179 | ||
| 176 | static int | 180 | static int |
| @@ -274,7 +278,7 @@ isert_create_device_ib_res(struct isert_device *device) | |||
| 274 | 278 | ||
| 275 | device->comps_used = min(ISERT_MAX_CQ, min_t(int, num_online_cpus(), | 279 | device->comps_used = min(ISERT_MAX_CQ, min_t(int, num_online_cpus(), |
| 276 | device->ib_device->num_comp_vectors)); | 280 | device->ib_device->num_comp_vectors)); |
| 277 | pr_info("Using %d CQs, %s supports %d vectors support " | 281 | isert_info("Using %d CQs, %s supports %d vectors support " |
| 278 | "Fast registration %d pi_capable %d\n", | 282 | "Fast registration %d pi_capable %d\n", |
| 279 | device->comps_used, device->ib_device->name, | 283 | device->comps_used, device->ib_device->name, |
| 280 | device->ib_device->num_comp_vectors, device->use_fastreg, | 284 | device->ib_device->num_comp_vectors, device->use_fastreg, |
| @@ -283,7 +287,7 @@ isert_create_device_ib_res(struct isert_device *device) | |||
| 283 | device->comps = kcalloc(device->comps_used, sizeof(struct isert_comp), | 287 | device->comps = kcalloc(device->comps_used, sizeof(struct isert_comp), |
| 284 | GFP_KERNEL); | 288 | GFP_KERNEL); |
| 285 | if (!device->comps) { | 289 | if (!device->comps) { |
| 286 | pr_err("Unable to allocate completion contexts\n"); | 290 | isert_err("Unable to allocate completion contexts\n"); |
| 287 | return -ENOMEM; | 291 | return -ENOMEM; |
| 288 | } | 292 | } |
| 289 | 293 | ||
| @@ -329,7 +333,7 @@ isert_free_device_ib_res(struct isert_device *device) | |||
| 329 | { | 333 | { |
| 330 | int i; | 334 | int i; |
| 331 | 335 | ||
| 332 | pr_info("device %p\n", device); | 336 | isert_info("device %p\n", device); |
| 333 | 337 | ||
| 334 | for (i = 0; i < device->comps_used; i++) { | 338 | for (i = 0; i < device->comps_used; i++) { |
| 335 | struct isert_comp *comp = &device->comps[i]; | 339 | struct isert_comp *comp = &device->comps[i]; |
| @@ -401,7 +405,7 @@ isert_conn_free_fastreg_pool(struct isert_conn *isert_conn) | |||
| 401 | if (list_empty(&isert_conn->conn_fr_pool)) | 405 | if (list_empty(&isert_conn->conn_fr_pool)) |
| 402 | return; | 406 | return; |
| 403 | 407 | ||
| 404 | pr_debug("Freeing conn %p fastreg pool", isert_conn); | 408 | isert_dbg("Freeing conn %p fastreg pool", isert_conn); |
| 405 | 409 | ||
| 406 | list_for_each_entry_safe(fr_desc, tmp, | 410 | list_for_each_entry_safe(fr_desc, tmp, |
| 407 | &isert_conn->conn_fr_pool, list) { | 411 | &isert_conn->conn_fr_pool, list) { |
| @@ -419,7 +423,7 @@ isert_conn_free_fastreg_pool(struct isert_conn *isert_conn) | |||
| 419 | } | 423 | } |
| 420 | 424 | ||
| 421 | if (i < isert_conn->conn_fr_pool_size) | 425 | if (i < isert_conn->conn_fr_pool_size) |
| 422 | pr_warn("Pool still has %d regions registered\n", | 426 | isert_warn("Pool still has %d regions registered\n", |
| 423 | isert_conn->conn_fr_pool_size - i); | 427 | isert_conn->conn_fr_pool_size - i); |
| 424 | } | 428 | } |
| 425 | 429 | ||
| @@ -434,14 +438,14 @@ isert_create_pi_ctx(struct fast_reg_descriptor *desc, | |||
| 434 | 438 | ||
| 435 | pi_ctx = kzalloc(sizeof(*desc->pi_ctx), GFP_KERNEL); | 439 | pi_ctx = kzalloc(sizeof(*desc->pi_ctx), GFP_KERNEL); |
| 436 | if (!pi_ctx) { | 440 | if (!pi_ctx) { |
| 437 | pr_err("Failed to allocate pi context\n"); | 441 | isert_err("Failed to allocate pi context\n"); |
| 438 | return -ENOMEM; | 442 | return -ENOMEM; |
| 439 | } | 443 | } |
| 440 | 444 | ||
| 441 | pi_ctx->prot_frpl = ib_alloc_fast_reg_page_list(device, | 445 | pi_ctx->prot_frpl = ib_alloc_fast_reg_page_list(device, |
| 442 | ISCSI_ISER_SG_TABLESIZE); | 446 | ISCSI_ISER_SG_TABLESIZE); |
| 443 | if (IS_ERR(pi_ctx->prot_frpl)) { | 447 | if (IS_ERR(pi_ctx->prot_frpl)) { |
| 444 | pr_err("Failed to allocate prot frpl err=%ld\n", | 448 | isert_err("Failed to allocate prot frpl err=%ld\n", |
| 445 | PTR_ERR(pi_ctx->prot_frpl)); | 449 | PTR_ERR(pi_ctx->prot_frpl)); |
| 446 | ret = PTR_ERR(pi_ctx->prot_frpl); | 450 | ret = PTR_ERR(pi_ctx->prot_frpl); |
| 447 | goto err_pi_ctx; | 451 | goto err_pi_ctx; |
| @@ -449,7 +453,7 @@ isert_create_pi_ctx(struct fast_reg_descriptor *desc, | |||
| 449 | 453 | ||
| 450 | pi_ctx->prot_mr = ib_alloc_fast_reg_mr(pd, ISCSI_ISER_SG_TABLESIZE); | 454 | pi_ctx->prot_mr = ib_alloc_fast_reg_mr(pd, ISCSI_ISER_SG_TABLESIZE); |
| 451 | if (IS_ERR(pi_ctx->prot_mr)) { | 455 | if (IS_ERR(pi_ctx->prot_mr)) { |
| 452 | pr_err("Failed to allocate prot frmr err=%ld\n", | 456 | isert_err("Failed to allocate prot frmr err=%ld\n", |
| 453 | PTR_ERR(pi_ctx->prot_mr)); | 457 | PTR_ERR(pi_ctx->prot_mr)); |
| 454 | ret = PTR_ERR(pi_ctx->prot_mr); | 458 | ret = PTR_ERR(pi_ctx->prot_mr); |
| 455 | goto err_prot_frpl; | 459 | goto err_prot_frpl; |
| @@ -461,7 +465,7 @@ isert_create_pi_ctx(struct fast_reg_descriptor *desc, | |||
| 461 | mr_init_attr.flags |= IB_MR_SIGNATURE_EN; | 465 | mr_init_attr.flags |= IB_MR_SIGNATURE_EN; |
| 462 | pi_ctx->sig_mr = ib_create_mr(pd, &mr_init_attr); | 466 | pi_ctx->sig_mr = ib_create_mr(pd, &mr_init_attr); |
| 463 | if (IS_ERR(pi_ctx->sig_mr)) { | 467 | if (IS_ERR(pi_ctx->sig_mr)) { |
| 464 | pr_err("Failed to allocate signature enabled mr err=%ld\n", | 468 | isert_err("Failed to allocate signature enabled mr err=%ld\n", |
| 465 | PTR_ERR(pi_ctx->sig_mr)); | 469 | PTR_ERR(pi_ctx->sig_mr)); |
| 466 | ret = PTR_ERR(pi_ctx->sig_mr); | 470 | ret = PTR_ERR(pi_ctx->sig_mr); |
| 467 | goto err_prot_mr; | 471 | goto err_prot_mr; |
| @@ -492,21 +496,21 @@ isert_create_fr_desc(struct ib_device *ib_device, struct ib_pd *pd, | |||
| 492 | fr_desc->data_frpl = ib_alloc_fast_reg_page_list(ib_device, | 496 | fr_desc->data_frpl = ib_alloc_fast_reg_page_list(ib_device, |
| 493 | ISCSI_ISER_SG_TABLESIZE); | 497 | ISCSI_ISER_SG_TABLESIZE); |
| 494 | if (IS_ERR(fr_desc->data_frpl)) { | 498 | if (IS_ERR(fr_desc->data_frpl)) { |
| 495 | pr_err("Failed to allocate data frpl err=%ld\n", | 499 | isert_err("Failed to allocate data frpl err=%ld\n", |
| 496 | PTR_ERR(fr_desc->data_frpl)); | 500 | PTR_ERR(fr_desc->data_frpl)); |
| 497 | return PTR_ERR(fr_desc->data_frpl); | 501 | return PTR_ERR(fr_desc->data_frpl); |
| 498 | } | 502 | } |
| 499 | 503 | ||
| 500 | fr_desc->data_mr = ib_alloc_fast_reg_mr(pd, ISCSI_ISER_SG_TABLESIZE); | 504 | fr_desc->data_mr = ib_alloc_fast_reg_mr(pd, ISCSI_ISER_SG_TABLESIZE); |
| 501 | if (IS_ERR(fr_desc->data_mr)) { | 505 | if (IS_ERR(fr_desc->data_mr)) { |
| 502 | pr_err("Failed to allocate data frmr err=%ld\n", | 506 | isert_err("Failed to allocate data frmr err=%ld\n", |
| 503 | PTR_ERR(fr_desc->data_mr)); | 507 | PTR_ERR(fr_desc->data_mr)); |
| 504 | ret = PTR_ERR(fr_desc->data_mr); | 508 | ret = PTR_ERR(fr_desc->data_mr); |
| 505 | goto err_data_frpl; | 509 | goto err_data_frpl; |
| 506 | } | 510 | } |
| 507 | fr_desc->ind |= ISERT_DATA_KEY_VALID; | 511 | fr_desc->ind |= ISERT_DATA_KEY_VALID; |
| 508 | 512 | ||
| 509 | pr_debug("Created fr_desc %p\n", fr_desc); | 513 | isert_dbg("Created fr_desc %p\n", fr_desc); |
| 510 | 514 | ||
| 511 | return 0; | 515 | return 0; |
| 512 | 516 | ||
| @@ -535,7 +539,7 @@ isert_conn_create_fastreg_pool(struct isert_conn *isert_conn) | |||
| 535 | for (i = 0; i < tag_num; i++) { | 539 | for (i = 0; i < tag_num; i++) { |
| 536 | fr_desc = kzalloc(sizeof(*fr_desc), GFP_KERNEL); | 540 | fr_desc = kzalloc(sizeof(*fr_desc), GFP_KERNEL); |
| 537 | if (!fr_desc) { | 541 | if (!fr_desc) { |
| 538 | pr_err("Failed to allocate fast_reg descriptor\n"); | 542 | isert_err("Failed to allocate fast_reg descriptor\n"); |
| 539 | ret = -ENOMEM; | 543 | ret = -ENOMEM; |
| 540 | goto err; | 544 | goto err; |
| 541 | } | 545 | } |
| @@ -543,7 +547,7 @@ isert_conn_create_fastreg_pool(struct isert_conn *isert_conn) | |||
| 543 | ret = isert_create_fr_desc(device->ib_device, | 547 | ret = isert_create_fr_desc(device->ib_device, |
| 544 | isert_conn->conn_pd, fr_desc); | 548 | isert_conn->conn_pd, fr_desc); |
| 545 | if (ret) { | 549 | if (ret) { |
| 546 | pr_err("Failed to create fastreg descriptor err=%d\n", | 550 | isert_err("Failed to create fastreg descriptor err=%d\n", |
| 547 | ret); | 551 | ret); |
| 548 | kfree(fr_desc); | 552 | kfree(fr_desc); |
| 549 | goto err; | 553 | goto err; |
| @@ -553,7 +557,7 @@ isert_conn_create_fastreg_pool(struct isert_conn *isert_conn) | |||
| 553 | isert_conn->conn_fr_pool_size++; | 557 | isert_conn->conn_fr_pool_size++; |
| 554 | } | 558 | } |
| 555 | 559 | ||
| 556 | pr_debug("Creating conn %p fastreg pool size=%d", | 560 | isert_dbg("Creating conn %p fastreg pool size=%d", |
| 557 | isert_conn, isert_conn->conn_fr_pool_size); | 561 | isert_conn, isert_conn->conn_fr_pool_size); |
| 558 | 562 | ||
| 559 | return 0; | 563 | return 0; |
| @@ -576,17 +580,17 @@ isert_connect_request(struct rdma_cm_id *cma_id, struct rdma_cm_event *event) | |||
| 576 | spin_lock_bh(&np->np_thread_lock); | 580 | spin_lock_bh(&np->np_thread_lock); |
| 577 | if (!np->enabled) { | 581 | if (!np->enabled) { |
| 578 | spin_unlock_bh(&np->np_thread_lock); | 582 | spin_unlock_bh(&np->np_thread_lock); |
| 579 | pr_debug("iscsi_np is not enabled, reject connect request\n"); | 583 | isert_dbg("iscsi_np is not enabled, reject connect request\n"); |
| 580 | return rdma_reject(cma_id, NULL, 0); | 584 | return rdma_reject(cma_id, NULL, 0); |
| 581 | } | 585 | } |
| 582 | spin_unlock_bh(&np->np_thread_lock); | 586 | spin_unlock_bh(&np->np_thread_lock); |
| 583 | 587 | ||
| 584 | pr_debug("Entering isert_connect_request cma_id: %p, context: %p\n", | 588 | isert_dbg("Entering isert_connect_request cma_id: %p, context: %p\n", |
| 585 | cma_id, cma_id->context); | 589 | cma_id, cma_id->context); |
| 586 | 590 | ||
| 587 | isert_conn = kzalloc(sizeof(struct isert_conn), GFP_KERNEL); | 591 | isert_conn = kzalloc(sizeof(struct isert_conn), GFP_KERNEL); |
| 588 | if (!isert_conn) { | 592 | if (!isert_conn) { |
| 589 | pr_err("Unable to allocate isert_conn\n"); | 593 | isert_err("Unable to allocate isert_conn\n"); |
| 590 | return -ENOMEM; | 594 | return -ENOMEM; |
| 591 | } | 595 | } |
| 592 | isert_conn->state = ISER_CONN_INIT; | 596 | isert_conn->state = ISER_CONN_INIT; |
| @@ -604,7 +608,7 @@ isert_connect_request(struct rdma_cm_id *cma_id, struct rdma_cm_event *event) | |||
| 604 | isert_conn->login_buf = kzalloc(ISCSI_DEF_MAX_RECV_SEG_LEN + | 608 | isert_conn->login_buf = kzalloc(ISCSI_DEF_MAX_RECV_SEG_LEN + |
| 605 | ISER_RX_LOGIN_SIZE, GFP_KERNEL); | 609 | ISER_RX_LOGIN_SIZE, GFP_KERNEL); |
| 606 | if (!isert_conn->login_buf) { | 610 | if (!isert_conn->login_buf) { |
| 607 | pr_err("Unable to allocate isert_conn->login_buf\n"); | 611 | isert_err("Unable to allocate isert_conn->login_buf\n"); |
| 608 | ret = -ENOMEM; | 612 | ret = -ENOMEM; |
| 609 | goto out; | 613 | goto out; |
| 610 | } | 614 | } |
| @@ -612,7 +616,7 @@ isert_connect_request(struct rdma_cm_id *cma_id, struct rdma_cm_event *event) | |||
| 612 | isert_conn->login_req_buf = isert_conn->login_buf; | 616 | isert_conn->login_req_buf = isert_conn->login_buf; |
| 613 | isert_conn->login_rsp_buf = isert_conn->login_buf + | 617 | isert_conn->login_rsp_buf = isert_conn->login_buf + |
| 614 | ISCSI_DEF_MAX_RECV_SEG_LEN; | 618 | ISCSI_DEF_MAX_RECV_SEG_LEN; |
| 615 | pr_debug("Set login_buf: %p login_req_buf: %p login_rsp_buf: %p\n", | 619 | isert_dbg("Set login_buf: %p login_req_buf: %p login_rsp_buf: %p\n", |
| 616 | isert_conn->login_buf, isert_conn->login_req_buf, | 620 | isert_conn->login_buf, isert_conn->login_req_buf, |
| 617 | isert_conn->login_rsp_buf); | 621 | isert_conn->login_rsp_buf); |
| 618 | 622 | ||
| @@ -622,7 +626,7 @@ isert_connect_request(struct rdma_cm_id *cma_id, struct rdma_cm_event *event) | |||
| 622 | 626 | ||
| 623 | ret = ib_dma_mapping_error(ib_dev, isert_conn->login_req_dma); | 627 | ret = ib_dma_mapping_error(ib_dev, isert_conn->login_req_dma); |
| 624 | if (ret) { | 628 | if (ret) { |
| 625 | pr_err("ib_dma_mapping_error failed for login_req_dma: %d\n", | 629 | isert_err("ib_dma_mapping_error failed for login_req_dma: %d\n", |
| 626 | ret); | 630 | ret); |
| 627 | isert_conn->login_req_dma = 0; | 631 | isert_conn->login_req_dma = 0; |
| 628 | goto out_login_buf; | 632 | goto out_login_buf; |
| @@ -634,7 +638,7 @@ isert_connect_request(struct rdma_cm_id *cma_id, struct rdma_cm_event *event) | |||
| 634 | 638 | ||
| 635 | ret = ib_dma_mapping_error(ib_dev, isert_conn->login_rsp_dma); | 639 | ret = ib_dma_mapping_error(ib_dev, isert_conn->login_rsp_dma); |
| 636 | if (ret) { | 640 | if (ret) { |
| 637 | pr_err("ib_dma_mapping_error failed for login_rsp_dma: %d\n", | 641 | isert_err("ib_dma_mapping_error failed for login_rsp_dma: %d\n", |
| 638 | ret); | 642 | ret); |
| 639 | isert_conn->login_rsp_dma = 0; | 643 | isert_conn->login_rsp_dma = 0; |
| 640 | goto out_req_dma_map; | 644 | goto out_req_dma_map; |
| @@ -650,13 +654,13 @@ isert_connect_request(struct rdma_cm_id *cma_id, struct rdma_cm_event *event) | |||
| 650 | isert_conn->initiator_depth = min_t(u8, | 654 | isert_conn->initiator_depth = min_t(u8, |
| 651 | event->param.conn.initiator_depth, | 655 | event->param.conn.initiator_depth, |
| 652 | device->dev_attr.max_qp_init_rd_atom); | 656 | device->dev_attr.max_qp_init_rd_atom); |
| 653 | pr_debug("Using initiator_depth: %u\n", isert_conn->initiator_depth); | 657 | isert_dbg("Using initiator_depth: %u\n", isert_conn->initiator_depth); |
| 654 | 658 | ||
| 655 | isert_conn->conn_device = device; | 659 | isert_conn->conn_device = device; |
| 656 | isert_conn->conn_pd = ib_alloc_pd(isert_conn->conn_device->ib_device); | 660 | isert_conn->conn_pd = ib_alloc_pd(isert_conn->conn_device->ib_device); |
| 657 | if (IS_ERR(isert_conn->conn_pd)) { | 661 | if (IS_ERR(isert_conn->conn_pd)) { |
| 658 | ret = PTR_ERR(isert_conn->conn_pd); | 662 | ret = PTR_ERR(isert_conn->conn_pd); |
| 659 | pr_err("ib_alloc_pd failed for conn %p: ret=%d\n", | 663 | isert_err("ib_alloc_pd failed for conn %p: ret=%d\n", |
| 660 | isert_conn, ret); | 664 | isert_conn, ret); |
| 661 | goto out_pd; | 665 | goto out_pd; |
| 662 | } | 666 | } |
| @@ -665,7 +669,7 @@ isert_connect_request(struct rdma_cm_id *cma_id, struct rdma_cm_event *event) | |||
| 665 | IB_ACCESS_LOCAL_WRITE); | 669 | IB_ACCESS_LOCAL_WRITE); |
| 666 | if (IS_ERR(isert_conn->conn_mr)) { | 670 | if (IS_ERR(isert_conn->conn_mr)) { |
| 667 | ret = PTR_ERR(isert_conn->conn_mr); | 671 | ret = PTR_ERR(isert_conn->conn_mr); |
| 668 | pr_err("ib_get_dma_mr failed for conn %p: ret=%d\n", | 672 | isert_err("ib_get_dma_mr failed for conn %p: ret=%d\n", |
| 669 | isert_conn, ret); | 673 | isert_conn, ret); |
| 670 | goto out_mr; | 674 | goto out_mr; |
| 671 | } | 675 | } |
| @@ -686,7 +690,7 @@ isert_connect_request(struct rdma_cm_id *cma_id, struct rdma_cm_event *event) | |||
| 686 | list_add_tail(&isert_conn->conn_accept_node, &isert_np->np_accept_list); | 690 | list_add_tail(&isert_conn->conn_accept_node, &isert_np->np_accept_list); |
| 687 | mutex_unlock(&isert_np->np_accept_mutex); | 691 | mutex_unlock(&isert_np->np_accept_mutex); |
| 688 | 692 | ||
| 689 | pr_debug("isert_connect_request() up np_sem np: %p\n", np); | 693 | isert_info("np %p: Allow accept_np to continue\n", np); |
| 690 | up(&isert_np->np_sem); | 694 | up(&isert_np->np_sem); |
| 691 | return 0; | 695 | return 0; |
| 692 | 696 | ||
| @@ -716,7 +720,7 @@ isert_connect_release(struct isert_conn *isert_conn) | |||
| 716 | struct ib_device *ib_dev = isert_conn->conn_cm_id->device; | 720 | struct ib_device *ib_dev = isert_conn->conn_cm_id->device; |
| 717 | struct isert_device *device = isert_conn->conn_device; | 721 | struct isert_device *device = isert_conn->conn_device; |
| 718 | 722 | ||
| 719 | pr_debug("Entering isert_connect_release(): >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n"); | 723 | isert_dbg("Entering isert_connect_release(): >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n"); |
| 720 | 724 | ||
| 721 | if (device && device->use_fastreg) | 725 | if (device && device->use_fastreg) |
| 722 | isert_conn_free_fastreg_pool(isert_conn); | 726 | isert_conn_free_fastreg_pool(isert_conn); |
| @@ -727,7 +731,7 @@ isert_connect_release(struct isert_conn *isert_conn) | |||
| 727 | if (isert_conn->conn_qp) { | 731 | if (isert_conn->conn_qp) { |
| 728 | struct isert_comp *comp = isert_conn->conn_qp->recv_cq->cq_context; | 732 | struct isert_comp *comp = isert_conn->conn_qp->recv_cq->cq_context; |
| 729 | 733 | ||
| 730 | pr_debug("dec completion context %p active_qps\n", comp); | 734 | isert_dbg("dec completion context %p active_qps\n", comp); |
| 731 | mutex_lock(&device_list_mutex); | 735 | mutex_lock(&device_list_mutex); |
| 732 | comp->active_qps--; | 736 | comp->active_qps--; |
| 733 | mutex_unlock(&device_list_mutex); | 737 | mutex_unlock(&device_list_mutex); |
| @@ -751,7 +755,7 @@ isert_connect_release(struct isert_conn *isert_conn) | |||
| 751 | if (device) | 755 | if (device) |
| 752 | isert_device_try_release(device); | 756 | isert_device_try_release(device); |
| 753 | 757 | ||
| 754 | pr_debug("Leaving isert_connect_release >>>>>>>>>>>>\n"); | 758 | isert_dbg("Leaving isert_connect_release >>>>>>>>>>>>\n"); |
| 755 | } | 759 | } |
| 756 | 760 | ||
| 757 | static void | 761 | static void |
| @@ -759,10 +763,10 @@ isert_connected_handler(struct rdma_cm_id *cma_id) | |||
| 759 | { | 763 | { |
| 760 | struct isert_conn *isert_conn = cma_id->qp->qp_context; | 764 | struct isert_conn *isert_conn = cma_id->qp->qp_context; |
| 761 | 765 | ||
| 762 | pr_info("conn %p\n", isert_conn); | 766 | isert_info("conn %p\n", isert_conn); |
| 763 | 767 | ||
| 764 | if (!kref_get_unless_zero(&isert_conn->conn_kref)) { | 768 | if (!kref_get_unless_zero(&isert_conn->conn_kref)) { |
| 765 | pr_warn("conn %p connect_release is running\n", isert_conn); | 769 | isert_warn("conn %p connect_release is running\n", isert_conn); |
| 766 | return; | 770 | return; |
| 767 | } | 771 | } |
| 768 | 772 | ||
| @@ -778,7 +782,7 @@ isert_release_conn_kref(struct kref *kref) | |||
| 778 | struct isert_conn *isert_conn = container_of(kref, | 782 | struct isert_conn *isert_conn = container_of(kref, |
| 779 | struct isert_conn, conn_kref); | 783 | struct isert_conn, conn_kref); |
| 780 | 784 | ||
| 781 | pr_debug("Calling isert_connect_release for final kref %s/%d\n", | 785 | isert_dbg("Calling isert_connect_release for final kref %s/%d\n", |
| 782 | current->comm, current->pid); | 786 | current->comm, current->pid); |
| 783 | 787 | ||
| 784 | isert_connect_release(isert_conn); | 788 | isert_connect_release(isert_conn); |
| @@ -812,16 +816,16 @@ isert_conn_terminate(struct isert_conn *isert_conn) | |||
| 812 | break; | 816 | break; |
| 813 | case ISER_CONN_UP: | 817 | case ISER_CONN_UP: |
| 814 | case ISER_CONN_FULL_FEATURE: /* FALLTHRU */ | 818 | case ISER_CONN_FULL_FEATURE: /* FALLTHRU */ |
| 815 | pr_info("Terminating conn %p state %d\n", | 819 | isert_info("Terminating conn %p state %d\n", |
| 816 | isert_conn, isert_conn->state); | 820 | isert_conn, isert_conn->state); |
| 817 | isert_conn->state = ISER_CONN_TERMINATING; | 821 | isert_conn->state = ISER_CONN_TERMINATING; |
| 818 | err = rdma_disconnect(isert_conn->conn_cm_id); | 822 | err = rdma_disconnect(isert_conn->conn_cm_id); |
| 819 | if (err) | 823 | if (err) |
| 820 | pr_warn("Failed rdma_disconnect isert_conn %p\n", | 824 | isert_warn("Failed rdma_disconnect isert_conn %p\n", |
| 821 | isert_conn); | 825 | isert_conn); |
| 822 | break; | 826 | break; |
| 823 | default: | 827 | default: |
| 824 | pr_warn("conn %p teminating in state %d\n", | 828 | isert_warn("conn %p teminating in state %d\n", |
| 825 | isert_conn, isert_conn->state); | 829 | isert_conn, isert_conn->state); |
| 826 | } | 830 | } |
| 827 | } | 831 | } |
| @@ -830,7 +834,7 @@ static int | |||
| 830 | isert_np_cma_handler(struct isert_np *isert_np, | 834 | isert_np_cma_handler(struct isert_np *isert_np, |
| 831 | enum rdma_cm_event_type event) | 835 | enum rdma_cm_event_type event) |
| 832 | { | 836 | { |
| 833 | pr_debug("isert np %p, handling event %d\n", isert_np, event); | 837 | isert_dbg("isert np %p, handling event %d\n", isert_np, event); |
| 834 | 838 | ||
| 835 | switch (event) { | 839 | switch (event) { |
| 836 | case RDMA_CM_EVENT_DEVICE_REMOVAL: | 840 | case RDMA_CM_EVENT_DEVICE_REMOVAL: |
| @@ -839,13 +843,13 @@ isert_np_cma_handler(struct isert_np *isert_np, | |||
| 839 | case RDMA_CM_EVENT_ADDR_CHANGE: | 843 | case RDMA_CM_EVENT_ADDR_CHANGE: |
| 840 | isert_np->np_cm_id = isert_setup_id(isert_np); | 844 | isert_np->np_cm_id = isert_setup_id(isert_np); |
| 841 | if (IS_ERR(isert_np->np_cm_id)) { | 845 | if (IS_ERR(isert_np->np_cm_id)) { |
| 842 | pr_err("isert np %p setup id failed: %ld\n", | 846 | isert_err("isert np %p setup id failed: %ld\n", |
| 843 | isert_np, PTR_ERR(isert_np->np_cm_id)); | 847 | isert_np, PTR_ERR(isert_np->np_cm_id)); |
| 844 | isert_np->np_cm_id = NULL; | 848 | isert_np->np_cm_id = NULL; |
| 845 | } | 849 | } |
| 846 | break; | 850 | break; |
| 847 | default: | 851 | default: |
| 848 | pr_err("isert np %p Unexpected event %d\n", | 852 | isert_err("isert np %p Unexpected event %d\n", |
| 849 | isert_np, event); | 853 | isert_np, event); |
| 850 | } | 854 | } |
| 851 | 855 | ||
| @@ -868,7 +872,7 @@ isert_disconnected_handler(struct rdma_cm_id *cma_id, | |||
| 868 | isert_conn_terminate(isert_conn); | 872 | isert_conn_terminate(isert_conn); |
| 869 | mutex_unlock(&isert_conn->conn_mutex); | 873 | mutex_unlock(&isert_conn->conn_mutex); |
| 870 | 874 | ||
| 871 | pr_info("conn %p completing conn_wait\n", isert_conn); | 875 | isert_info("conn %p completing conn_wait\n", isert_conn); |
| 872 | complete(&isert_conn->conn_wait); | 876 | complete(&isert_conn->conn_wait); |
| 873 | 877 | ||
| 874 | return 0; | 878 | return 0; |
| @@ -887,14 +891,14 @@ isert_cma_handler(struct rdma_cm_id *cma_id, struct rdma_cm_event *event) | |||
| 887 | { | 891 | { |
| 888 | int ret = 0; | 892 | int ret = 0; |
| 889 | 893 | ||
| 890 | pr_debug("isert_cma_handler: event %d status %d conn %p id %p\n", | 894 | isert_dbg("isert_cma_handler: event %d status %d conn %p id %p\n", |
| 891 | event->event, event->status, cma_id->context, cma_id); | 895 | event->event, event->status, cma_id->context, cma_id); |
| 892 | 896 | ||
| 893 | switch (event->event) { | 897 | switch (event->event) { |
| 894 | case RDMA_CM_EVENT_CONNECT_REQUEST: | 898 | case RDMA_CM_EVENT_CONNECT_REQUEST: |
| 895 | ret = isert_connect_request(cma_id, event); | 899 | ret = isert_connect_request(cma_id, event); |
| 896 | if (ret) | 900 | if (ret) |
| 897 | pr_err("isert_cma_handler failed RDMA_CM_EVENT: 0x%08x %d\n", | 901 | isert_err("isert_cma_handler failed RDMA_CM_EVENT: 0x%08x %d\n", |
| 898 | event->event, ret); | 902 | event->event, ret); |
| 899 | break; | 903 | break; |
| 900 | case RDMA_CM_EVENT_ESTABLISHED: | 904 | case RDMA_CM_EVENT_ESTABLISHED: |
| @@ -912,7 +916,7 @@ isert_cma_handler(struct rdma_cm_id *cma_id, struct rdma_cm_event *event) | |||
| 912 | isert_connect_error(cma_id); | 916 | isert_connect_error(cma_id); |
| 913 | break; | 917 | break; |
| 914 | default: | 918 | default: |
| 915 | pr_err("Unhandled RDMA CMA event: %d\n", event->event); | 919 | isert_err("Unhandled RDMA CMA event: %d\n", event->event); |
| 916 | break; | 920 | break; |
| 917 | } | 921 | } |
| 918 | 922 | ||
| @@ -943,10 +947,10 @@ isert_post_recv(struct isert_conn *isert_conn, u32 count) | |||
| 943 | ret = ib_post_recv(isert_conn->conn_qp, isert_conn->conn_rx_wr, | 947 | ret = ib_post_recv(isert_conn->conn_qp, isert_conn->conn_rx_wr, |
| 944 | &rx_wr_failed); | 948 | &rx_wr_failed); |
| 945 | if (ret) { | 949 | if (ret) { |
| 946 | pr_err("ib_post_recv() failed with ret: %d\n", ret); | 950 | isert_err("ib_post_recv() failed with ret: %d\n", ret); |
| 947 | isert_conn->post_recv_buf_count -= count; | 951 | isert_conn->post_recv_buf_count -= count; |
| 948 | } else { | 952 | } else { |
| 949 | pr_debug("isert_post_recv(): Posted %d RX buffers\n", count); | 953 | isert_dbg("isert_post_recv(): Posted %d RX buffers\n", count); |
| 950 | isert_conn->conn_rx_desc_head = rx_head; | 954 | isert_conn->conn_rx_desc_head = rx_head; |
| 951 | } | 955 | } |
| 952 | return ret; | 956 | return ret; |
| @@ -971,7 +975,7 @@ isert_post_send(struct isert_conn *isert_conn, struct iser_tx_desc *tx_desc) | |||
| 971 | 975 | ||
| 972 | ret = ib_post_send(isert_conn->conn_qp, &send_wr, &send_wr_failed); | 976 | ret = ib_post_send(isert_conn->conn_qp, &send_wr, &send_wr_failed); |
| 973 | if (ret) | 977 | if (ret) |
| 974 | pr_err("ib_post_send() failed, ret: %d\n", ret); | 978 | isert_err("ib_post_send() failed, ret: %d\n", ret); |
| 975 | 979 | ||
| 976 | return ret; | 980 | return ret; |
| 977 | } | 981 | } |
| @@ -994,7 +998,7 @@ isert_create_send_desc(struct isert_conn *isert_conn, | |||
| 994 | 998 | ||
| 995 | if (tx_desc->tx_sg[0].lkey != isert_conn->conn_mr->lkey) { | 999 | if (tx_desc->tx_sg[0].lkey != isert_conn->conn_mr->lkey) { |
| 996 | tx_desc->tx_sg[0].lkey = isert_conn->conn_mr->lkey; | 1000 | tx_desc->tx_sg[0].lkey = isert_conn->conn_mr->lkey; |
| 997 | pr_debug("tx_desc %p lkey mismatch, fixing\n", tx_desc); | 1001 | isert_dbg("tx_desc %p lkey mismatch, fixing\n", tx_desc); |
| 998 | } | 1002 | } |
| 999 | } | 1003 | } |
| 1000 | 1004 | ||
| @@ -1008,7 +1012,7 @@ isert_init_tx_hdrs(struct isert_conn *isert_conn, | |||
| 1008 | dma_addr = ib_dma_map_single(ib_dev, (void *)tx_desc, | 1012 | dma_addr = ib_dma_map_single(ib_dev, (void *)tx_desc, |
| 1009 | ISER_HEADERS_LEN, DMA_TO_DEVICE); | 1013 | ISER_HEADERS_LEN, DMA_TO_DEVICE); |
| 1010 | if (ib_dma_mapping_error(ib_dev, dma_addr)) { | 1014 | if (ib_dma_mapping_error(ib_dev, dma_addr)) { |
| 1011 | pr_err("ib_dma_mapping_error() failed\n"); | 1015 | isert_err("ib_dma_mapping_error() failed\n"); |
| 1012 | return -ENOMEM; | 1016 | return -ENOMEM; |
| 1013 | } | 1017 | } |
| 1014 | 1018 | ||
| @@ -1017,7 +1021,7 @@ isert_init_tx_hdrs(struct isert_conn *isert_conn, | |||
| 1017 | tx_desc->tx_sg[0].length = ISER_HEADERS_LEN; | 1021 | tx_desc->tx_sg[0].length = ISER_HEADERS_LEN; |
| 1018 | tx_desc->tx_sg[0].lkey = isert_conn->conn_mr->lkey; | 1022 | tx_desc->tx_sg[0].lkey = isert_conn->conn_mr->lkey; |
| 1019 | 1023 | ||
| 1020 | pr_debug("isert_init_tx_hdrs: Setup tx_sg[0].addr: 0x%llx length: %u" | 1024 | isert_dbg("isert_init_tx_hdrs: Setup tx_sg[0].addr: 0x%llx length: %u" |
| 1021 | " lkey: 0x%08x\n", tx_desc->tx_sg[0].addr, | 1025 | " lkey: 0x%08x\n", tx_desc->tx_sg[0].addr, |
| 1022 | tx_desc->tx_sg[0].length, tx_desc->tx_sg[0].lkey); | 1026 | tx_desc->tx_sg[0].length, tx_desc->tx_sg[0].lkey); |
| 1023 | 1027 | ||
| @@ -1050,7 +1054,7 @@ isert_rdma_post_recvl(struct isert_conn *isert_conn) | |||
| 1050 | sge.length = ISER_RX_LOGIN_SIZE; | 1054 | sge.length = ISER_RX_LOGIN_SIZE; |
| 1051 | sge.lkey = isert_conn->conn_mr->lkey; | 1055 | sge.lkey = isert_conn->conn_mr->lkey; |
| 1052 | 1056 | ||
| 1053 | pr_debug("Setup sge: addr: %llx length: %d 0x%08x\n", | 1057 | isert_dbg("Setup sge: addr: %llx length: %d 0x%08x\n", |
| 1054 | sge.addr, sge.length, sge.lkey); | 1058 | sge.addr, sge.length, sge.lkey); |
| 1055 | 1059 | ||
| 1056 | memset(&rx_wr, 0, sizeof(struct ib_recv_wr)); | 1060 | memset(&rx_wr, 0, sizeof(struct ib_recv_wr)); |
| @@ -1061,11 +1065,11 @@ isert_rdma_post_recvl(struct isert_conn *isert_conn) | |||
| 1061 | isert_conn->post_recv_buf_count++; | 1065 | isert_conn->post_recv_buf_count++; |
| 1062 | ret = ib_post_recv(isert_conn->conn_qp, &rx_wr, &rx_wr_fail); | 1066 | ret = ib_post_recv(isert_conn->conn_qp, &rx_wr, &rx_wr_fail); |
| 1063 | if (ret) { | 1067 | if (ret) { |
| 1064 | pr_err("ib_post_recv() failed: %d\n", ret); | 1068 | isert_err("ib_post_recv() failed: %d\n", ret); |
| 1065 | isert_conn->post_recv_buf_count--; | 1069 | isert_conn->post_recv_buf_count--; |
| 1066 | } | 1070 | } |
| 1067 | 1071 | ||
| 1068 | pr_debug("ib_post_recv(): returned success >>>>>>>>>>>>>>>>>>>>>>>>\n"); | 1072 | isert_dbg("ib_post_recv(): returned success >>>>>>>>>>>>>>>>>>>>>>>>\n"); |
| 1069 | return ret; | 1073 | return ret; |
| 1070 | } | 1074 | } |
| 1071 | 1075 | ||
| @@ -1107,7 +1111,7 @@ isert_put_login_tx(struct iscsi_conn *conn, struct iscsi_login *login, | |||
| 1107 | isert_conn->conn_device->use_fastreg) { | 1111 | isert_conn->conn_device->use_fastreg) { |
| 1108 | ret = isert_conn_create_fastreg_pool(isert_conn); | 1112 | ret = isert_conn_create_fastreg_pool(isert_conn); |
| 1109 | if (ret) { | 1113 | if (ret) { |
| 1110 | pr_err("Conn: %p failed to create" | 1114 | isert_err("Conn: %p failed to create" |
| 1111 | " fastreg pool\n", isert_conn); | 1115 | " fastreg pool\n", isert_conn); |
| 1112 | return ret; | 1116 | return ret; |
| 1113 | } | 1117 | } |
| @@ -1149,7 +1153,7 @@ isert_rx_login_req(struct isert_conn *isert_conn) | |||
| 1149 | struct iscsi_login *login = conn->conn_login; | 1153 | struct iscsi_login *login = conn->conn_login; |
| 1150 | int size; | 1154 | int size; |
| 1151 | 1155 | ||
| 1152 | pr_info("conn %p\n", isert_conn); | 1156 | isert_info("conn %p\n", isert_conn); |
| 1153 | 1157 | ||
| 1154 | WARN_ON_ONCE(!login); | 1158 | WARN_ON_ONCE(!login); |
| 1155 | 1159 | ||
| @@ -1177,7 +1181,7 @@ isert_rx_login_req(struct isert_conn *isert_conn) | |||
| 1177 | memcpy(&login->req[0], (void *)&rx_desc->iscsi_header, ISCSI_HDR_LEN); | 1181 | memcpy(&login->req[0], (void *)&rx_desc->iscsi_header, ISCSI_HDR_LEN); |
| 1178 | 1182 | ||
| 1179 | size = min(rx_buflen, MAX_KEY_VALUE_PAIRS); | 1183 | size = min(rx_buflen, MAX_KEY_VALUE_PAIRS); |
| 1180 | pr_debug("Using login payload size: %d, rx_buflen: %d MAX_KEY_VALUE_PAIRS: %d\n", | 1184 | isert_dbg("Using login payload size: %d, rx_buflen: %d MAX_KEY_VALUE_PAIRS: %d\n", |
| 1181 | size, rx_buflen, MAX_KEY_VALUE_PAIRS); | 1185 | size, rx_buflen, MAX_KEY_VALUE_PAIRS); |
| 1182 | memcpy(login->req_buf, &rx_desc->data[0], size); | 1186 | memcpy(login->req_buf, &rx_desc->data[0], size); |
| 1183 | 1187 | ||
| @@ -1197,7 +1201,7 @@ static struct iscsi_cmd | |||
| 1197 | 1201 | ||
| 1198 | cmd = iscsit_allocate_cmd(conn, TASK_INTERRUPTIBLE); | 1202 | cmd = iscsit_allocate_cmd(conn, TASK_INTERRUPTIBLE); |
| 1199 | if (!cmd) { | 1203 | if (!cmd) { |
| 1200 | pr_err("Unable to allocate iscsi_cmd + isert_cmd\n"); | 1204 | isert_err("Unable to allocate iscsi_cmd + isert_cmd\n"); |
| 1201 | return NULL; | 1205 | return NULL; |
| 1202 | } | 1206 | } |
| 1203 | isert_cmd = iscsit_priv_cmd(cmd); | 1207 | isert_cmd = iscsit_priv_cmd(cmd); |
| @@ -1240,7 +1244,7 @@ isert_handle_scsi_cmd(struct isert_conn *isert_conn, | |||
| 1240 | sg = &cmd->se_cmd.t_data_sg[0]; | 1244 | sg = &cmd->se_cmd.t_data_sg[0]; |
| 1241 | sg_nents = max(1UL, DIV_ROUND_UP(imm_data_len, PAGE_SIZE)); | 1245 | sg_nents = max(1UL, DIV_ROUND_UP(imm_data_len, PAGE_SIZE)); |
| 1242 | 1246 | ||
| 1243 | pr_debug("Copying Immediate SG: %p sg_nents: %u from %p imm_data_len: %d\n", | 1247 | isert_dbg("Copying Immediate SG: %p sg_nents: %u from %p imm_data_len: %d\n", |
| 1244 | sg, sg_nents, &rx_desc->data[0], imm_data_len); | 1248 | sg, sg_nents, &rx_desc->data[0], imm_data_len); |
| 1245 | 1249 | ||
| 1246 | sg_copy_from_buffer(sg, sg_nents, &rx_desc->data[0], imm_data_len); | 1250 | sg_copy_from_buffer(sg, sg_nents, &rx_desc->data[0], imm_data_len); |
| @@ -1285,12 +1289,12 @@ isert_handle_iscsi_dataout(struct isert_conn *isert_conn, | |||
| 1285 | * FIXME: Unexpected unsolicited_data out | 1289 | * FIXME: Unexpected unsolicited_data out |
| 1286 | */ | 1290 | */ |
| 1287 | if (!cmd->unsolicited_data) { | 1291 | if (!cmd->unsolicited_data) { |
| 1288 | pr_err("Received unexpected solicited data payload\n"); | 1292 | isert_err("Received unexpected solicited data payload\n"); |
| 1289 | dump_stack(); | 1293 | dump_stack(); |
| 1290 | return -1; | 1294 | return -1; |
| 1291 | } | 1295 | } |
| 1292 | 1296 | ||
| 1293 | pr_debug("Unsolicited DataOut unsol_data_len: %u, write_data_done: %u, data_length: %u\n", | 1297 | isert_dbg("Unsolicited DataOut unsol_data_len: %u, write_data_done: %u, data_length: %u\n", |
| 1294 | unsol_data_len, cmd->write_data_done, cmd->se_cmd.data_length); | 1298 | unsol_data_len, cmd->write_data_done, cmd->se_cmd.data_length); |
| 1295 | 1299 | ||
| 1296 | sg_off = cmd->write_data_done / PAGE_SIZE; | 1300 | sg_off = cmd->write_data_done / PAGE_SIZE; |
| @@ -1301,11 +1305,11 @@ isert_handle_iscsi_dataout(struct isert_conn *isert_conn, | |||
| 1301 | * FIXME: Non page-aligned unsolicited_data out | 1305 | * FIXME: Non page-aligned unsolicited_data out |
| 1302 | */ | 1306 | */ |
| 1303 | if (page_off) { | 1307 | if (page_off) { |
| 1304 | pr_err("Received unexpected non-page aligned data payload\n"); | 1308 | isert_err("Received unexpected non-page aligned data payload\n"); |
| 1305 | dump_stack(); | 1309 | dump_stack(); |
| 1306 | return -1; | 1310 | return -1; |
| 1307 | } | 1311 | } |
| 1308 | pr_debug("Copying DataOut: sg_start: %p, sg_off: %u sg_nents: %u from %p %u\n", | 1312 | isert_dbg("Copying DataOut: sg_start: %p, sg_off: %u sg_nents: %u from %p %u\n", |
| 1309 | sg_start, sg_off, sg_nents, &rx_desc->data[0], unsol_data_len); | 1313 | sg_start, sg_off, sg_nents, &rx_desc->data[0], unsol_data_len); |
| 1310 | 1314 | ||
| 1311 | sg_copy_from_buffer(sg_start, sg_nents, &rx_desc->data[0], | 1315 | sg_copy_from_buffer(sg_start, sg_nents, &rx_desc->data[0], |
| @@ -1353,7 +1357,7 @@ isert_handle_text_cmd(struct isert_conn *isert_conn, struct isert_cmd *isert_cmd | |||
| 1353 | 1357 | ||
| 1354 | text_in = kzalloc(payload_length, GFP_KERNEL); | 1358 | text_in = kzalloc(payload_length, GFP_KERNEL); |
| 1355 | if (!text_in) { | 1359 | if (!text_in) { |
| 1356 | pr_err("Unable to allocate text_in of payload_length: %u\n", | 1360 | isert_err("Unable to allocate text_in of payload_length: %u\n", |
| 1357 | payload_length); | 1361 | payload_length); |
| 1358 | return -ENOMEM; | 1362 | return -ENOMEM; |
| 1359 | } | 1363 | } |
| @@ -1379,7 +1383,7 @@ isert_rx_opcode(struct isert_conn *isert_conn, struct iser_rx_desc *rx_desc, | |||
| 1379 | 1383 | ||
| 1380 | if (sess->sess_ops->SessionType && | 1384 | if (sess->sess_ops->SessionType && |
| 1381 | (!(opcode & ISCSI_OP_TEXT) || !(opcode & ISCSI_OP_LOGOUT))) { | 1385 | (!(opcode & ISCSI_OP_TEXT) || !(opcode & ISCSI_OP_LOGOUT))) { |
| 1382 | pr_err("Got illegal opcode: 0x%02x in SessionType=Discovery," | 1386 | isert_err("Got illegal opcode: 0x%02x in SessionType=Discovery," |
| 1383 | " ignoring\n", opcode); | 1387 | " ignoring\n", opcode); |
| 1384 | return 0; | 1388 | return 0; |
| 1385 | } | 1389 | } |
| @@ -1437,7 +1441,7 @@ isert_rx_opcode(struct isert_conn *isert_conn, struct iser_rx_desc *rx_desc, | |||
| 1437 | rx_desc, (struct iscsi_text *)hdr); | 1441 | rx_desc, (struct iscsi_text *)hdr); |
| 1438 | break; | 1442 | break; |
| 1439 | default: | 1443 | default: |
| 1440 | pr_err("Got unknown iSCSI OpCode: 0x%02x\n", opcode); | 1444 | isert_err("Got unknown iSCSI OpCode: 0x%02x\n", opcode); |
| 1441 | dump_stack(); | 1445 | dump_stack(); |
| 1442 | break; | 1446 | break; |
| 1443 | } | 1447 | } |
| @@ -1458,23 +1462,23 @@ isert_rx_do_work(struct iser_rx_desc *rx_desc, struct isert_conn *isert_conn) | |||
| 1458 | if (iser_hdr->flags & ISER_RSV) { | 1462 | if (iser_hdr->flags & ISER_RSV) { |
| 1459 | read_stag = be32_to_cpu(iser_hdr->read_stag); | 1463 | read_stag = be32_to_cpu(iser_hdr->read_stag); |
| 1460 | read_va = be64_to_cpu(iser_hdr->read_va); | 1464 | read_va = be64_to_cpu(iser_hdr->read_va); |
| 1461 | pr_debug("ISER_RSV: read_stag: 0x%08x read_va: 0x%16llx\n", | 1465 | isert_dbg("ISER_RSV: read_stag: 0x%08x read_va: 0x%16llx\n", |
| 1462 | read_stag, (unsigned long long)read_va); | 1466 | read_stag, (unsigned long long)read_va); |
| 1463 | } | 1467 | } |
| 1464 | if (iser_hdr->flags & ISER_WSV) { | 1468 | if (iser_hdr->flags & ISER_WSV) { |
| 1465 | write_stag = be32_to_cpu(iser_hdr->write_stag); | 1469 | write_stag = be32_to_cpu(iser_hdr->write_stag); |
| 1466 | write_va = be64_to_cpu(iser_hdr->write_va); | 1470 | write_va = be64_to_cpu(iser_hdr->write_va); |
| 1467 | pr_debug("ISER_WSV: write__stag: 0x%08x write_va: 0x%16llx\n", | 1471 | isert_dbg("ISER_WSV: write__stag: 0x%08x write_va: 0x%16llx\n", |
| 1468 | write_stag, (unsigned long long)write_va); | 1472 | write_stag, (unsigned long long)write_va); |
| 1469 | } | 1473 | } |
| 1470 | 1474 | ||
| 1471 | pr_debug("ISER ISCSI_CTRL PDU\n"); | 1475 | isert_dbg("ISER ISCSI_CTRL PDU\n"); |
| 1472 | break; | 1476 | break; |
| 1473 | case ISER_HELLO: | 1477 | case ISER_HELLO: |
| 1474 | pr_err("iSER Hello message\n"); | 1478 | isert_err("iSER Hello message\n"); |
| 1475 | break; | 1479 | break; |
| 1476 | default: | 1480 | default: |
| 1477 | pr_warn("Unknown iSER hdr flags: 0x%02x\n", iser_hdr->flags); | 1481 | isert_warn("Unknown iSER hdr flags: 0x%02x\n", iser_hdr->flags); |
| 1478 | break; | 1482 | break; |
| 1479 | } | 1483 | } |
| 1480 | 1484 | ||
| @@ -1494,19 +1498,19 @@ isert_rx_completion(struct iser_rx_desc *desc, struct isert_conn *isert_conn, | |||
| 1494 | if ((char *)desc == isert_conn->login_req_buf) { | 1498 | if ((char *)desc == isert_conn->login_req_buf) { |
| 1495 | rx_dma = isert_conn->login_req_dma; | 1499 | rx_dma = isert_conn->login_req_dma; |
| 1496 | rx_buflen = ISER_RX_LOGIN_SIZE; | 1500 | rx_buflen = ISER_RX_LOGIN_SIZE; |
| 1497 | pr_debug("ISER login_buf: Using rx_dma: 0x%llx, rx_buflen: %d\n", | 1501 | isert_dbg("ISER login_buf: Using rx_dma: 0x%llx, rx_buflen: %d\n", |
| 1498 | rx_dma, rx_buflen); | 1502 | rx_dma, rx_buflen); |
| 1499 | } else { | 1503 | } else { |
| 1500 | rx_dma = desc->dma_addr; | 1504 | rx_dma = desc->dma_addr; |
| 1501 | rx_buflen = ISER_RX_PAYLOAD_SIZE; | 1505 | rx_buflen = ISER_RX_PAYLOAD_SIZE; |
| 1502 | pr_debug("ISER req_buf: Using rx_dma: 0x%llx, rx_buflen: %d\n", | 1506 | isert_dbg("ISER req_buf: Using rx_dma: 0x%llx, rx_buflen: %d\n", |
| 1503 | rx_dma, rx_buflen); | 1507 | rx_dma, rx_buflen); |
| 1504 | } | 1508 | } |
| 1505 | 1509 | ||
| 1506 | ib_dma_sync_single_for_cpu(ib_dev, rx_dma, rx_buflen, DMA_FROM_DEVICE); | 1510 | ib_dma_sync_single_for_cpu(ib_dev, rx_dma, rx_buflen, DMA_FROM_DEVICE); |
| 1507 | 1511 | ||
| 1508 | hdr = &desc->iscsi_header; | 1512 | hdr = &desc->iscsi_header; |
| 1509 | pr_debug("iSCSI opcode: 0x%02x, ITT: 0x%08x, flags: 0x%02x dlen: %d\n", | 1513 | isert_dbg("iSCSI opcode: 0x%02x, ITT: 0x%08x, flags: 0x%02x dlen: %d\n", |
| 1510 | hdr->opcode, hdr->itt, hdr->flags, | 1514 | hdr->opcode, hdr->itt, hdr->flags, |
| 1511 | (int)(xfer_len - ISER_HEADERS_LEN)); | 1515 | (int)(xfer_len - ISER_HEADERS_LEN)); |
| 1512 | 1516 | ||
| @@ -1529,7 +1533,7 @@ isert_rx_completion(struct iser_rx_desc *desc, struct isert_conn *isert_conn, | |||
| 1529 | DMA_FROM_DEVICE); | 1533 | DMA_FROM_DEVICE); |
| 1530 | 1534 | ||
| 1531 | isert_conn->post_recv_buf_count--; | 1535 | isert_conn->post_recv_buf_count--; |
| 1532 | pr_debug("iSERT: Decremented post_recv_buf_count: %d\n", | 1536 | isert_dbg("iSERT: Decremented post_recv_buf_count: %d\n", |
| 1533 | isert_conn->post_recv_buf_count); | 1537 | isert_conn->post_recv_buf_count); |
| 1534 | 1538 | ||
| 1535 | if ((char *)desc == isert_conn->login_req_buf) | 1539 | if ((char *)desc == isert_conn->login_req_buf) |
| @@ -1541,7 +1545,7 @@ isert_rx_completion(struct iser_rx_desc *desc, struct isert_conn *isert_conn, | |||
| 1541 | ISERT_MIN_POSTED_RX); | 1545 | ISERT_MIN_POSTED_RX); |
| 1542 | err = isert_post_recv(isert_conn, count); | 1546 | err = isert_post_recv(isert_conn, count); |
| 1543 | if (err) { | 1547 | if (err) { |
| 1544 | pr_err("isert_post_recv() count: %d failed, %d\n", | 1548 | isert_err("isert_post_recv() count: %d failed, %d\n", |
| 1545 | count, err); | 1549 | count, err); |
| 1546 | } | 1550 | } |
| 1547 | } | 1551 | } |
| @@ -1570,11 +1574,11 @@ isert_map_data_buf(struct isert_conn *isert_conn, struct isert_cmd *isert_cmd, | |||
| 1570 | data->dma_nents = ib_dma_map_sg(ib_dev, data->sg, data->nents, | 1574 | data->dma_nents = ib_dma_map_sg(ib_dev, data->sg, data->nents, |
| 1571 | data->dma_dir); | 1575 | data->dma_dir); |
| 1572 | if (unlikely(!data->dma_nents)) { | 1576 | if (unlikely(!data->dma_nents)) { |
| 1573 | pr_err("Cmd: unable to dma map SGs %p\n", sg); | 1577 | isert_err("Cmd: unable to dma map SGs %p\n", sg); |
| 1574 | return -EINVAL; | 1578 | return -EINVAL; |
| 1575 | } | 1579 | } |
| 1576 | 1580 | ||
| 1577 | pr_debug("Mapped cmd: %p count: %u sg: %p sg_nents: %u rdma_len %d\n", | 1581 | isert_dbg("Mapped cmd: %p count: %u sg: %p sg_nents: %u rdma_len %d\n", |
| 1578 | isert_cmd, data->dma_nents, data->sg, data->nents, data->len); | 1582 | isert_cmd, data->dma_nents, data->sg, data->nents, data->len); |
| 1579 | 1583 | ||
| 1580 | return 0; | 1584 | return 0; |
| @@ -1596,21 +1600,21 @@ isert_unmap_cmd(struct isert_cmd *isert_cmd, struct isert_conn *isert_conn) | |||
| 1596 | { | 1600 | { |
| 1597 | struct isert_rdma_wr *wr = &isert_cmd->rdma_wr; | 1601 | struct isert_rdma_wr *wr = &isert_cmd->rdma_wr; |
| 1598 | 1602 | ||
| 1599 | pr_debug("isert_unmap_cmd: %p\n", isert_cmd); | 1603 | isert_dbg("isert_unmap_cmd: %p\n", isert_cmd); |
| 1600 | 1604 | ||
| 1601 | if (wr->data.sg) { | 1605 | if (wr->data.sg) { |
| 1602 | pr_debug("isert_unmap_cmd: %p unmap_sg op\n", isert_cmd); | 1606 | isert_dbg("isert_unmap_cmd: %p unmap_sg op\n", isert_cmd); |
| 1603 | isert_unmap_data_buf(isert_conn, &wr->data); | 1607 | isert_unmap_data_buf(isert_conn, &wr->data); |
| 1604 | } | 1608 | } |
| 1605 | 1609 | ||
| 1606 | if (wr->send_wr) { | 1610 | if (wr->send_wr) { |
| 1607 | pr_debug("isert_unmap_cmd: %p free send_wr\n", isert_cmd); | 1611 | isert_dbg("isert_unmap_cmd: %p free send_wr\n", isert_cmd); |
| 1608 | kfree(wr->send_wr); | 1612 | kfree(wr->send_wr); |
| 1609 | wr->send_wr = NULL; | 1613 | wr->send_wr = NULL; |
| 1610 | } | 1614 | } |
| 1611 | 1615 | ||
| 1612 | if (wr->ib_sge) { | 1616 | if (wr->ib_sge) { |
| 1613 | pr_debug("isert_unmap_cmd: %p free ib_sge\n", isert_cmd); | 1617 | isert_dbg("isert_unmap_cmd: %p free ib_sge\n", isert_cmd); |
| 1614 | kfree(wr->ib_sge); | 1618 | kfree(wr->ib_sge); |
| 1615 | wr->ib_sge = NULL; | 1619 | wr->ib_sge = NULL; |
| 1616 | } | 1620 | } |
| @@ -1622,10 +1626,10 @@ isert_unreg_rdma(struct isert_cmd *isert_cmd, struct isert_conn *isert_conn) | |||
| 1622 | struct isert_rdma_wr *wr = &isert_cmd->rdma_wr; | 1626 | struct isert_rdma_wr *wr = &isert_cmd->rdma_wr; |
| 1623 | LIST_HEAD(unmap_list); | 1627 | LIST_HEAD(unmap_list); |
| 1624 | 1628 | ||
| 1625 | pr_debug("unreg_fastreg_cmd: %p\n", isert_cmd); | 1629 | isert_dbg("unreg_fastreg_cmd: %p\n", isert_cmd); |
| 1626 | 1630 | ||
| 1627 | if (wr->fr_desc) { | 1631 | if (wr->fr_desc) { |
| 1628 | pr_debug("unreg_fastreg_cmd: %p free fr_desc %p\n", | 1632 | isert_dbg("unreg_fastreg_cmd: %p free fr_desc %p\n", |
| 1629 | isert_cmd, wr->fr_desc); | 1633 | isert_cmd, wr->fr_desc); |
| 1630 | if (wr->fr_desc->ind & ISERT_PROTECTED) { | 1634 | if (wr->fr_desc->ind & ISERT_PROTECTED) { |
| 1631 | isert_unmap_data_buf(isert_conn, &wr->prot); | 1635 | isert_unmap_data_buf(isert_conn, &wr->prot); |
| @@ -1638,7 +1642,7 @@ isert_unreg_rdma(struct isert_cmd *isert_cmd, struct isert_conn *isert_conn) | |||
| 1638 | } | 1642 | } |
| 1639 | 1643 | ||
| 1640 | if (wr->data.sg) { | 1644 | if (wr->data.sg) { |
| 1641 | pr_debug("unreg_fastreg_cmd: %p unmap_sg op\n", isert_cmd); | 1645 | isert_dbg("unreg_fastreg_cmd: %p unmap_sg op\n", isert_cmd); |
| 1642 | isert_unmap_data_buf(isert_conn, &wr->data); | 1646 | isert_unmap_data_buf(isert_conn, &wr->data); |
| 1643 | } | 1647 | } |
| 1644 | 1648 | ||
| @@ -1654,7 +1658,7 @@ isert_put_cmd(struct isert_cmd *isert_cmd, bool comp_err) | |||
| 1654 | struct iscsi_conn *conn = isert_conn->conn; | 1658 | struct iscsi_conn *conn = isert_conn->conn; |
| 1655 | struct isert_device *device = isert_conn->conn_device; | 1659 | struct isert_device *device = isert_conn->conn_device; |
| 1656 | 1660 | ||
| 1657 | pr_debug("Entering isert_put_cmd: %p\n", isert_cmd); | 1661 | isert_dbg("Entering isert_put_cmd: %p\n", isert_cmd); |
| 1658 | 1662 | ||
| 1659 | switch (cmd->iscsi_opcode) { | 1663 | switch (cmd->iscsi_opcode) { |
| 1660 | case ISCSI_OP_SCSI_CMD: | 1664 | case ISCSI_OP_SCSI_CMD: |
| @@ -1704,7 +1708,7 @@ isert_put_cmd(struct isert_cmd *isert_cmd, bool comp_err) | |||
| 1704 | * associated cmd->se_cmd needs to be released. | 1708 | * associated cmd->se_cmd needs to be released. |
| 1705 | */ | 1709 | */ |
| 1706 | if (cmd->se_cmd.se_tfo != NULL) { | 1710 | if (cmd->se_cmd.se_tfo != NULL) { |
| 1707 | pr_debug("Calling transport_generic_free_cmd from" | 1711 | isert_dbg("Calling transport_generic_free_cmd from" |
| 1708 | " isert_put_cmd for 0x%02x\n", | 1712 | " isert_put_cmd for 0x%02x\n", |
| 1709 | cmd->iscsi_opcode); | 1713 | cmd->iscsi_opcode); |
| 1710 | transport_generic_free_cmd(&cmd->se_cmd, 0); | 1714 | transport_generic_free_cmd(&cmd->se_cmd, 0); |
| @@ -1723,7 +1727,7 @@ static void | |||
| 1723 | isert_unmap_tx_desc(struct iser_tx_desc *tx_desc, struct ib_device *ib_dev) | 1727 | isert_unmap_tx_desc(struct iser_tx_desc *tx_desc, struct ib_device *ib_dev) |
| 1724 | { | 1728 | { |
| 1725 | if (tx_desc->dma_addr != 0) { | 1729 | if (tx_desc->dma_addr != 0) { |
| 1726 | pr_debug("Calling ib_dma_unmap_single for tx_desc->dma_addr\n"); | 1730 | isert_dbg("Calling ib_dma_unmap_single for tx_desc->dma_addr\n"); |
| 1727 | ib_dma_unmap_single(ib_dev, tx_desc->dma_addr, | 1731 | ib_dma_unmap_single(ib_dev, tx_desc->dma_addr, |
| 1728 | ISER_HEADERS_LEN, DMA_TO_DEVICE); | 1732 | ISER_HEADERS_LEN, DMA_TO_DEVICE); |
| 1729 | tx_desc->dma_addr = 0; | 1733 | tx_desc->dma_addr = 0; |
| @@ -1735,7 +1739,7 @@ isert_completion_put(struct iser_tx_desc *tx_desc, struct isert_cmd *isert_cmd, | |||
| 1735 | struct ib_device *ib_dev, bool comp_err) | 1739 | struct ib_device *ib_dev, bool comp_err) |
| 1736 | { | 1740 | { |
| 1737 | if (isert_cmd->pdu_buf_dma != 0) { | 1741 | if (isert_cmd->pdu_buf_dma != 0) { |
| 1738 | pr_debug("Calling ib_dma_unmap_single for isert_cmd->pdu_buf_dma\n"); | 1742 | isert_dbg("Calling ib_dma_unmap_single for isert_cmd->pdu_buf_dma\n"); |
| 1739 | ib_dma_unmap_single(ib_dev, isert_cmd->pdu_buf_dma, | 1743 | ib_dma_unmap_single(ib_dev, isert_cmd->pdu_buf_dma, |
| 1740 | isert_cmd->pdu_buf_len, DMA_TO_DEVICE); | 1744 | isert_cmd->pdu_buf_len, DMA_TO_DEVICE); |
| 1741 | isert_cmd->pdu_buf_dma = 0; | 1745 | isert_cmd->pdu_buf_dma = 0; |
| @@ -1753,7 +1757,7 @@ isert_check_pi_status(struct se_cmd *se_cmd, struct ib_mr *sig_mr) | |||
| 1753 | 1757 | ||
| 1754 | ret = ib_check_mr_status(sig_mr, IB_MR_CHECK_SIG_STATUS, &mr_status); | 1758 | ret = ib_check_mr_status(sig_mr, IB_MR_CHECK_SIG_STATUS, &mr_status); |
| 1755 | if (ret) { | 1759 | if (ret) { |
| 1756 | pr_err("ib_check_mr_status failed, ret %d\n", ret); | 1760 | isert_err("ib_check_mr_status failed, ret %d\n", ret); |
| 1757 | goto fail_mr_status; | 1761 | goto fail_mr_status; |
| 1758 | } | 1762 | } |
| 1759 | 1763 | ||
| @@ -1776,7 +1780,7 @@ isert_check_pi_status(struct se_cmd *se_cmd, struct ib_mr *sig_mr) | |||
| 1776 | do_div(sec_offset_err, block_size); | 1780 | do_div(sec_offset_err, block_size); |
| 1777 | se_cmd->bad_sector = sec_offset_err + se_cmd->t_task_lba; | 1781 | se_cmd->bad_sector = sec_offset_err + se_cmd->t_task_lba; |
| 1778 | 1782 | ||
| 1779 | pr_err("isert: PI error found type %d at sector 0x%llx " | 1783 | isert_err("isert: PI error found type %d at sector 0x%llx " |
| 1780 | "expected 0x%x vs actual 0x%x\n", | 1784 | "expected 0x%x vs actual 0x%x\n", |
| 1781 | mr_status.sig_err.err_type, | 1785 | mr_status.sig_err.err_type, |
| 1782 | (unsigned long long)se_cmd->bad_sector, | 1786 | (unsigned long long)se_cmd->bad_sector, |
| @@ -1837,7 +1841,7 @@ isert_completion_rdma_read(struct iser_tx_desc *tx_desc, | |||
| 1837 | cmd->write_data_done = wr->data.len; | 1841 | cmd->write_data_done = wr->data.len; |
| 1838 | wr->send_wr_num = 0; | 1842 | wr->send_wr_num = 0; |
| 1839 | 1843 | ||
| 1840 | pr_debug("Cmd: %p RDMA_READ comp calling execute_cmd\n", isert_cmd); | 1844 | isert_dbg("Cmd: %p RDMA_READ comp calling execute_cmd\n", isert_cmd); |
| 1841 | spin_lock_bh(&cmd->istate_lock); | 1845 | spin_lock_bh(&cmd->istate_lock); |
| 1842 | cmd->cmd_flags |= ICF_GOT_LAST_DATAOUT; | 1846 | cmd->cmd_flags |= ICF_GOT_LAST_DATAOUT; |
| 1843 | cmd->i_state = ISTATE_RECEIVED_LAST_DATAOUT; | 1847 | cmd->i_state = ISTATE_RECEIVED_LAST_DATAOUT; |
| @@ -1861,7 +1865,7 @@ isert_do_control_comp(struct work_struct *work) | |||
| 1861 | 1865 | ||
| 1862 | switch (cmd->i_state) { | 1866 | switch (cmd->i_state) { |
| 1863 | case ISTATE_SEND_TASKMGTRSP: | 1867 | case ISTATE_SEND_TASKMGTRSP: |
| 1864 | pr_debug("Calling iscsit_tmr_post_handler >>>>>>>>>>>>>>>>>\n"); | 1868 | isert_dbg("Calling iscsit_tmr_post_handler >>>>>>>>>>>>>>>>>\n"); |
| 1865 | 1869 | ||
| 1866 | iscsit_tmr_post_handler(cmd, cmd->conn); | 1870 | iscsit_tmr_post_handler(cmd, cmd->conn); |
| 1867 | 1871 | ||
| @@ -1869,13 +1873,13 @@ isert_do_control_comp(struct work_struct *work) | |||
| 1869 | isert_completion_put(&isert_cmd->tx_desc, isert_cmd, ib_dev, false); | 1873 | isert_completion_put(&isert_cmd->tx_desc, isert_cmd, ib_dev, false); |
| 1870 | break; | 1874 | break; |
| 1871 | case ISTATE_SEND_REJECT: | 1875 | case ISTATE_SEND_REJECT: |
| 1872 | pr_debug("Got isert_do_control_comp ISTATE_SEND_REJECT: >>>\n"); | 1876 | isert_dbg("Got isert_do_control_comp ISTATE_SEND_REJECT: >>>\n"); |
| 1873 | 1877 | ||
| 1874 | cmd->i_state = ISTATE_SENT_STATUS; | 1878 | cmd->i_state = ISTATE_SENT_STATUS; |
| 1875 | isert_completion_put(&isert_cmd->tx_desc, isert_cmd, ib_dev, false); | 1879 | isert_completion_put(&isert_cmd->tx_desc, isert_cmd, ib_dev, false); |
| 1876 | break; | 1880 | break; |
| 1877 | case ISTATE_SEND_LOGOUTRSP: | 1881 | case ISTATE_SEND_LOGOUTRSP: |
| 1878 | pr_debug("Calling iscsit_logout_post_handler >>>>>>>>>>>>>>\n"); | 1882 | isert_dbg("Calling iscsit_logout_post_handler >>>>>>>>>>>>>>\n"); |
| 1879 | 1883 | ||
| 1880 | iscsit_logout_post_handler(cmd, cmd->conn); | 1884 | iscsit_logout_post_handler(cmd, cmd->conn); |
| 1881 | break; | 1885 | break; |
| @@ -1884,7 +1888,7 @@ isert_do_control_comp(struct work_struct *work) | |||
| 1884 | isert_completion_put(&isert_cmd->tx_desc, isert_cmd, ib_dev, false); | 1888 | isert_completion_put(&isert_cmd->tx_desc, isert_cmd, ib_dev, false); |
| 1885 | break; | 1889 | break; |
| 1886 | default: | 1890 | default: |
| 1887 | pr_err("Unknown do_control_comp i_state %d\n", cmd->i_state); | 1891 | isert_err("Unknown do_control_comp i_state %d\n", cmd->i_state); |
| 1888 | dump_stack(); | 1892 | dump_stack(); |
| 1889 | break; | 1893 | break; |
| 1890 | } | 1894 | } |
| @@ -1929,25 +1933,25 @@ isert_send_completion(struct iser_tx_desc *tx_desc, | |||
| 1929 | 1933 | ||
| 1930 | switch (wr->iser_ib_op) { | 1934 | switch (wr->iser_ib_op) { |
| 1931 | case ISER_IB_RECV: | 1935 | case ISER_IB_RECV: |
| 1932 | pr_err("isert_send_completion: Got ISER_IB_RECV\n"); | 1936 | isert_err("isert_send_completion: Got ISER_IB_RECV\n"); |
| 1933 | dump_stack(); | 1937 | dump_stack(); |
| 1934 | break; | 1938 | break; |
| 1935 | case ISER_IB_SEND: | 1939 | case ISER_IB_SEND: |
| 1936 | pr_debug("isert_send_completion: Got ISER_IB_SEND\n"); | 1940 | isert_dbg("isert_send_completion: Got ISER_IB_SEND\n"); |
| 1937 | isert_response_completion(tx_desc, isert_cmd, | 1941 | isert_response_completion(tx_desc, isert_cmd, |
| 1938 | isert_conn, ib_dev); | 1942 | isert_conn, ib_dev); |
| 1939 | break; | 1943 | break; |
| 1940 | case ISER_IB_RDMA_WRITE: | 1944 | case ISER_IB_RDMA_WRITE: |
| 1941 | pr_debug("isert_send_completion: Got ISER_IB_RDMA_WRITE\n"); | 1945 | isert_dbg("isert_send_completion: Got ISER_IB_RDMA_WRITE\n"); |
| 1942 | isert_completion_rdma_write(tx_desc, isert_cmd); | 1946 | isert_completion_rdma_write(tx_desc, isert_cmd); |
| 1943 | break; | 1947 | break; |
| 1944 | case ISER_IB_RDMA_READ: | 1948 | case ISER_IB_RDMA_READ: |
| 1945 | pr_debug("isert_send_completion: Got ISER_IB_RDMA_READ:\n"); | 1949 | isert_dbg("isert_send_completion: Got ISER_IB_RDMA_READ:\n"); |
| 1946 | 1950 | ||
| 1947 | isert_completion_rdma_read(tx_desc, isert_cmd); | 1951 | isert_completion_rdma_read(tx_desc, isert_cmd); |
| 1948 | break; | 1952 | break; |
| 1949 | default: | 1953 | default: |
| 1950 | pr_err("Unknown wr->iser_ib_op: 0x%02x\n", wr->iser_ib_op); | 1954 | isert_err("Unknown wr->iser_ib_op: 0x%02x\n", wr->iser_ib_op); |
| 1951 | dump_stack(); | 1955 | dump_stack(); |
| 1952 | break; | 1956 | break; |
| 1953 | } | 1957 | } |
| @@ -1980,7 +1984,7 @@ static void | |||
| 1980 | isert_cq_comp_err(struct isert_conn *isert_conn, struct ib_wc *wc) | 1984 | isert_cq_comp_err(struct isert_conn *isert_conn, struct ib_wc *wc) |
| 1981 | { | 1985 | { |
| 1982 | if (wc->wr_id == ISER_BEACON_WRID) { | 1986 | if (wc->wr_id == ISER_BEACON_WRID) { |
| 1983 | pr_info("conn %p completing conn_wait_comp_err\n", | 1987 | isert_info("conn %p completing conn_wait_comp_err\n", |
| 1984 | isert_conn); | 1988 | isert_conn); |
| 1985 | complete(&isert_conn->conn_wait_comp_err); | 1989 | complete(&isert_conn->conn_wait_comp_err); |
| 1986 | } else | 1990 | } else |
| @@ -2020,10 +2024,10 @@ isert_handle_wc(struct ib_wc *wc) | |||
| 2020 | } | 2024 | } |
| 2021 | } else { | 2025 | } else { |
| 2022 | if (wc->status != IB_WC_WR_FLUSH_ERR) | 2026 | if (wc->status != IB_WC_WR_FLUSH_ERR) |
| 2023 | pr_err("wr id %llx status %d vend_err %x\n", | 2027 | isert_err("wr id %llx status %d vend_err %x\n", |
| 2024 | wc->wr_id, wc->status, wc->vendor_err); | 2028 | wc->wr_id, wc->status, wc->vendor_err); |
| 2025 | else | 2029 | else |
| 2026 | pr_debug("flush error: wr id %llx\n", wc->wr_id); | 2030 | isert_dbg("flush error: wr id %llx\n", wc->wr_id); |
| 2027 | 2031 | ||
| 2028 | if (wc->wr_id != ISER_FASTREG_LI_WRID) | 2032 | if (wc->wr_id != ISER_FASTREG_LI_WRID) |
| 2029 | isert_cq_comp_err(isert_conn, wc); | 2033 | isert_cq_comp_err(isert_conn, wc); |
| @@ -2068,7 +2072,7 @@ isert_post_response(struct isert_conn *isert_conn, struct isert_cmd *isert_cmd) | |||
| 2068 | ret = ib_post_send(isert_conn->conn_qp, &isert_cmd->tx_desc.send_wr, | 2072 | ret = ib_post_send(isert_conn->conn_qp, &isert_cmd->tx_desc.send_wr, |
| 2069 | &wr_failed); | 2073 | &wr_failed); |
| 2070 | if (ret) { | 2074 | if (ret) { |
| 2071 | pr_err("ib_post_send failed with %d\n", ret); | 2075 | isert_err("ib_post_send failed with %d\n", ret); |
| 2072 | return ret; | 2076 | return ret; |
| 2073 | } | 2077 | } |
| 2074 | return ret; | 2078 | return ret; |
| @@ -2117,7 +2121,7 @@ isert_put_response(struct iscsi_conn *conn, struct iscsi_cmd *cmd) | |||
| 2117 | 2121 | ||
| 2118 | isert_init_send_wr(isert_conn, isert_cmd, send_wr); | 2122 | isert_init_send_wr(isert_conn, isert_cmd, send_wr); |
| 2119 | 2123 | ||
| 2120 | pr_debug("Posting SCSI Response IB_WR_SEND >>>>>>>>>>>>>>>>>>>>>>\n"); | 2124 | isert_dbg("Posting SCSI Response IB_WR_SEND >>>>>>>>>>>>>>>>>>>>>>\n"); |
| 2121 | 2125 | ||
| 2122 | return isert_post_response(isert_conn, isert_cmd); | 2126 | return isert_post_response(isert_conn, isert_cmd); |
| 2123 | } | 2127 | } |
| @@ -2148,13 +2152,13 @@ isert_get_sup_prot_ops(struct iscsi_conn *conn) | |||
| 2148 | 2152 | ||
| 2149 | if (conn->tpg->tpg_attrib.t10_pi) { | 2153 | if (conn->tpg->tpg_attrib.t10_pi) { |
| 2150 | if (device->pi_capable) { | 2154 | if (device->pi_capable) { |
| 2151 | pr_info("conn %p PI offload enabled\n", isert_conn); | 2155 | isert_info("conn %p PI offload enabled\n", isert_conn); |
| 2152 | isert_conn->pi_support = true; | 2156 | isert_conn->pi_support = true; |
| 2153 | return TARGET_PROT_ALL; | 2157 | return TARGET_PROT_ALL; |
| 2154 | } | 2158 | } |
| 2155 | } | 2159 | } |
| 2156 | 2160 | ||
| 2157 | pr_info("conn %p PI offload disabled\n", isert_conn); | 2161 | isert_info("conn %p PI offload disabled\n", isert_conn); |
| 2158 | isert_conn->pi_support = false; | 2162 | isert_conn->pi_support = false; |
| 2159 | 2163 | ||
| 2160 | return TARGET_PROT_NORMAL; | 2164 | return TARGET_PROT_NORMAL; |
| @@ -2175,7 +2179,7 @@ isert_put_nopin(struct iscsi_cmd *cmd, struct iscsi_conn *conn, | |||
| 2175 | isert_init_tx_hdrs(isert_conn, &isert_cmd->tx_desc); | 2179 | isert_init_tx_hdrs(isert_conn, &isert_cmd->tx_desc); |
| 2176 | isert_init_send_wr(isert_conn, isert_cmd, send_wr); | 2180 | isert_init_send_wr(isert_conn, isert_cmd, send_wr); |
| 2177 | 2181 | ||
| 2178 | pr_debug("Posting NOPIN Response IB_WR_SEND >>>>>>>>>>>>>>>>>>>>>>\n"); | 2182 | isert_dbg("Posting NOPIN Response IB_WR_SEND >>>>>>>>>>>>>>>>>>>>>>\n"); |
| 2179 | 2183 | ||
| 2180 | return isert_post_response(isert_conn, isert_cmd); | 2184 | return isert_post_response(isert_conn, isert_cmd); |
| 2181 | } | 2185 | } |
| @@ -2193,7 +2197,7 @@ isert_put_logout_rsp(struct iscsi_cmd *cmd, struct iscsi_conn *conn) | |||
| 2193 | isert_init_tx_hdrs(isert_conn, &isert_cmd->tx_desc); | 2197 | isert_init_tx_hdrs(isert_conn, &isert_cmd->tx_desc); |
| 2194 | isert_init_send_wr(isert_conn, isert_cmd, send_wr); | 2198 | isert_init_send_wr(isert_conn, isert_cmd, send_wr); |
| 2195 | 2199 | ||
| 2196 | pr_debug("Posting Logout Response IB_WR_SEND >>>>>>>>>>>>>>>>>>>>>>\n"); | 2200 | isert_dbg("Posting Logout Response IB_WR_SEND >>>>>>>>>>>>>>>>>>>>>>\n"); |
| 2197 | 2201 | ||
| 2198 | return isert_post_response(isert_conn, isert_cmd); | 2202 | return isert_post_response(isert_conn, isert_cmd); |
| 2199 | } | 2203 | } |
| @@ -2211,7 +2215,7 @@ isert_put_tm_rsp(struct iscsi_cmd *cmd, struct iscsi_conn *conn) | |||
| 2211 | isert_init_tx_hdrs(isert_conn, &isert_cmd->tx_desc); | 2215 | isert_init_tx_hdrs(isert_conn, &isert_cmd->tx_desc); |
| 2212 | isert_init_send_wr(isert_conn, isert_cmd, send_wr); | 2216 | isert_init_send_wr(isert_conn, isert_cmd, send_wr); |
| 2213 | 2217 | ||
| 2214 | pr_debug("Posting Task Management Response IB_WR_SEND >>>>>>>>>>>>>>>>>>>>>>\n"); | 2218 | isert_dbg("Posting Task Management Response IB_WR_SEND >>>>>>>>>>>>>>>>>>>>>>\n"); |
| 2215 | 2219 | ||
| 2216 | return isert_post_response(isert_conn, isert_cmd); | 2220 | return isert_post_response(isert_conn, isert_cmd); |
| 2217 | } | 2221 | } |
| @@ -2243,7 +2247,7 @@ isert_put_reject(struct iscsi_cmd *cmd, struct iscsi_conn *conn) | |||
| 2243 | 2247 | ||
| 2244 | isert_init_send_wr(isert_conn, isert_cmd, send_wr); | 2248 | isert_init_send_wr(isert_conn, isert_cmd, send_wr); |
| 2245 | 2249 | ||
| 2246 | pr_debug("Posting Reject IB_WR_SEND >>>>>>>>>>>>>>>>>>>>>>\n"); | 2250 | isert_dbg("Posting Reject IB_WR_SEND >>>>>>>>>>>>>>>>>>>>>>\n"); |
| 2247 | 2251 | ||
| 2248 | return isert_post_response(isert_conn, isert_cmd); | 2252 | return isert_post_response(isert_conn, isert_cmd); |
| 2249 | } | 2253 | } |
| @@ -2283,7 +2287,7 @@ isert_put_text_rsp(struct iscsi_cmd *cmd, struct iscsi_conn *conn) | |||
| 2283 | } | 2287 | } |
| 2284 | isert_init_send_wr(isert_conn, isert_cmd, send_wr); | 2288 | isert_init_send_wr(isert_conn, isert_cmd, send_wr); |
| 2285 | 2289 | ||
| 2286 | pr_debug("Posting Text Response IB_WR_SEND >>>>>>>>>>>>>>>>>>>>>>\n"); | 2290 | isert_dbg("Posting Text Response IB_WR_SEND >>>>>>>>>>>>>>>>>>>>>>\n"); |
| 2287 | 2291 | ||
| 2288 | return isert_post_response(isert_conn, isert_cmd); | 2292 | return isert_post_response(isert_conn, isert_cmd); |
| 2289 | } | 2293 | } |
| @@ -2311,7 +2315,7 @@ isert_build_rdma_wr(struct isert_conn *isert_conn, struct isert_cmd *isert_cmd, | |||
| 2311 | * Perform mapping of TCM scatterlist memory ib_sge dma_addr. | 2315 | * Perform mapping of TCM scatterlist memory ib_sge dma_addr. |
| 2312 | */ | 2316 | */ |
| 2313 | for_each_sg(sg_start, tmp_sg, sg_nents, i) { | 2317 | for_each_sg(sg_start, tmp_sg, sg_nents, i) { |
| 2314 | pr_debug("ISER RDMA from SGL dma_addr: 0x%16llx dma_len: %u, page_off: %u\n", | 2318 | isert_dbg("ISER RDMA from SGL dma_addr: 0x%16llx dma_len: %u, page_off: %u\n", |
| 2315 | (unsigned long long)tmp_sg->dma_address, | 2319 | (unsigned long long)tmp_sg->dma_address, |
| 2316 | tmp_sg->length, page_off); | 2320 | tmp_sg->length, page_off); |
| 2317 | 2321 | ||
| @@ -2320,15 +2324,15 @@ isert_build_rdma_wr(struct isert_conn *isert_conn, struct isert_cmd *isert_cmd, | |||
| 2320 | ib_sg_dma_len(ib_dev, tmp_sg) - page_off); | 2324 | ib_sg_dma_len(ib_dev, tmp_sg) - page_off); |
| 2321 | ib_sge->lkey = isert_conn->conn_mr->lkey; | 2325 | ib_sge->lkey = isert_conn->conn_mr->lkey; |
| 2322 | 2326 | ||
| 2323 | pr_debug("RDMA ib_sge: addr: 0x%16llx length: %u lkey: %08x\n", | 2327 | isert_dbg("RDMA ib_sge: addr: 0x%16llx length: %u lkey: %08x\n", |
| 2324 | ib_sge->addr, ib_sge->length, ib_sge->lkey); | 2328 | ib_sge->addr, ib_sge->length, ib_sge->lkey); |
| 2325 | page_off = 0; | 2329 | page_off = 0; |
| 2326 | data_left -= ib_sge->length; | 2330 | data_left -= ib_sge->length; |
| 2327 | ib_sge++; | 2331 | ib_sge++; |
| 2328 | pr_debug("Incrementing ib_sge pointer to %p\n", ib_sge); | 2332 | isert_dbg("Incrementing ib_sge pointer to %p\n", ib_sge); |
| 2329 | } | 2333 | } |
| 2330 | 2334 | ||
| 2331 | pr_debug("Set outgoing sg_list: %p num_sg: %u from TCM SGLs\n", | 2335 | isert_dbg("Set outgoing sg_list: %p num_sg: %u from TCM SGLs\n", |
| 2332 | send_wr->sg_list, send_wr->num_sge); | 2336 | send_wr->sg_list, send_wr->num_sge); |
| 2333 | 2337 | ||
| 2334 | return sg_nents; | 2338 | return sg_nents; |
| @@ -2361,7 +2365,7 @@ isert_map_rdma(struct iscsi_conn *conn, struct iscsi_cmd *cmd, | |||
| 2361 | 2365 | ||
| 2362 | ib_sge = kzalloc(sizeof(struct ib_sge) * data->nents, GFP_KERNEL); | 2366 | ib_sge = kzalloc(sizeof(struct ib_sge) * data->nents, GFP_KERNEL); |
| 2363 | if (!ib_sge) { | 2367 | if (!ib_sge) { |
| 2364 | pr_warn("Unable to allocate ib_sge\n"); | 2368 | isert_warn("Unable to allocate ib_sge\n"); |
| 2365 | ret = -ENOMEM; | 2369 | ret = -ENOMEM; |
| 2366 | goto unmap_cmd; | 2370 | goto unmap_cmd; |
| 2367 | } | 2371 | } |
| @@ -2371,7 +2375,7 @@ isert_map_rdma(struct iscsi_conn *conn, struct iscsi_cmd *cmd, | |||
| 2371 | wr->send_wr = kzalloc(sizeof(struct ib_send_wr) * wr->send_wr_num, | 2375 | wr->send_wr = kzalloc(sizeof(struct ib_send_wr) * wr->send_wr_num, |
| 2372 | GFP_KERNEL); | 2376 | GFP_KERNEL); |
| 2373 | if (!wr->send_wr) { | 2377 | if (!wr->send_wr) { |
| 2374 | pr_debug("Unable to allocate wr->send_wr\n"); | 2378 | isert_dbg("Unable to allocate wr->send_wr\n"); |
| 2375 | ret = -ENOMEM; | 2379 | ret = -ENOMEM; |
| 2376 | goto unmap_cmd; | 2380 | goto unmap_cmd; |
| 2377 | } | 2381 | } |
| @@ -2435,7 +2439,7 @@ isert_map_fr_pagelist(struct ib_device *ib_dev, | |||
| 2435 | chunk_start = start_addr; | 2439 | chunk_start = start_addr; |
| 2436 | end_addr = start_addr + ib_sg_dma_len(ib_dev, tmp_sg); | 2440 | end_addr = start_addr + ib_sg_dma_len(ib_dev, tmp_sg); |
| 2437 | 2441 | ||
| 2438 | pr_debug("SGL[%d] dma_addr: 0x%16llx len: %u\n", | 2442 | isert_dbg("SGL[%d] dma_addr: 0x%16llx len: %u\n", |
| 2439 | i, (unsigned long long)tmp_sg->dma_address, | 2443 | i, (unsigned long long)tmp_sg->dma_address, |
| 2440 | tmp_sg->length); | 2444 | tmp_sg->length); |
| 2441 | 2445 | ||
| @@ -2448,7 +2452,7 @@ isert_map_fr_pagelist(struct ib_device *ib_dev, | |||
| 2448 | page = chunk_start & PAGE_MASK; | 2452 | page = chunk_start & PAGE_MASK; |
| 2449 | do { | 2453 | do { |
| 2450 | fr_pl[n_pages++] = page; | 2454 | fr_pl[n_pages++] = page; |
| 2451 | pr_debug("Mapped page_list[%d] page_addr: 0x%16llx\n", | 2455 | isert_dbg("Mapped page_list[%d] page_addr: 0x%16llx\n", |
| 2452 | n_pages - 1, page); | 2456 | n_pages - 1, page); |
| 2453 | page += PAGE_SIZE; | 2457 | page += PAGE_SIZE; |
| 2454 | } while (page < end_addr); | 2458 | } while (page < end_addr); |
| @@ -2477,7 +2481,7 @@ isert_fast_reg_mr(struct isert_conn *isert_conn, | |||
| 2477 | sge->lkey = isert_conn->conn_mr->lkey; | 2481 | sge->lkey = isert_conn->conn_mr->lkey; |
| 2478 | sge->addr = ib_sg_dma_address(ib_dev, &mem->sg[0]); | 2482 | sge->addr = ib_sg_dma_address(ib_dev, &mem->sg[0]); |
| 2479 | sge->length = ib_sg_dma_len(ib_dev, &mem->sg[0]); | 2483 | sge->length = ib_sg_dma_len(ib_dev, &mem->sg[0]); |
| 2480 | pr_debug("%s:%d sge: addr: 0x%llx length: %u lkey: %x\n", | 2484 | isert_dbg("%s:%d sge: addr: 0x%llx length: %u lkey: %x\n", |
| 2481 | __func__, __LINE__, sge->addr, sge->length, | 2485 | __func__, __LINE__, sge->addr, sge->length, |
| 2482 | sge->lkey); | 2486 | sge->lkey); |
| 2483 | return 0; | 2487 | return 0; |
| @@ -2495,7 +2499,7 @@ isert_fast_reg_mr(struct isert_conn *isert_conn, | |||
| 2495 | 2499 | ||
| 2496 | page_off = mem->offset % PAGE_SIZE; | 2500 | page_off = mem->offset % PAGE_SIZE; |
| 2497 | 2501 | ||
| 2498 | pr_debug("Use fr_desc %p sg_nents %d offset %u\n", | 2502 | isert_dbg("Use fr_desc %p sg_nents %d offset %u\n", |
| 2499 | fr_desc, mem->nents, mem->offset); | 2503 | fr_desc, mem->nents, mem->offset); |
| 2500 | 2504 | ||
| 2501 | pagelist_len = isert_map_fr_pagelist(ib_dev, mem->sg, mem->nents, | 2505 | pagelist_len = isert_map_fr_pagelist(ib_dev, mem->sg, mem->nents, |
| @@ -2531,7 +2535,7 @@ isert_fast_reg_mr(struct isert_conn *isert_conn, | |||
| 2531 | 2535 | ||
| 2532 | ret = ib_post_send(isert_conn->conn_qp, wr, &bad_wr); | 2536 | ret = ib_post_send(isert_conn->conn_qp, wr, &bad_wr); |
| 2533 | if (ret) { | 2537 | if (ret) { |
| 2534 | pr_err("fast registration failed, ret:%d\n", ret); | 2538 | isert_err("fast registration failed, ret:%d\n", ret); |
| 2535 | return ret; | 2539 | return ret; |
| 2536 | } | 2540 | } |
| 2537 | fr_desc->ind &= ~ind; | 2541 | fr_desc->ind &= ~ind; |
| @@ -2540,7 +2544,7 @@ isert_fast_reg_mr(struct isert_conn *isert_conn, | |||
| 2540 | sge->addr = frpl->page_list[0] + page_off; | 2544 | sge->addr = frpl->page_list[0] + page_off; |
| 2541 | sge->length = mem->len; | 2545 | sge->length = mem->len; |
| 2542 | 2546 | ||
| 2543 | pr_debug("%s:%d sge: addr: 0x%llx length: %u lkey: %x\n", | 2547 | isert_dbg("%s:%d sge: addr: 0x%llx length: %u lkey: %x\n", |
| 2544 | __func__, __LINE__, sge->addr, sge->length, | 2548 | __func__, __LINE__, sge->addr, sge->length, |
| 2545 | sge->lkey); | 2549 | sge->lkey); |
| 2546 | 2550 | ||
| @@ -2588,7 +2592,7 @@ isert_set_sig_attrs(struct se_cmd *se_cmd, struct ib_sig_attrs *sig_attrs) | |||
| 2588 | isert_set_dif_domain(se_cmd, sig_attrs, &sig_attrs->mem); | 2592 | isert_set_dif_domain(se_cmd, sig_attrs, &sig_attrs->mem); |
| 2589 | break; | 2593 | break; |
| 2590 | default: | 2594 | default: |
| 2591 | pr_err("Unsupported PI operation %d\n", se_cmd->prot_op); | 2595 | isert_err("Unsupported PI operation %d\n", se_cmd->prot_op); |
| 2592 | return -EINVAL; | 2596 | return -EINVAL; |
| 2593 | } | 2597 | } |
| 2594 | 2598 | ||
| @@ -2652,7 +2656,7 @@ isert_reg_sig_mr(struct isert_conn *isert_conn, | |||
| 2652 | 2656 | ||
| 2653 | ret = ib_post_send(isert_conn->conn_qp, wr, &bad_wr); | 2657 | ret = ib_post_send(isert_conn->conn_qp, wr, &bad_wr); |
| 2654 | if (ret) { | 2658 | if (ret) { |
| 2655 | pr_err("fast registration failed, ret:%d\n", ret); | 2659 | isert_err("fast registration failed, ret:%d\n", ret); |
| 2656 | goto err; | 2660 | goto err; |
| 2657 | } | 2661 | } |
| 2658 | fr_desc->ind &= ~ISERT_SIG_KEY_VALID; | 2662 | fr_desc->ind &= ~ISERT_SIG_KEY_VALID; |
| @@ -2668,7 +2672,7 @@ isert_reg_sig_mr(struct isert_conn *isert_conn, | |||
| 2668 | */ | 2672 | */ |
| 2669 | rdma_wr->ib_sg[SIG].length += se_cmd->prot_length; | 2673 | rdma_wr->ib_sg[SIG].length += se_cmd->prot_length; |
| 2670 | 2674 | ||
| 2671 | pr_debug("sig_sge: addr: 0x%llx length: %u lkey: %x\n", | 2675 | isert_dbg("sig_sge: addr: 0x%llx length: %u lkey: %x\n", |
| 2672 | rdma_wr->ib_sg[SIG].addr, rdma_wr->ib_sg[SIG].length, | 2676 | rdma_wr->ib_sg[SIG].addr, rdma_wr->ib_sg[SIG].length, |
| 2673 | rdma_wr->ib_sg[SIG].lkey); | 2677 | rdma_wr->ib_sg[SIG].lkey); |
| 2674 | err: | 2678 | err: |
| @@ -2689,7 +2693,7 @@ isert_handle_prot_cmd(struct isert_conn *isert_conn, | |||
| 2689 | device->ib_device, | 2693 | device->ib_device, |
| 2690 | isert_conn->conn_pd); | 2694 | isert_conn->conn_pd); |
| 2691 | if (ret) { | 2695 | if (ret) { |
| 2692 | pr_err("conn %p failed to allocate pi_ctx\n", | 2696 | isert_err("conn %p failed to allocate pi_ctx\n", |
| 2693 | isert_conn); | 2697 | isert_conn); |
| 2694 | return ret; | 2698 | return ret; |
| 2695 | } | 2699 | } |
| @@ -2702,7 +2706,7 @@ isert_handle_prot_cmd(struct isert_conn *isert_conn, | |||
| 2702 | se_cmd->prot_length, | 2706 | se_cmd->prot_length, |
| 2703 | 0, wr->iser_ib_op, &wr->prot); | 2707 | 0, wr->iser_ib_op, &wr->prot); |
| 2704 | if (ret) { | 2708 | if (ret) { |
| 2705 | pr_err("conn %p failed to map protection buffer\n", | 2709 | isert_err("conn %p failed to map protection buffer\n", |
| 2706 | isert_conn); | 2710 | isert_conn); |
| 2707 | return ret; | 2711 | return ret; |
| 2708 | } | 2712 | } |
| @@ -2711,7 +2715,7 @@ isert_handle_prot_cmd(struct isert_conn *isert_conn, | |||
| 2711 | ret = isert_fast_reg_mr(isert_conn, wr->fr_desc, &wr->prot, | 2715 | ret = isert_fast_reg_mr(isert_conn, wr->fr_desc, &wr->prot, |
| 2712 | ISERT_PROT_KEY_VALID, &wr->ib_sg[PROT]); | 2716 | ISERT_PROT_KEY_VALID, &wr->ib_sg[PROT]); |
| 2713 | if (ret) { | 2717 | if (ret) { |
| 2714 | pr_err("conn %p failed to fast reg mr\n", | 2718 | isert_err("conn %p failed to fast reg mr\n", |
| 2715 | isert_conn); | 2719 | isert_conn); |
| 2716 | goto unmap_prot_cmd; | 2720 | goto unmap_prot_cmd; |
| 2717 | } | 2721 | } |
| @@ -2719,7 +2723,7 @@ isert_handle_prot_cmd(struct isert_conn *isert_conn, | |||
| 2719 | 2723 | ||
| 2720 | ret = isert_reg_sig_mr(isert_conn, se_cmd, wr, wr->fr_desc); | 2724 | ret = isert_reg_sig_mr(isert_conn, se_cmd, wr, wr->fr_desc); |
| 2721 | if (ret) { | 2725 | if (ret) { |
| 2722 | pr_err("conn %p failed to fast reg mr\n", | 2726 | isert_err("conn %p failed to fast reg mr\n", |
| 2723 | isert_conn); | 2727 | isert_conn); |
| 2724 | goto unmap_prot_cmd; | 2728 | goto unmap_prot_cmd; |
| 2725 | } | 2729 | } |
| @@ -2829,12 +2833,12 @@ isert_put_datain(struct iscsi_conn *conn, struct iscsi_cmd *cmd) | |||
| 2829 | struct ib_send_wr *wr_failed; | 2833 | struct ib_send_wr *wr_failed; |
| 2830 | int rc; | 2834 | int rc; |
| 2831 | 2835 | ||
| 2832 | pr_debug("Cmd: %p RDMA_WRITE data_length: %u\n", | 2836 | isert_dbg("Cmd: %p RDMA_WRITE data_length: %u\n", |
| 2833 | isert_cmd, se_cmd->data_length); | 2837 | isert_cmd, se_cmd->data_length); |
| 2834 | wr->iser_ib_op = ISER_IB_RDMA_WRITE; | 2838 | wr->iser_ib_op = ISER_IB_RDMA_WRITE; |
| 2835 | rc = device->reg_rdma_mem(conn, cmd, wr); | 2839 | rc = device->reg_rdma_mem(conn, cmd, wr); |
| 2836 | if (rc) { | 2840 | if (rc) { |
| 2837 | pr_err("Cmd: %p failed to prepare RDMA res\n", isert_cmd); | 2841 | isert_err("Cmd: %p failed to prepare RDMA res\n", isert_cmd); |
| 2838 | return rc; | 2842 | return rc; |
| 2839 | } | 2843 | } |
| 2840 | 2844 | ||
| @@ -2855,13 +2859,13 @@ isert_put_datain(struct iscsi_conn *conn, struct iscsi_cmd *cmd) | |||
| 2855 | 2859 | ||
| 2856 | rc = ib_post_send(isert_conn->conn_qp, wr->send_wr, &wr_failed); | 2860 | rc = ib_post_send(isert_conn->conn_qp, wr->send_wr, &wr_failed); |
| 2857 | if (rc) | 2861 | if (rc) |
| 2858 | pr_warn("ib_post_send() failed for IB_WR_RDMA_WRITE\n"); | 2862 | isert_warn("ib_post_send() failed for IB_WR_RDMA_WRITE\n"); |
| 2859 | 2863 | ||
| 2860 | if (!isert_prot_cmd(isert_conn, se_cmd)) | 2864 | if (!isert_prot_cmd(isert_conn, se_cmd)) |
| 2861 | pr_debug("Cmd: %p posted RDMA_WRITE + Response for iSER Data " | 2865 | isert_dbg("Cmd: %p posted RDMA_WRITE + Response for iSER Data " |
| 2862 | "READ\n", isert_cmd); | 2866 | "READ\n", isert_cmd); |
| 2863 | else | 2867 | else |
| 2864 | pr_debug("Cmd: %p posted RDMA_WRITE for iSER Data READ\n", | 2868 | isert_dbg("Cmd: %p posted RDMA_WRITE for iSER Data READ\n", |
| 2865 | isert_cmd); | 2869 | isert_cmd); |
| 2866 | 2870 | ||
| 2867 | return 1; | 2871 | return 1; |
| @@ -2878,20 +2882,20 @@ isert_get_dataout(struct iscsi_conn *conn, struct iscsi_cmd *cmd, bool recovery) | |||
| 2878 | struct ib_send_wr *wr_failed; | 2882 | struct ib_send_wr *wr_failed; |
| 2879 | int rc; | 2883 | int rc; |
| 2880 | 2884 | ||
| 2881 | pr_debug("Cmd: %p RDMA_READ data_length: %u write_data_done: %u\n", | 2885 | isert_dbg("Cmd: %p RDMA_READ data_length: %u write_data_done: %u\n", |
| 2882 | isert_cmd, se_cmd->data_length, cmd->write_data_done); | 2886 | isert_cmd, se_cmd->data_length, cmd->write_data_done); |
| 2883 | wr->iser_ib_op = ISER_IB_RDMA_READ; | 2887 | wr->iser_ib_op = ISER_IB_RDMA_READ; |
| 2884 | rc = device->reg_rdma_mem(conn, cmd, wr); | 2888 | rc = device->reg_rdma_mem(conn, cmd, wr); |
| 2885 | if (rc) { | 2889 | if (rc) { |
| 2886 | pr_err("Cmd: %p failed to prepare RDMA res\n", isert_cmd); | 2890 | isert_err("Cmd: %p failed to prepare RDMA res\n", isert_cmd); |
| 2887 | return rc; | 2891 | return rc; |
| 2888 | } | 2892 | } |
| 2889 | 2893 | ||
| 2890 | rc = ib_post_send(isert_conn->conn_qp, wr->send_wr, &wr_failed); | 2894 | rc = ib_post_send(isert_conn->conn_qp, wr->send_wr, &wr_failed); |
| 2891 | if (rc) | 2895 | if (rc) |
| 2892 | pr_warn("ib_post_send() failed for IB_WR_RDMA_READ\n"); | 2896 | isert_warn("ib_post_send() failed for IB_WR_RDMA_READ\n"); |
| 2893 | 2897 | ||
| 2894 | pr_debug("Cmd: %p posted RDMA_READ memory for ISER Data WRITE\n", | 2898 | isert_dbg("Cmd: %p posted RDMA_READ memory for ISER Data WRITE\n", |
| 2895 | isert_cmd); | 2899 | isert_cmd); |
| 2896 | 2900 | ||
| 2897 | return 0; | 2901 | return 0; |
| @@ -2907,7 +2911,7 @@ isert_immediate_queue(struct iscsi_conn *conn, struct iscsi_cmd *cmd, int state) | |||
| 2907 | ret = isert_put_nopin(cmd, conn, false); | 2911 | ret = isert_put_nopin(cmd, conn, false); |
| 2908 | break; | 2912 | break; |
| 2909 | default: | 2913 | default: |
| 2910 | pr_err("Unknown immediate state: 0x%02x\n", state); | 2914 | isert_err("Unknown immediate state: 0x%02x\n", state); |
| 2911 | ret = -EINVAL; | 2915 | ret = -EINVAL; |
| 2912 | break; | 2916 | break; |
| 2913 | } | 2917 | } |
| @@ -2947,7 +2951,7 @@ isert_response_queue(struct iscsi_conn *conn, struct iscsi_cmd *cmd, int state) | |||
| 2947 | ret = isert_put_response(conn, cmd); | 2951 | ret = isert_put_response(conn, cmd); |
| 2948 | break; | 2952 | break; |
| 2949 | default: | 2953 | default: |
| 2950 | pr_err("Unknown response state: 0x%02x\n", state); | 2954 | isert_err("Unknown response state: 0x%02x\n", state); |
| 2951 | ret = -EINVAL; | 2955 | ret = -EINVAL; |
| 2952 | break; | 2956 | break; |
| 2953 | } | 2957 | } |
| @@ -2964,26 +2968,26 @@ isert_setup_id(struct isert_np *isert_np) | |||
| 2964 | int ret; | 2968 | int ret; |
| 2965 | 2969 | ||
| 2966 | sa = (struct sockaddr *)&np->np_sockaddr; | 2970 | sa = (struct sockaddr *)&np->np_sockaddr; |
| 2967 | pr_debug("ksockaddr: %p, sa: %p\n", &np->np_sockaddr, sa); | 2971 | isert_dbg("ksockaddr: %p, sa: %p\n", &np->np_sockaddr, sa); |
| 2968 | 2972 | ||
| 2969 | id = rdma_create_id(isert_cma_handler, isert_np, | 2973 | id = rdma_create_id(isert_cma_handler, isert_np, |
| 2970 | RDMA_PS_TCP, IB_QPT_RC); | 2974 | RDMA_PS_TCP, IB_QPT_RC); |
| 2971 | if (IS_ERR(id)) { | 2975 | if (IS_ERR(id)) { |
| 2972 | pr_err("rdma_create_id() failed: %ld\n", PTR_ERR(id)); | 2976 | isert_err("rdma_create_id() failed: %ld\n", PTR_ERR(id)); |
| 2973 | ret = PTR_ERR(id); | 2977 | ret = PTR_ERR(id); |
| 2974 | goto out; | 2978 | goto out; |
| 2975 | } | 2979 | } |
| 2976 | pr_debug("id %p context %p\n", id, id->context); | 2980 | isert_dbg("id %p context %p\n", id, id->context); |
| 2977 | 2981 | ||
| 2978 | ret = rdma_bind_addr(id, sa); | 2982 | ret = rdma_bind_addr(id, sa); |
| 2979 | if (ret) { | 2983 | if (ret) { |
| 2980 | pr_err("rdma_bind_addr() failed: %d\n", ret); | 2984 | isert_err("rdma_bind_addr() failed: %d\n", ret); |
| 2981 | goto out_id; | 2985 | goto out_id; |
| 2982 | } | 2986 | } |
| 2983 | 2987 | ||
| 2984 | ret = rdma_listen(id, ISERT_RDMA_LISTEN_BACKLOG); | 2988 | ret = rdma_listen(id, ISERT_RDMA_LISTEN_BACKLOG); |
| 2985 | if (ret) { | 2989 | if (ret) { |
| 2986 | pr_err("rdma_listen() failed: %d\n", ret); | 2990 | isert_err("rdma_listen() failed: %d\n", ret); |
| 2987 | goto out_id; | 2991 | goto out_id; |
| 2988 | } | 2992 | } |
| 2989 | 2993 | ||
| @@ -3004,7 +3008,7 @@ isert_setup_np(struct iscsi_np *np, | |||
| 3004 | 3008 | ||
| 3005 | isert_np = kzalloc(sizeof(struct isert_np), GFP_KERNEL); | 3009 | isert_np = kzalloc(sizeof(struct isert_np), GFP_KERNEL); |
| 3006 | if (!isert_np) { | 3010 | if (!isert_np) { |
| 3007 | pr_err("Unable to allocate struct isert_np\n"); | 3011 | isert_err("Unable to allocate struct isert_np\n"); |
| 3008 | return -ENOMEM; | 3012 | return -ENOMEM; |
| 3009 | } | 3013 | } |
| 3010 | sema_init(&isert_np->np_sem, 0); | 3014 | sema_init(&isert_np->np_sem, 0); |
| @@ -3049,15 +3053,15 @@ isert_rdma_accept(struct isert_conn *isert_conn) | |||
| 3049 | cp.retry_count = 7; | 3053 | cp.retry_count = 7; |
| 3050 | cp.rnr_retry_count = 7; | 3054 | cp.rnr_retry_count = 7; |
| 3051 | 3055 | ||
| 3052 | pr_debug("Before rdma_accept >>>>>>>>>>>>>>>>>>>>.\n"); | 3056 | isert_dbg("Before rdma_accept >>>>>>>>>>>>>>>>>>>>.\n"); |
| 3053 | 3057 | ||
| 3054 | ret = rdma_accept(cm_id, &cp); | 3058 | ret = rdma_accept(cm_id, &cp); |
| 3055 | if (ret) { | 3059 | if (ret) { |
| 3056 | pr_err("rdma_accept() failed with: %d\n", ret); | 3060 | isert_err("rdma_accept() failed with: %d\n", ret); |
| 3057 | return ret; | 3061 | return ret; |
| 3058 | } | 3062 | } |
| 3059 | 3063 | ||
| 3060 | pr_debug("After rdma_accept >>>>>>>>>>>>>>>>>>>>>.\n"); | 3064 | isert_dbg("After rdma_accept >>>>>>>>>>>>>>>>>>>>>.\n"); |
| 3061 | 3065 | ||
| 3062 | return 0; | 3066 | return 0; |
| 3063 | } | 3067 | } |
| @@ -3068,10 +3072,10 @@ isert_get_login_rx(struct iscsi_conn *conn, struct iscsi_login *login) | |||
| 3068 | struct isert_conn *isert_conn = (struct isert_conn *)conn->context; | 3072 | struct isert_conn *isert_conn = (struct isert_conn *)conn->context; |
| 3069 | int ret; | 3073 | int ret; |
| 3070 | 3074 | ||
| 3071 | pr_info("before login_req comp conn: %p\n", isert_conn); | 3075 | isert_info("before login_req comp conn: %p\n", isert_conn); |
| 3072 | ret = wait_for_completion_interruptible(&isert_conn->login_req_comp); | 3076 | ret = wait_for_completion_interruptible(&isert_conn->login_req_comp); |
| 3073 | if (ret) { | 3077 | if (ret) { |
| 3074 | pr_err("isert_conn %p interrupted before got login req\n", | 3078 | isert_err("isert_conn %p interrupted before got login req\n", |
| 3075 | isert_conn); | 3079 | isert_conn); |
| 3076 | return ret; | 3080 | return ret; |
| 3077 | } | 3081 | } |
| @@ -3088,12 +3092,12 @@ isert_get_login_rx(struct iscsi_conn *conn, struct iscsi_login *login) | |||
| 3088 | 3092 | ||
| 3089 | isert_rx_login_req(isert_conn); | 3093 | isert_rx_login_req(isert_conn); |
| 3090 | 3094 | ||
| 3091 | pr_info("before conn_login_comp conn: %p\n", conn); | 3095 | isert_info("before conn_login_comp conn: %p\n", conn); |
| 3092 | ret = wait_for_completion_interruptible(&isert_conn->conn_login_comp); | 3096 | ret = wait_for_completion_interruptible(&isert_conn->conn_login_comp); |
| 3093 | if (ret) | 3097 | if (ret) |
| 3094 | return ret; | 3098 | return ret; |
| 3095 | 3099 | ||
| 3096 | pr_info("processing login->req: %p\n", login->req); | 3100 | isert_info("processing login->req: %p\n", login->req); |
| 3097 | 3101 | ||
| 3098 | return 0; | 3102 | return 0; |
| 3099 | } | 3103 | } |
| @@ -3147,7 +3151,7 @@ accept_wait: | |||
| 3147 | spin_lock_bh(&np->np_thread_lock); | 3151 | spin_lock_bh(&np->np_thread_lock); |
| 3148 | if (np->np_thread_state >= ISCSI_NP_THREAD_RESET) { | 3152 | if (np->np_thread_state >= ISCSI_NP_THREAD_RESET) { |
| 3149 | spin_unlock_bh(&np->np_thread_lock); | 3153 | spin_unlock_bh(&np->np_thread_lock); |
| 3150 | pr_debug("np_thread_state %d for isert_accept_np\n", | 3154 | isert_dbg("np_thread_state %d for isert_accept_np\n", |
| 3151 | np->np_thread_state); | 3155 | np->np_thread_state); |
| 3152 | /** | 3156 | /** |
| 3153 | * No point in stalling here when np_thread | 3157 | * No point in stalling here when np_thread |
| @@ -3174,7 +3178,7 @@ accept_wait: | |||
| 3174 | 3178 | ||
| 3175 | isert_set_conn_info(np, conn, isert_conn); | 3179 | isert_set_conn_info(np, conn, isert_conn); |
| 3176 | 3180 | ||
| 3177 | pr_debug("Processing isert_conn: %p\n", isert_conn); | 3181 | isert_dbg("Processing isert_conn: %p\n", isert_conn); |
| 3178 | 3182 | ||
| 3179 | return 0; | 3183 | return 0; |
| 3180 | } | 3184 | } |
| @@ -3197,11 +3201,11 @@ isert_free_np(struct iscsi_np *np) | |||
| 3197 | */ | 3201 | */ |
| 3198 | mutex_lock(&isert_np->np_accept_mutex); | 3202 | mutex_lock(&isert_np->np_accept_mutex); |
| 3199 | if (!list_empty(&isert_np->np_accept_list)) { | 3203 | if (!list_empty(&isert_np->np_accept_list)) { |
| 3200 | pr_info("Still have isert connections, cleaning up...\n"); | 3204 | isert_info("Still have isert connections, cleaning up...\n"); |
| 3201 | list_for_each_entry_safe(isert_conn, n, | 3205 | list_for_each_entry_safe(isert_conn, n, |
| 3202 | &isert_np->np_accept_list, | 3206 | &isert_np->np_accept_list, |
| 3203 | conn_accept_node) { | 3207 | conn_accept_node) { |
| 3204 | pr_info("cleaning isert_conn %p state (%d)\n", | 3208 | isert_info("cleaning isert_conn %p state (%d)\n", |
| 3205 | isert_conn, isert_conn->state); | 3209 | isert_conn, isert_conn->state); |
| 3206 | isert_connect_release(isert_conn); | 3210 | isert_connect_release(isert_conn); |
| 3207 | } | 3211 | } |
| @@ -3218,7 +3222,7 @@ static void isert_release_work(struct work_struct *work) | |||
| 3218 | struct isert_conn, | 3222 | struct isert_conn, |
| 3219 | release_work); | 3223 | release_work); |
| 3220 | 3224 | ||
| 3221 | pr_info("Starting release conn %p\n", isert_conn); | 3225 | isert_info("Starting release conn %p\n", isert_conn); |
| 3222 | 3226 | ||
| 3223 | wait_for_completion(&isert_conn->conn_wait); | 3227 | wait_for_completion(&isert_conn->conn_wait); |
| 3224 | 3228 | ||
| @@ -3226,7 +3230,7 @@ static void isert_release_work(struct work_struct *work) | |||
| 3226 | isert_conn->state = ISER_CONN_DOWN; | 3230 | isert_conn->state = ISER_CONN_DOWN; |
| 3227 | mutex_unlock(&isert_conn->conn_mutex); | 3231 | mutex_unlock(&isert_conn->conn_mutex); |
| 3228 | 3232 | ||
| 3229 | pr_info("Destroying conn %p\n", isert_conn); | 3233 | isert_info("Destroying conn %p\n", isert_conn); |
| 3230 | isert_put_conn(isert_conn); | 3234 | isert_put_conn(isert_conn); |
| 3231 | } | 3235 | } |
| 3232 | 3236 | ||
| @@ -3236,7 +3240,7 @@ isert_wait4logout(struct isert_conn *isert_conn) | |||
| 3236 | struct iscsi_conn *conn = isert_conn->conn; | 3240 | struct iscsi_conn *conn = isert_conn->conn; |
| 3237 | 3241 | ||
| 3238 | if (isert_conn->logout_posted) { | 3242 | if (isert_conn->logout_posted) { |
| 3239 | pr_info("conn %p wait for conn_logout_comp\n", isert_conn); | 3243 | isert_info("conn %p wait for conn_logout_comp\n", isert_conn); |
| 3240 | wait_for_completion_timeout(&conn->conn_logout_comp, | 3244 | wait_for_completion_timeout(&conn->conn_logout_comp, |
| 3241 | SECONDS_FOR_LOGOUT_COMP * HZ); | 3245 | SECONDS_FOR_LOGOUT_COMP * HZ); |
| 3242 | } | 3246 | } |
| @@ -3260,7 +3264,7 @@ isert_wait4flush(struct isert_conn *isert_conn) | |||
| 3260 | isert_conn->beacon.wr_id = ISER_BEACON_WRID; | 3264 | isert_conn->beacon.wr_id = ISER_BEACON_WRID; |
| 3261 | /* post an indication that all flush errors were consumed */ | 3265 | /* post an indication that all flush errors were consumed */ |
| 3262 | if (ib_post_recv(isert_conn->conn_qp, &isert_conn->beacon, &bad_wr)) { | 3266 | if (ib_post_recv(isert_conn->conn_qp, &isert_conn->beacon, &bad_wr)) { |
| 3263 | pr_err("conn %p failed to post beacon", isert_conn); | 3267 | isert_err("conn %p failed to post beacon", isert_conn); |
| 3264 | return; | 3268 | return; |
| 3265 | } | 3269 | } |
| 3266 | 3270 | ||
| @@ -3271,7 +3275,7 @@ static void isert_wait_conn(struct iscsi_conn *conn) | |||
| 3271 | { | 3275 | { |
| 3272 | struct isert_conn *isert_conn = conn->context; | 3276 | struct isert_conn *isert_conn = conn->context; |
| 3273 | 3277 | ||
| 3274 | pr_debug("isert_wait_conn: Starting \n"); | 3278 | isert_dbg("isert_wait_conn: Starting\n"); |
| 3275 | 3279 | ||
| 3276 | mutex_lock(&isert_conn->conn_mutex); | 3280 | mutex_lock(&isert_conn->conn_mutex); |
| 3277 | /* | 3281 | /* |
| @@ -3327,7 +3331,7 @@ static int __init isert_init(void) | |||
| 3327 | 3331 | ||
| 3328 | isert_comp_wq = alloc_workqueue("isert_comp_wq", 0, 0); | 3332 | isert_comp_wq = alloc_workqueue("isert_comp_wq", 0, 0); |
| 3329 | if (!isert_comp_wq) { | 3333 | if (!isert_comp_wq) { |
| 3330 | pr_err("Unable to allocate isert_comp_wq\n"); | 3334 | isert_err("Unable to allocate isert_comp_wq\n"); |
| 3331 | ret = -ENOMEM; | 3335 | ret = -ENOMEM; |
| 3332 | return -ENOMEM; | 3336 | return -ENOMEM; |
| 3333 | } | 3337 | } |
| @@ -3335,13 +3339,13 @@ static int __init isert_init(void) | |||
| 3335 | isert_release_wq = alloc_workqueue("isert_release_wq", WQ_UNBOUND, | 3339 | isert_release_wq = alloc_workqueue("isert_release_wq", WQ_UNBOUND, |
| 3336 | WQ_UNBOUND_MAX_ACTIVE); | 3340 | WQ_UNBOUND_MAX_ACTIVE); |
| 3337 | if (!isert_release_wq) { | 3341 | if (!isert_release_wq) { |
| 3338 | pr_err("Unable to allocate isert_release_wq\n"); | 3342 | isert_err("Unable to allocate isert_release_wq\n"); |
| 3339 | ret = -ENOMEM; | 3343 | ret = -ENOMEM; |
| 3340 | goto destroy_comp_wq; | 3344 | goto destroy_comp_wq; |
| 3341 | } | 3345 | } |
| 3342 | 3346 | ||
| 3343 | iscsit_register_transport(&iser_target_transport); | 3347 | iscsit_register_transport(&iser_target_transport); |
| 3344 | pr_info("iSER_TARGET[0] - Loaded iser_target_transport\n"); | 3348 | isert_info("iSER_TARGET[0] - Loaded iser_target_transport\n"); |
| 3345 | 3349 | ||
| 3346 | return 0; | 3350 | return 0; |
| 3347 | 3351 | ||
| @@ -3357,7 +3361,7 @@ static void __exit isert_exit(void) | |||
| 3357 | destroy_workqueue(isert_release_wq); | 3361 | destroy_workqueue(isert_release_wq); |
| 3358 | destroy_workqueue(isert_comp_wq); | 3362 | destroy_workqueue(isert_comp_wq); |
| 3359 | iscsit_unregister_transport(&iser_target_transport); | 3363 | iscsit_unregister_transport(&iser_target_transport); |
| 3360 | pr_debug("iSER_TARGET[0] - Released iser_target_transport\n"); | 3364 | isert_dbg("iSER_TARGET[0] - Released iser_target_transport\n"); |
| 3361 | } | 3365 | } |
| 3362 | 3366 | ||
| 3363 | MODULE_DESCRIPTION("iSER-Target for mainline target infrastructure"); | 3367 | MODULE_DESCRIPTION("iSER-Target for mainline target infrastructure"); |
diff --git a/drivers/infiniband/ulp/isert/ib_isert.h b/drivers/infiniband/ulp/isert/ib_isert.h index e89f384efc22..8dc8415d152d 100644 --- a/drivers/infiniband/ulp/isert/ib_isert.h +++ b/drivers/infiniband/ulp/isert/ib_isert.h | |||
| @@ -4,6 +4,33 @@ | |||
| 4 | #include <rdma/ib_verbs.h> | 4 | #include <rdma/ib_verbs.h> |
| 5 | #include <rdma/rdma_cm.h> | 5 | #include <rdma/rdma_cm.h> |
| 6 | 6 | ||
| 7 | #define DRV_NAME "isert" | ||
| 8 | #define PFX DRV_NAME ": " | ||
| 9 | |||
| 10 | #define isert_dbg(fmt, arg...) \ | ||
| 11 | do { \ | ||
| 12 | if (unlikely(isert_debug_level > 2)) \ | ||
| 13 | printk(KERN_DEBUG PFX "%s: " fmt,\ | ||
| 14 | __func__ , ## arg); \ | ||
| 15 | } while (0) | ||
| 16 | |||
| 17 | #define isert_warn(fmt, arg...) \ | ||
| 18 | do { \ | ||
| 19 | if (unlikely(isert_debug_level > 0)) \ | ||
| 20 | pr_warn(PFX "%s: " fmt, \ | ||
| 21 | __func__ , ## arg); \ | ||
| 22 | } while (0) | ||
| 23 | |||
| 24 | #define isert_info(fmt, arg...) \ | ||
| 25 | do { \ | ||
| 26 | if (unlikely(isert_debug_level > 1)) \ | ||
| 27 | pr_info(PFX "%s: " fmt, \ | ||
| 28 | __func__ , ## arg); \ | ||
| 29 | } while (0) | ||
| 30 | |||
| 31 | #define isert_err(fmt, arg...) \ | ||
| 32 | pr_err(PFX "%s: " fmt, __func__ , ## arg) | ||
| 33 | |||
| 7 | #define ISERT_RDMA_LISTEN_BACKLOG 10 | 34 | #define ISERT_RDMA_LISTEN_BACKLOG 10 |
| 8 | #define ISCSI_ISER_SG_TABLESIZE 256 | 35 | #define ISCSI_ISER_SG_TABLESIZE 256 |
| 9 | #define ISER_FASTREG_LI_WRID 0xffffffffffffffffULL | 36 | #define ISER_FASTREG_LI_WRID 0xffffffffffffffffULL |
