diff options
Diffstat (limited to 'drivers/infiniband/ulp/iser/iser_verbs.c')
-rw-r--r-- | drivers/infiniband/ulp/iser/iser_verbs.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/infiniband/ulp/iser/iser_verbs.c b/drivers/infiniband/ulp/iser/iser_verbs.c index 89b956044060..202c00dc6a76 100644 --- a/drivers/infiniband/ulp/iser/iser_verbs.c +++ b/drivers/infiniband/ulp/iser/iser_verbs.c | |||
@@ -453,7 +453,7 @@ static void iser_disconnected_handler(struct rdma_cm_id *cma_id) | |||
453 | ISCSI_ERR_CONN_FAILED); | 453 | ISCSI_ERR_CONN_FAILED); |
454 | 454 | ||
455 | /* Complete the termination process if no posts are pending */ | 455 | /* Complete the termination process if no posts are pending */ |
456 | if ((atomic_read(&ib_conn->post_recv_buf_count) == 0) && | 456 | if (ib_conn->post_recv_buf_count == 0 && |
457 | (atomic_read(&ib_conn->post_send_buf_count) == 0)) { | 457 | (atomic_read(&ib_conn->post_send_buf_count) == 0)) { |
458 | ib_conn->state = ISER_CONN_DOWN; | 458 | ib_conn->state = ISER_CONN_DOWN; |
459 | wake_up_interruptible(&ib_conn->wait); | 459 | wake_up_interruptible(&ib_conn->wait); |
@@ -500,7 +500,7 @@ void iser_conn_init(struct iser_conn *ib_conn) | |||
500 | { | 500 | { |
501 | ib_conn->state = ISER_CONN_INIT; | 501 | ib_conn->state = ISER_CONN_INIT; |
502 | init_waitqueue_head(&ib_conn->wait); | 502 | init_waitqueue_head(&ib_conn->wait); |
503 | atomic_set(&ib_conn->post_recv_buf_count, 0); | 503 | ib_conn->post_recv_buf_count = 0; |
504 | atomic_set(&ib_conn->post_send_buf_count, 0); | 504 | atomic_set(&ib_conn->post_send_buf_count, 0); |
505 | atomic_set(&ib_conn->refcount, 1); | 505 | atomic_set(&ib_conn->refcount, 1); |
506 | INIT_LIST_HEAD(&ib_conn->conn_list); | 506 | INIT_LIST_HEAD(&ib_conn->conn_list); |
@@ -651,11 +651,11 @@ int iser_post_recvl(struct iser_conn *ib_conn) | |||
651 | rx_wr.num_sge = 1; | 651 | rx_wr.num_sge = 1; |
652 | rx_wr.next = NULL; | 652 | rx_wr.next = NULL; |
653 | 653 | ||
654 | atomic_inc(&ib_conn->post_recv_buf_count); | 654 | ib_conn->post_recv_buf_count++; |
655 | ib_ret = ib_post_recv(ib_conn->qp, &rx_wr, &rx_wr_failed); | 655 | ib_ret = ib_post_recv(ib_conn->qp, &rx_wr, &rx_wr_failed); |
656 | if (ib_ret) { | 656 | if (ib_ret) { |
657 | iser_err("ib_post_recv failed ret=%d\n", ib_ret); | 657 | iser_err("ib_post_recv failed ret=%d\n", ib_ret); |
658 | atomic_dec(&ib_conn->post_recv_buf_count); | 658 | ib_conn->post_recv_buf_count--; |
659 | } | 659 | } |
660 | return ib_ret; | 660 | return ib_ret; |
661 | } | 661 | } |
@@ -679,11 +679,11 @@ int iser_post_recvm(struct iser_conn *ib_conn, int count) | |||
679 | rx_wr--; | 679 | rx_wr--; |
680 | rx_wr->next = NULL; /* mark end of work requests list */ | 680 | rx_wr->next = NULL; /* mark end of work requests list */ |
681 | 681 | ||
682 | atomic_add(count, &ib_conn->post_recv_buf_count); | 682 | ib_conn->post_recv_buf_count += count; |
683 | ib_ret = ib_post_recv(ib_conn->qp, ib_conn->rx_wr, &rx_wr_failed); | 683 | ib_ret = ib_post_recv(ib_conn->qp, ib_conn->rx_wr, &rx_wr_failed); |
684 | if (ib_ret) { | 684 | if (ib_ret) { |
685 | iser_err("ib_post_recv failed ret=%d\n", ib_ret); | 685 | iser_err("ib_post_recv failed ret=%d\n", ib_ret); |
686 | atomic_sub(count, &ib_conn->post_recv_buf_count); | 686 | ib_conn->post_recv_buf_count -= count; |
687 | } else | 687 | } else |
688 | ib_conn->rx_desc_head = my_rx_head; | 688 | ib_conn->rx_desc_head = my_rx_head; |
689 | return ib_ret; | 689 | return ib_ret; |
@@ -778,14 +778,14 @@ static void iser_handle_comp_error(struct iser_desc *desc, | |||
778 | 778 | ||
779 | if ((char *)desc == ib_conn->login_buf || | 779 | if ((char *)desc == ib_conn->login_buf || |
780 | (rx_first <= rx && rx <= rx_last)) | 780 | (rx_first <= rx && rx <= rx_last)) |
781 | atomic_dec(&ib_conn->post_recv_buf_count); | 781 | ib_conn->post_recv_buf_count--; |
782 | else { /* type is TX control/command/dataout */ | 782 | else { /* type is TX control/command/dataout */ |
783 | if (desc->type == ISCSI_TX_DATAOUT) | 783 | if (desc->type == ISCSI_TX_DATAOUT) |
784 | kmem_cache_free(ig.desc_cache, desc); | 784 | kmem_cache_free(ig.desc_cache, desc); |
785 | atomic_dec(&ib_conn->post_send_buf_count); | 785 | atomic_dec(&ib_conn->post_send_buf_count); |
786 | } | 786 | } |
787 | 787 | ||
788 | if (atomic_read(&ib_conn->post_recv_buf_count) == 0 && | 788 | if (ib_conn->post_recv_buf_count == 0 && |
789 | atomic_read(&ib_conn->post_send_buf_count) == 0) { | 789 | atomic_read(&ib_conn->post_send_buf_count) == 0) { |
790 | /* getting here when the state is UP means that the conn is * | 790 | /* getting here when the state is UP means that the conn is * |
791 | * being terminated asynchronously from the iSCSI layer's * | 791 | * being terminated asynchronously from the iSCSI layer's * |