]> www.infradead.org Git - users/jedix/linux-maple.git/commit
qla2xxx: Delete session if initiator is gone from FW
authorAlexei Potashnik <alexei@purestorage.com>
Wed, 13 Sep 2017 08:57:31 +0000 (14:27 +0530)
committerBrian Maly <brian.maly@oracle.com>
Thu, 2 Nov 2017 18:14:14 +0000 (14:14 -0400)
commitdd9c802f0785bed73c344c802c0fb6aacf7798ae
tree5410f76399ed790b1803290cb363ba42bf7f7340
parent1d4b41f37c88faf092aee16655454a487ebc5a2c
qla2xxx: Delete session if initiator is gone from FW

Orabug: 2684419726923029

1. Initiator A is logged in with fc_id(1)/loop_id(1)
2. Initiator A re-logs in with fc_id(2)/loop_id(2)
3. Part of old session deletion async logoout for 1/1 is queued
4. Initiator B logs in with fc_id(1)/loop_id(1), starts
   passing data and creates session.
   5. Async logo from 3 is processed by DPC and sent to FW

   Now initiator B has the session but is logged out from FW.

   This condition is detected first with CTIO error 29 at which
   point we should delete current session. During session
   deletion we will send LOGO to initiator to force re-login.

   Under rare circumstances initiator might be logged out of FW,
   not have driver session, but still think it's logged in.
   E.g. the above sequence plus session deletion due to re-config.
   Incoming commands will fail to create local session because
   initiator is not found in FW. In this case we also issue LOGO
   to initiator to force him re-login.

   Finally this patch fixes exchange leak when commands where
   received in logged out state. In this case loop_id must be
   set to FFFF when corresponding exchange is terminated. The
   patch modifies exchange termination to always use FFFF,
   since in certain scenarios it's impossible to tell whether
   command was received in logged in or logged out state.

Signed-off-by: Alexei Potashnik <alexei@purestorage.com>
Acked-by: Quinn Tran <quinn.tran@qlogic.com>
Signed-off-by: Himanshu Madhani <himanshu.madhani@qlogic.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Signed-off-by: Brian Maly <brian.maly@oracle.com>
Reviewed-by: Jack Vogel <jack.vogel@oracle.com>
drivers/scsi/qla2xxx/qla_def.h
drivers/scsi/qla2xxx/qla_os.c
drivers/scsi/qla2xxx/qla_target.c
drivers/scsi/qla2xxx/qla_target.h