scsi: qedf: Add more defensive checks for concurrent error conditions
authorChad Dupuis <chad.dupuis@cavium.com>
Wed, 25 Apr 2018 13:09:03 +0000 (06:09 -0700)
committerMartin K. Petersen <martin.petersen@oracle.com>
Tue, 8 May 2018 04:57:11 +0000 (00:57 -0400)
commitf3690a89f918031a5eed17da78af51c329efe93a
treeea976faae5dcab27e73c177653f73c291d1509e6
parent4f4616ceebaf045c59e8a6aa01f08826d18d5c63
scsi: qedf: Add more defensive checks for concurrent error conditions

During an uplink toggle test all error handling is done via timeout and
firmware error conditions which can occur concurrently:

 - SCSI layer timeouts
 - Error detect CQEs
 - Firmware detected underruns
 - ABTS timeouts

All these concurrent events require more defensive checks in the driver
including:

 - Check both internally and externally generated aborts to make sure the
   xid is not already been aborted in another context or in cleanup.

 - Check back pointers in qedf_cmd_timeout to verify the context of the
   io_req, fcport and qedf_ctx

 - Check rport state in host reset handler to not reset the whole host
   if the rport is already uploaded or in the process of relogin

 - Check to state for an fcport before initiating a middle path ELS
   request

Signed-off-by: Chad Dupuis <chad.dupuis@cavium.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/qedf/qedf_els.c
drivers/scsi/qedf/qedf_io.c
drivers/scsi/qedf/qedf_main.c