]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
IB/iser: Have iSER data transaction object point to iSER conn
authorErez Zilber <erezz@voltaire.com>
Wed, 27 Sep 2006 12:27:10 +0000 (15:27 +0300)
committerRoland Dreier <rolandd@cisco.com>
Thu, 28 Sep 2006 17:53:16 +0000 (10:53 -0700)
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>
drivers/infiniband/ulp/iser/iscsi_iser.c
drivers/infiniband/ulp/iser/iscsi_iser.h
drivers/infiniband/ulp/iser/iser_initiator.c
drivers/infiniband/ulp/iser/iser_verbs.c

index 2a14fe2e3226c7a2cb987ba4979ae0fb2ee186bb..eb6f98d822899bcf71ab05ffd376a835dcc3e89f 100644 (file)
@@ -317,6 +317,8 @@ iscsi_iser_conn_destroy(struct iscsi_cls_conn *cls_conn)
        struct iscsi_iser_conn *iser_conn = conn->dd_data;
 
        iscsi_conn_teardown(cls_conn);
+       if (iser_conn->ib_conn)
+               iser_conn->ib_conn->iser_conn = NULL;
        kfree(iser_conn);
 }
 
index 2cf9ae0def1cfb827f883992198af29d5a8b6ba1..2826540d2f23264e4d6326538e11ca799360d6f9 100644 (file)
@@ -192,7 +192,7 @@ struct iser_regd_buf {
 
 struct iser_dto {
        struct iscsi_iser_cmd_task *ctask;
-       struct iscsi_iser_conn     *conn;
+       struct iser_conn *ib_conn;
        int                        notify_enable;
 
        /* vector of registered buffers */
index ccf56f6f7236a076be2c81c769a9bcf9f2f21a1e..14ae61e0759129fa21051f522b2f475007b16208 100644 (file)
@@ -249,7 +249,7 @@ static int iser_post_receive_control(struct iscsi_conn *conn)
        }
 
        recv_dto = &rx_desc->dto;
-       recv_dto->conn          = iser_conn;
+       recv_dto->ib_conn = iser_conn->ib_conn;
        recv_dto->regd_vector_len = 0;
 
        regd_hdr = &rx_desc->hdr_regd_buf;
@@ -296,7 +296,7 @@ static void iser_create_send_desc(struct iscsi_iser_conn *iser_conn,
        regd_hdr->virt_addr  = tx_desc; /* == &tx_desc->iser_header */
        regd_hdr->data_size  = ISER_TOTAL_HEADERS_LEN;
 
-       send_dto->conn          = iser_conn;
+       send_dto->ib_conn         = iser_conn->ib_conn;
        send_dto->notify_enable   = 1;
        send_dto->regd_vector_len = 0;
 
@@ -588,7 +588,7 @@ void iser_rcv_completion(struct iser_desc *rx_desc,
                         unsigned long dto_xfer_len)
 {
        struct iser_dto        *dto = &rx_desc->dto;
-       struct iscsi_iser_conn *conn = dto->conn;
+       struct iscsi_iser_conn *conn = dto->ib_conn->iser_conn;
        struct iscsi_session *session = conn->iscsi_conn->session;
        struct iscsi_cmd_task *ctask;
        struct iscsi_iser_cmd_task *iser_ctask;
@@ -641,7 +641,8 @@ void iser_rcv_completion(struct iser_desc *rx_desc,
 void iser_snd_completion(struct iser_desc *tx_desc)
 {
        struct iser_dto        *dto = &tx_desc->dto;
-       struct iscsi_iser_conn *iser_conn = dto->conn;
+       struct iser_conn       *ib_conn = dto->ib_conn;
+       struct iscsi_iser_conn *iser_conn = ib_conn->iser_conn;
        struct iscsi_conn      *conn = iser_conn->iscsi_conn;
        struct iscsi_mgmt_task *mtask;
 
@@ -652,7 +653,7 @@ void iser_snd_completion(struct iser_desc *tx_desc)
        if (tx_desc->type == ISCSI_TX_DATAOUT)
                kmem_cache_free(ig.desc_cache, tx_desc);
 
-       atomic_dec(&iser_conn->ib_conn->post_send_buf_count);
+       atomic_dec(&ib_conn->post_send_buf_count);
 
        write_lock(conn->recv_lock);
        if (conn->suspend_tx) {
index ecdca7fc1e4cf0466f58bd6d89b4153891b71e0b..18a0000349965dc03438ecf641358c18efdbdf18 100644 (file)
@@ -571,6 +571,8 @@ void iser_conn_release(struct iser_conn *ib_conn)
        /* on EVENT_ADDR_ERROR there's no device yet for this conn */
        if (device != NULL)
                iser_device_try_release(device);
+       if (ib_conn->iser_conn)
+               ib_conn->iser_conn->ib_conn = NULL;
        kfree(ib_conn);
 }
 
@@ -694,7 +696,7 @@ int iser_post_recv(struct iser_desc *rx_desc)
        struct iser_dto   *recv_dto = &rx_desc->dto;
 
        /* Retrieve conn */
-       ib_conn = recv_dto->conn->ib_conn;
+       ib_conn = recv_dto->ib_conn;
 
        iser_dto_to_iov(recv_dto, iov, 2);
 
@@ -727,7 +729,7 @@ int iser_post_send(struct iser_desc *tx_desc)
        struct iser_conn  *ib_conn;
        struct iser_dto   *dto = &tx_desc->dto;
 
-       ib_conn = dto->conn->ib_conn;
+       ib_conn = dto->ib_conn;
 
        iser_dto_to_iov(dto, iov, MAX_REGD_BUF_VECTOR_LEN);
 
@@ -774,7 +776,7 @@ static void iser_comp_error_worker(void *data)
 static void iser_handle_comp_error(struct iser_desc *desc)
 {
        struct iser_dto  *dto     = &desc->dto;
-       struct iser_conn *ib_conn = dto->conn->ib_conn;
+       struct iser_conn *ib_conn = dto->ib_conn;
 
        iser_dto_buffs_release(dto);