iser-target: Fix flush + disconnect completion handling
authorSagi Grimberg <sagig@mellanox.com>
Fri, 30 Jan 2015 22:17:26 +0000 (22:17 +0000)
committerDanny Wood <danwood76@gmail.com>
Tue, 29 Jan 2019 13:06:29 +0000 (13:06 +0000)
commitbf1c620289b062fc7f5b8ab784c8af5517fffc3c
tree1aa536a3e2cccdfd20f012ff2a5a5f87f4adf4e5
parentaac86a37f0135fd8e52e0b4dfdbcb42d41af5371
iser-target: Fix flush + disconnect completion handling

commit 128e9cc84566a84146baea2335b3824288eed817 upstream.

ISER_CONN_UP state is not sufficient to know if
we should wait for completion of flush errors and
disconnected_handler event.

Instead, split it to 2 states:
- ISER_CONN_UP: Got to CM connected phase, This state
indicates that we need to wait for a CM disconnect
event before going to teardown.

- ISER_CONN_FULL_FEATURE: Got to full feature phase
after we posted login response, This state indicates
that we posted recv buffers and we need to wait for
flush completions before going to teardown.

Also avoid deffering disconnected handler to a work,
and handle it within disconnected handler.
More work here is needed to handle DEVICE_REMOVAL event
correctly (cleanup all resources).

Squashed:

iser-target: Don't deffer disconnected handler to a work

Signed-off-by: Sagi Grimberg <sagig@mellanox.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/infiniband/ulp/isert/ib_isert.c
drivers/infiniband/ulp/isert/ib_isert.h