scsi: mpt3sas: Fix for Crusader to achieve product targets with SAS devices.
Small glitch/degraded performance in Crusader is improved with SAS drives by removing unnecessary spinlocks while clearing scsi command in drivers internal lookup table. Signed-off-by: Chaitra P B <chaitra.basappa@broadcom.com> Signed-off-by: Suganath Prabu S <suganath-prabu.subramani@broadcom.com> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
This commit is contained in:

committed by
Martin K. Petersen

parent
6c44c0fe91
commit
459325c466
@@ -1073,6 +1073,26 @@ _scsih_scsi_lookup_get(struct MPT3SAS_ADAPTER *ioc, u16 smid)
|
||||
return ioc->scsi_lookup[smid - 1].scmd;
|
||||
}
|
||||
|
||||
/**
|
||||
* __scsih_scsi_lookup_get_clear - returns scmd entry without
|
||||
* holding any lock.
|
||||
* @ioc: per adapter object
|
||||
* @smid: system request message index
|
||||
*
|
||||
* Returns the smid stored scmd pointer.
|
||||
* Then will dereference the stored scmd pointer.
|
||||
*/
|
||||
static inline struct scsi_cmnd *
|
||||
__scsih_scsi_lookup_get_clear(struct MPT3SAS_ADAPTER *ioc,
|
||||
u16 smid)
|
||||
{
|
||||
struct scsi_cmnd *scmd = NULL;
|
||||
|
||||
swap(scmd, ioc->scsi_lookup[smid - 1].scmd);
|
||||
|
||||
return scmd;
|
||||
}
|
||||
|
||||
/**
|
||||
* _scsih_scsi_lookup_get_clear - returns scmd entry
|
||||
* @ioc: per adapter object
|
||||
@@ -1088,8 +1108,7 @@ _scsih_scsi_lookup_get_clear(struct MPT3SAS_ADAPTER *ioc, u16 smid)
|
||||
struct scsi_cmnd *scmd;
|
||||
|
||||
spin_lock_irqsave(&ioc->scsi_lookup_lock, flags);
|
||||
scmd = ioc->scsi_lookup[smid - 1].scmd;
|
||||
ioc->scsi_lookup[smid - 1].scmd = NULL;
|
||||
scmd = __scsih_scsi_lookup_get_clear(ioc, smid);
|
||||
spin_unlock_irqrestore(&ioc->scsi_lookup_lock, flags);
|
||||
|
||||
return scmd;
|
||||
@@ -4646,7 +4665,13 @@ _scsih_io_done(struct MPT3SAS_ADAPTER *ioc, u16 smid, u8 msix_index, u32 reply)
|
||||
unsigned long flags;
|
||||
|
||||
mpi_reply = mpt3sas_base_get_reply_virt_addr(ioc, reply);
|
||||
scmd = _scsih_scsi_lookup_get_clear(ioc, smid);
|
||||
|
||||
if (ioc->broadcast_aen_busy || ioc->pci_error_recovery ||
|
||||
ioc->got_task_abort_from_ioctl)
|
||||
scmd = _scsih_scsi_lookup_get_clear(ioc, smid);
|
||||
else
|
||||
scmd = __scsih_scsi_lookup_get_clear(ioc, smid);
|
||||
|
||||
if (scmd == NULL)
|
||||
return 1;
|
||||
|
||||
|
Reference in New Issue
Block a user