diff options
author | Erez Zilber <erezz@voltaire.com> | 2006-09-27 08:27:10 -0400 |
---|---|---|
committer | Roland Dreier <rolandd@cisco.com> | 2006-09-28 13:53:16 -0400 |
commit | 87e8df7a273c7c1acb864c90b5253609c44375a6 (patch) | |
tree | e1de2523387f416a67570122c2632ca3be80aafd | |
parent | ee30cb5b0b65392843cc3beaba48160ee4a3764e (diff) |
IB/iser: Have iSER data transaction object point to iSER conn
iSER uses a data transaction object (struct iser_dto) as part
of its IB data descriptors (struct iser_desc) management.
It also uses a hierarchy of connection structures pointing to
each other. A DTO may exist even after the iscsi_iser connection
pointed by it is destroyed (eg one that is bound to a post
receive buffer which was flushed by the IB HW). Hence DTOs need
point to the lowest connection, which is struct iser_conn.
Signed-off-by: Erez Zilber <erezz@voltaire.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
-rw-r--r-- | drivers/infiniband/ulp/iser/iscsi_iser.c | 2 | ||||
-rw-r--r-- | drivers/infiniband/ulp/iser/iscsi_iser.h | 2 | ||||
-rw-r--r-- | drivers/infiniband/ulp/iser/iser_initiator.c | 11 | ||||
-rw-r--r-- | drivers/infiniband/ulp/iser/iser_verbs.c | 8 |
4 files changed, 14 insertions, 9 deletions
diff --git a/drivers/infiniband/ulp/iser/iscsi_iser.c b/drivers/infiniband/ulp/iser/iscsi_iser.c index 2a14fe2e3226..eb6f98d82289 100644 --- a/drivers/infiniband/ulp/iser/iscsi_iser.c +++ b/drivers/infiniband/ulp/iser/iscsi_iser.c | |||
@@ -317,6 +317,8 @@ iscsi_iser_conn_destroy(struct iscsi_cls_conn *cls_conn) | |||
317 | struct iscsi_iser_conn *iser_conn = conn->dd_data; | 317 | struct iscsi_iser_conn *iser_conn = conn->dd_data; |
318 | 318 | ||
319 | iscsi_conn_teardown(cls_conn); | 319 | iscsi_conn_teardown(cls_conn); |
320 | if (iser_conn->ib_conn) | ||
321 | iser_conn->ib_conn->iser_conn = NULL; | ||
320 | kfree(iser_conn); | 322 | kfree(iser_conn); |
321 | } | 323 | } |
322 | 324 | ||
diff --git a/drivers/infiniband/ulp/iser/iscsi_iser.h b/drivers/infiniband/ulp/iser/iscsi_iser.h index 2cf9ae0def1c..2826540d2f23 100644 --- a/drivers/infiniband/ulp/iser/iscsi_iser.h +++ b/drivers/infiniband/ulp/iser/iscsi_iser.h | |||
@@ -192,7 +192,7 @@ struct iser_regd_buf { | |||
192 | 192 | ||
193 | struct iser_dto { | 193 | struct iser_dto { |
194 | struct iscsi_iser_cmd_task *ctask; | 194 | struct iscsi_iser_cmd_task *ctask; |
195 | struct iscsi_iser_conn *conn; | 195 | struct iser_conn *ib_conn; |
196 | int notify_enable; | 196 | int notify_enable; |
197 | 197 | ||
198 | /* vector of registered buffers */ | 198 | /* vector of registered buffers */ |
diff --git a/drivers/infiniband/ulp/iser/iser_initiator.c b/drivers/infiniband/ulp/iser/iser_initiator.c index ccf56f6f7236..14ae61e07591 100644 --- a/drivers/infiniband/ulp/iser/iser_initiator.c +++ b/drivers/infiniband/ulp/iser/iser_initiator.c | |||
@@ -249,7 +249,7 @@ static int iser_post_receive_control(struct iscsi_conn *conn) | |||
249 | } | 249 | } |
250 | 250 | ||
251 | recv_dto = &rx_desc->dto; | 251 | recv_dto = &rx_desc->dto; |
252 | recv_dto->conn = iser_conn; | 252 | recv_dto->ib_conn = iser_conn->ib_conn; |
253 | recv_dto->regd_vector_len = 0; | 253 | recv_dto->regd_vector_len = 0; |
254 | 254 | ||
255 | regd_hdr = &rx_desc->hdr_regd_buf; | 255 | regd_hdr = &rx_desc->hdr_regd_buf; |
@@ -296,7 +296,7 @@ static void iser_create_send_desc(struct iscsi_iser_conn *iser_conn, | |||
296 | regd_hdr->virt_addr = tx_desc; /* == &tx_desc->iser_header */ | 296 | regd_hdr->virt_addr = tx_desc; /* == &tx_desc->iser_header */ |
297 | regd_hdr->data_size = ISER_TOTAL_HEADERS_LEN; | 297 | regd_hdr->data_size = ISER_TOTAL_HEADERS_LEN; |
298 | 298 | ||
299 | send_dto->conn = iser_conn; | 299 | send_dto->ib_conn = iser_conn->ib_conn; |
300 | send_dto->notify_enable = 1; | 300 | send_dto->notify_enable = 1; |
301 | send_dto->regd_vector_len = 0; | 301 | send_dto->regd_vector_len = 0; |
302 | 302 | ||
@@ -588,7 +588,7 @@ void iser_rcv_completion(struct iser_desc *rx_desc, | |||
588 | unsigned long dto_xfer_len) | 588 | unsigned long dto_xfer_len) |
589 | { | 589 | { |
590 | struct iser_dto *dto = &rx_desc->dto; | 590 | struct iser_dto *dto = &rx_desc->dto; |
591 | struct iscsi_iser_conn *conn = dto->conn; | 591 | struct iscsi_iser_conn *conn = dto->ib_conn->iser_conn; |
592 | struct iscsi_session *session = conn->iscsi_conn->session; | 592 | struct iscsi_session *session = conn->iscsi_conn->session; |
593 | struct iscsi_cmd_task *ctask; | 593 | struct iscsi_cmd_task *ctask; |
594 | struct iscsi_iser_cmd_task *iser_ctask; | 594 | struct iscsi_iser_cmd_task *iser_ctask; |
@@ -641,7 +641,8 @@ void iser_rcv_completion(struct iser_desc *rx_desc, | |||
641 | void iser_snd_completion(struct iser_desc *tx_desc) | 641 | void iser_snd_completion(struct iser_desc *tx_desc) |
642 | { | 642 | { |
643 | struct iser_dto *dto = &tx_desc->dto; | 643 | struct iser_dto *dto = &tx_desc->dto; |
644 | struct iscsi_iser_conn *iser_conn = dto->conn; | 644 | struct iser_conn *ib_conn = dto->ib_conn; |
645 | struct iscsi_iser_conn *iser_conn = ib_conn->iser_conn; | ||
645 | struct iscsi_conn *conn = iser_conn->iscsi_conn; | 646 | struct iscsi_conn *conn = iser_conn->iscsi_conn; |
646 | struct iscsi_mgmt_task *mtask; | 647 | struct iscsi_mgmt_task *mtask; |
647 | 648 | ||
@@ -652,7 +653,7 @@ void iser_snd_completion(struct iser_desc *tx_desc) | |||
652 | if (tx_desc->type == ISCSI_TX_DATAOUT) | 653 | if (tx_desc->type == ISCSI_TX_DATAOUT) |
653 | kmem_cache_free(ig.desc_cache, tx_desc); | 654 | kmem_cache_free(ig.desc_cache, tx_desc); |
654 | 655 | ||
655 | atomic_dec(&iser_conn->ib_conn->post_send_buf_count); | 656 | atomic_dec(&ib_conn->post_send_buf_count); |
656 | 657 | ||
657 | write_lock(conn->recv_lock); | 658 | write_lock(conn->recv_lock); |
658 | if (conn->suspend_tx) { | 659 | if (conn->suspend_tx) { |
diff --git a/drivers/infiniband/ulp/iser/iser_verbs.c b/drivers/infiniband/ulp/iser/iser_verbs.c index ecdca7fc1e4c..18a000034996 100644 --- a/drivers/infiniband/ulp/iser/iser_verbs.c +++ b/drivers/infiniband/ulp/iser/iser_verbs.c | |||
@@ -571,6 +571,8 @@ void iser_conn_release(struct iser_conn *ib_conn) | |||
571 | /* on EVENT_ADDR_ERROR there's no device yet for this conn */ | 571 | /* on EVENT_ADDR_ERROR there's no device yet for this conn */ |
572 | if (device != NULL) | 572 | if (device != NULL) |
573 | iser_device_try_release(device); | 573 | iser_device_try_release(device); |
574 | if (ib_conn->iser_conn) | ||
575 | ib_conn->iser_conn->ib_conn = NULL; | ||
574 | kfree(ib_conn); | 576 | kfree(ib_conn); |
575 | } | 577 | } |
576 | 578 | ||
@@ -694,7 +696,7 @@ int iser_post_recv(struct iser_desc *rx_desc) | |||
694 | struct iser_dto *recv_dto = &rx_desc->dto; | 696 | struct iser_dto *recv_dto = &rx_desc->dto; |
695 | 697 | ||
696 | /* Retrieve conn */ | 698 | /* Retrieve conn */ |
697 | ib_conn = recv_dto->conn->ib_conn; | 699 | ib_conn = recv_dto->ib_conn; |
698 | 700 | ||
699 | iser_dto_to_iov(recv_dto, iov, 2); | 701 | iser_dto_to_iov(recv_dto, iov, 2); |
700 | 702 | ||
@@ -727,7 +729,7 @@ int iser_post_send(struct iser_desc *tx_desc) | |||
727 | struct iser_conn *ib_conn; | 729 | struct iser_conn *ib_conn; |
728 | struct iser_dto *dto = &tx_desc->dto; | 730 | struct iser_dto *dto = &tx_desc->dto; |
729 | 731 | ||
730 | ib_conn = dto->conn->ib_conn; | 732 | ib_conn = dto->ib_conn; |
731 | 733 | ||
732 | iser_dto_to_iov(dto, iov, MAX_REGD_BUF_VECTOR_LEN); | 734 | iser_dto_to_iov(dto, iov, MAX_REGD_BUF_VECTOR_LEN); |
733 | 735 | ||
@@ -774,7 +776,7 @@ static void iser_comp_error_worker(void *data) | |||
774 | static void iser_handle_comp_error(struct iser_desc *desc) | 776 | static void iser_handle_comp_error(struct iser_desc *desc) |
775 | { | 777 | { |
776 | struct iser_dto *dto = &desc->dto; | 778 | struct iser_dto *dto = &desc->dto; |
777 | struct iser_conn *ib_conn = dto->conn->ib_conn; | 779 | struct iser_conn *ib_conn = dto->ib_conn; |
778 | 780 | ||
779 | iser_dto_buffs_release(dto); | 781 | iser_dto_buffs_release(dto); |
780 | 782 | ||