IB/iser: Protect iser state machine with a mutex
authorAriel Nahum <arieln@mellanox.com>
Thu, 31 Jul 2014 10:27:49 +0000 (13:27 +0300)
committerRoland Dreier <roland@purestorage.com>
Fri, 1 Aug 2014 22:10:05 +0000 (15:10 -0700)
commit504130c039f917aba8b145fe8ea99be95e662fca
tree601a9605d25be528f8e60c9e9161d6c30d06181f
parentf1a8bf0983207bebebd13c0507cb341fbffc5ed7
IB/iser: Protect iser state machine with a mutex

The iser connection state lookups and transitions are not fully protected.

Some transitions are protected with a spinlock, and in some cases the
state is accessed unprotected due to specific assumptions of the flow.

Introduce a new mutex to protect the connection state access. We use a
mutex since we need to also include a scheduling operations executed
under the state lock.

Each state transition/condition and its corresponding action will be
protected with the state mutex.

The rdma_cm events handler acquires the mutex when handling connection
events. Since iser connection state can transition to DOWN
concurrently during connection establishment, we bailout from
addr/route resolution events when the state is not PENDING.

This addresses a scenario where ep_poll retries expire during CMA
connection establishment. In this case ep_disconnect is invoked while
CMA events keep coming (address/route resolution, connected, etc...).

Signed-off-by: Ariel Nahum <arieln@mellanox.com>
Signed-off-by: Sagi Grimberg <sagig@mellanox.com>
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: Roland Dreier <roland@purestorage.com>
drivers/infiniband/ulp/iser/iscsi_iser.c
drivers/infiniband/ulp/iser/iscsi_iser.h
drivers/infiniband/ulp/iser/iser_verbs.c
This page took 0.025955 seconds and 5 git commands to generate.