]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
iscsi-target: Convert transport drivers to signal rdma_shutdown
authorNicholas Bellinger <nab@linux-iscsi.org>
Sun, 15 May 2016 05:23:34 +0000 (22:23 -0700)
committerNicholas Bellinger <nab@linux-iscsi.org>
Tue, 17 May 2016 05:23:33 +0000 (22:23 -0700)
Instead of special casing the handful of callers that check for
iser-target rdma verbs specific shutdown, use a simple flag at
iscsit_transport->rdma_shutdown so each driver can signal this.

Also, update iscsi-target/tcp + cxgbit to rdma_shutdown = false.

Cc: Varun Prakash <varun@chelsio.com>
Cc: Hariprasad Shenai <hariprasad@chelsio.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
drivers/infiniband/ulp/isert/ib_isert.c
drivers/target/iscsi/cxgbit/cxgbit_main.c
drivers/target/iscsi/iscsi_target.c
include/target/iscsi/iscsi_transport.h

index 9118d7c04a715e708f8bbedc2509301f25c19689..eb32ba5354349bfe9401ebceffba48f0127507d3 100644 (file)
@@ -3285,6 +3285,7 @@ static void isert_get_rx_pdu(struct iscsi_conn *conn)
 static struct iscsit_transport iser_target_transport = {
        .name                   = "IB/iSER",
        .transport_type         = ISCSI_INFINIBAND,
+       .rdma_shutdown          = true,
        .priv_size              = sizeof(struct isert_cmd),
        .owner                  = THIS_MODULE,
        .iscsit_setup_np        = isert_setup_np,
index 39162987d00940954e5ae6627d9463598b74f856..c25f5313322ce9ae2064a5b0fad35d93dda346b2 100644 (file)
@@ -625,6 +625,7 @@ static enum target_prot_op cxgbit_get_sup_prot_ops(struct iscsi_conn *conn)
 static struct iscsit_transport cxgbit_transport = {
        .name                   = DRV_NAME,
        .transport_type         = ISCSI_HW_OFFLOAD,
+       .rdma_shutdown          = false,
        .priv_size              = sizeof(struct cxgbit_cmd),
        .owner                  = THIS_MODULE,
        .iscsit_setup_np        = cxgbit_setup_np,
index bc743d2a71a2590d14a72d861e7d31bf031c9a89..50f3d3a0dd7b93d4e8789913997ebd67eeb70425 100644 (file)
@@ -670,6 +670,7 @@ static enum target_prot_op iscsit_get_sup_prot_ops(struct iscsi_conn *conn)
 static struct iscsit_transport iscsi_target_transport = {
        .name                   = "iSCSI/TCP",
        .transport_type         = ISCSI_TCP,
+       .rdma_shutdown          = false,
        .owner                  = NULL,
        .iscsit_setup_np        = iscsit_setup_np,
        .iscsit_accept_np       = iscsit_accept_np,
@@ -4087,8 +4088,7 @@ int iscsit_close_connection(
         * this for iser since isert_rx_opcode() does not wait on logout failure,
         * and to avoid iscsi_conn pointer dereference in iser-target code.
         */
-       if ((conn->conn_transport->transport_type == ISCSI_TCP) ||
-           (conn->conn_transport->transport_type == ISCSI_HW_OFFLOAD))
+       if (!conn->conn_transport->rdma_shutdown)
                complete(&conn->conn_logout_comp);
 
        if (!strcmp(current->comm, ISCSI_RX_THREAD_NAME)) {
@@ -4399,8 +4399,7 @@ static void iscsit_logout_post_handler_closesession(
         * always sleep waiting for RX/TX thread shutdown to complete
         * within iscsit_close_connection().
         */
-       if ((conn->conn_transport->transport_type == ISCSI_TCP) ||
-           (conn->conn_transport->transport_type == ISCSI_HW_OFFLOAD))
+       if (!conn->conn_transport->rdma_shutdown)
                sleep = cmpxchg(&conn->tx_thread_active, true, false);
 
        atomic_set(&conn->conn_logout_remove, 0);
@@ -4417,8 +4416,7 @@ static void iscsit_logout_post_handler_samecid(
 {
        int sleep = 1;
 
-       if ((conn->conn_transport->transport_type == ISCSI_TCP) ||
-           (conn->conn_transport->transport_type == ISCSI_HW_OFFLOAD))
+       if (!conn->conn_transport->rdma_shutdown)
                sleep = cmpxchg(&conn->tx_thread_active, true, false);
 
        atomic_set(&conn->conn_logout_remove, 0);
index 3c2e10aac49c4522a68e65b0d738c9a88a4d8f64..40ac7cd801505db68a979a4fc4a22a6eb71019be 100644 (file)
@@ -6,6 +6,7 @@ struct iscsit_transport {
 #define ISCSIT_TRANSPORT_NAME  16
        char name[ISCSIT_TRANSPORT_NAME];
        int transport_type;
+       bool rdma_shutdown;
        int priv_size;
        struct module *owner;
        struct list_head t_node;