summaryrefslogtreecommitdiff
path: root/drivers/target
diff options
context:
space:
mode:
authorNicholas Bellinger <nab@linux-iscsi.org>2016-05-14 22:23:34 -0700
committerNicholas Bellinger <nab@linux-iscsi.org>2016-05-16 22:23:33 -0700
commitbd027d856d3d7260017d0dc932201ce5fd7561f9 (patch)
treed2891ed08f6e401654fe5b3be8524bd33f176e01 /drivers/target
parentd4b3fa4b0881b600ddeee9dd47b27dea9709f322 (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>
Diffstat (limited to 'drivers/target')
-rw-r--r--drivers/target/iscsi/cxgbit/cxgbit_main.c1
-rw-r--r--drivers/target/iscsi/iscsi_target.c10
2 files changed, 5 insertions, 6 deletions
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)
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,
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)
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);