diff options
| author | Nicholas Bellinger <nab@linux-iscsi.org> | 2016-05-15 01:23:34 -0400 |
|---|---|---|
| committer | Nicholas Bellinger <nab@linux-iscsi.org> | 2016-05-17 01:23:33 -0400 |
| commit | bd027d856d3d7260017d0dc932201ce5fd7561f9 (patch) | |
| tree | d2891ed08f6e401654fe5b3be8524bd33f176e01 | |
| parent | d4b3fa4b0881b600ddeee9dd47b27dea9709f322 (diff) | |
iscsi-target: Convert transport drivers to signal rdma_shutdown
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>
| -rw-r--r-- | drivers/infiniband/ulp/isert/ib_isert.c | 1 | ||||
| -rw-r--r-- | drivers/target/iscsi/cxgbit/cxgbit_main.c | 1 | ||||
| -rw-r--r-- | drivers/target/iscsi/iscsi_target.c | 10 | ||||
| -rw-r--r-- | include/target/iscsi/iscsi_transport.h | 1 |
4 files changed, 7 insertions, 6 deletions
diff --git a/drivers/infiniband/ulp/isert/ib_isert.c b/drivers/infiniband/ulp/isert/ib_isert.c index 9118d7c04a71..eb32ba535434 100644 --- a/drivers/infiniband/ulp/isert/ib_isert.c +++ b/drivers/infiniband/ulp/isert/ib_isert.c | |||
| @@ -3285,6 +3285,7 @@ static void isert_get_rx_pdu(struct iscsi_conn *conn) | |||
| 3285 | static struct iscsit_transport iser_target_transport = { | 3285 | static struct iscsit_transport iser_target_transport = { |
| 3286 | .name = "IB/iSER", | 3286 | .name = "IB/iSER", |
| 3287 | .transport_type = ISCSI_INFINIBAND, | 3287 | .transport_type = ISCSI_INFINIBAND, |
| 3288 | .rdma_shutdown = true, | ||
| 3288 | .priv_size = sizeof(struct isert_cmd), | 3289 | .priv_size = sizeof(struct isert_cmd), |
| 3289 | .owner = THIS_MODULE, | 3290 | .owner = THIS_MODULE, |
| 3290 | .iscsit_setup_np = isert_setup_np, | 3291 | .iscsit_setup_np = isert_setup_np, |
diff --git a/drivers/target/iscsi/cxgbit/cxgbit_main.c b/drivers/target/iscsi/cxgbit/cxgbit_main.c index 39162987d009..c25f5313322c 100644 --- a/drivers/target/iscsi/cxgbit/cxgbit_main.c +++ b/drivers/target/iscsi/cxgbit/cxgbit_main.c | |||
| @@ -625,6 +625,7 @@ static enum target_prot_op cxgbit_get_sup_prot_ops(struct iscsi_conn *conn) | |||
| 625 | static struct iscsit_transport cxgbit_transport = { | 625 | static struct iscsit_transport cxgbit_transport = { |
| 626 | .name = DRV_NAME, | 626 | .name = DRV_NAME, |
| 627 | .transport_type = ISCSI_HW_OFFLOAD, | 627 | .transport_type = ISCSI_HW_OFFLOAD, |
| 628 | .rdma_shutdown = false, | ||
| 628 | .priv_size = sizeof(struct cxgbit_cmd), | 629 | .priv_size = sizeof(struct cxgbit_cmd), |
| 629 | .owner = THIS_MODULE, | 630 | .owner = THIS_MODULE, |
| 630 | .iscsit_setup_np = cxgbit_setup_np, | 631 | .iscsit_setup_np = cxgbit_setup_np, |
diff --git a/drivers/target/iscsi/iscsi_target.c b/drivers/target/iscsi/iscsi_target.c index bc743d2a71a2..50f3d3a0dd7b 100644 --- a/drivers/target/iscsi/iscsi_target.c +++ b/drivers/target/iscsi/iscsi_target.c | |||
| @@ -670,6 +670,7 @@ static enum target_prot_op iscsit_get_sup_prot_ops(struct iscsi_conn *conn) | |||
| 670 | static struct iscsit_transport iscsi_target_transport = { | 670 | static struct iscsit_transport iscsi_target_transport = { |
| 671 | .name = "iSCSI/TCP", | 671 | .name = "iSCSI/TCP", |
| 672 | .transport_type = ISCSI_TCP, | 672 | .transport_type = ISCSI_TCP, |
| 673 | .rdma_shutdown = false, | ||
| 673 | .owner = NULL, | 674 | .owner = NULL, |
| 674 | .iscsit_setup_np = iscsit_setup_np, | 675 | .iscsit_setup_np = iscsit_setup_np, |
| 675 | .iscsit_accept_np = iscsit_accept_np, | 676 | .iscsit_accept_np = iscsit_accept_np, |
| @@ -4087,8 +4088,7 @@ int iscsit_close_connection( | |||
| 4087 | * this for iser since isert_rx_opcode() does not wait on logout failure, | 4088 | * this for iser since isert_rx_opcode() does not wait on logout failure, |
| 4088 | * and to avoid iscsi_conn pointer dereference in iser-target code. | 4089 | * and to avoid iscsi_conn pointer dereference in iser-target code. |
| 4089 | */ | 4090 | */ |
| 4090 | if ((conn->conn_transport->transport_type == ISCSI_TCP) || | 4091 | if (!conn->conn_transport->rdma_shutdown) |
| 4091 | (conn->conn_transport->transport_type == ISCSI_HW_OFFLOAD)) | ||
| 4092 | complete(&conn->conn_logout_comp); | 4092 | complete(&conn->conn_logout_comp); |
| 4093 | 4093 | ||
| 4094 | if (!strcmp(current->comm, ISCSI_RX_THREAD_NAME)) { | 4094 | if (!strcmp(current->comm, ISCSI_RX_THREAD_NAME)) { |
| @@ -4399,8 +4399,7 @@ static void iscsit_logout_post_handler_closesession( | |||
| 4399 | * always sleep waiting for RX/TX thread shutdown to complete | 4399 | * always sleep waiting for RX/TX thread shutdown to complete |
| 4400 | * within iscsit_close_connection(). | 4400 | * within iscsit_close_connection(). |
| 4401 | */ | 4401 | */ |
| 4402 | if ((conn->conn_transport->transport_type == ISCSI_TCP) || | 4402 | if (!conn->conn_transport->rdma_shutdown) |
| 4403 | (conn->conn_transport->transport_type == ISCSI_HW_OFFLOAD)) | ||
| 4404 | sleep = cmpxchg(&conn->tx_thread_active, true, false); | 4403 | sleep = cmpxchg(&conn->tx_thread_active, true, false); |
| 4405 | 4404 | ||
| 4406 | atomic_set(&conn->conn_logout_remove, 0); | 4405 | atomic_set(&conn->conn_logout_remove, 0); |
| @@ -4417,8 +4416,7 @@ static void iscsit_logout_post_handler_samecid( | |||
| 4417 | { | 4416 | { |
| 4418 | int sleep = 1; | 4417 | int sleep = 1; |
| 4419 | 4418 | ||
| 4420 | if ((conn->conn_transport->transport_type == ISCSI_TCP) || | 4419 | if (!conn->conn_transport->rdma_shutdown) |
| 4421 | (conn->conn_transport->transport_type == ISCSI_HW_OFFLOAD)) | ||
| 4422 | sleep = cmpxchg(&conn->tx_thread_active, true, false); | 4420 | sleep = cmpxchg(&conn->tx_thread_active, true, false); |
| 4423 | 4421 | ||
| 4424 | atomic_set(&conn->conn_logout_remove, 0); | 4422 | atomic_set(&conn->conn_logout_remove, 0); |
diff --git a/include/target/iscsi/iscsi_transport.h b/include/target/iscsi/iscsi_transport.h index 3c2e10aac49c..40ac7cd80150 100644 --- a/include/target/iscsi/iscsi_transport.h +++ b/include/target/iscsi/iscsi_transport.h | |||
| @@ -6,6 +6,7 @@ struct iscsit_transport { | |||
| 6 | #define ISCSIT_TRANSPORT_NAME 16 | 6 | #define ISCSIT_TRANSPORT_NAME 16 |
| 7 | char name[ISCSIT_TRANSPORT_NAME]; | 7 | char name[ISCSIT_TRANSPORT_NAME]; |
| 8 | int transport_type; | 8 | int transport_type; |
| 9 | bool rdma_shutdown; | ||
| 9 | int priv_size; | 10 | int priv_size; |
| 10 | struct module *owner; | 11 | struct module *owner; |
| 11 | struct list_head t_node; | 12 | struct list_head t_node; |
