fusion: Remove use of DEF_SCSI_QCMD

Removing the host_lock from the I/O submission path gives a huge
scalability improvement.

Signed-off-by: Matthew Wilcox <matthew.r.wilcox@intel.com>
Reviewed-by: Nicholas Bellinger <nab@linux-iscsi.org>
Reviewed-by: Praveen Krishnamoorthy <Praveen.krishnamoorthy@lsi.com>
Acked-by: Sreekanth Reddy <Sreekanth.reddy@lsi.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
This commit is contained in:
Matthew Wilcox 2014-03-27 16:40:36 -04:00 committed by Christoph Hellwig
parent ecc3bc9825
commit a48ac9e5d4
5 changed files with 18 additions and 26 deletions

View File

@ -649,7 +649,7 @@ mptfc_slave_alloc(struct scsi_device *sdev)
} }
static int static int
mptfc_qcmd_lck(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)) mptfc_qcmd(struct Scsi_Host *shost, struct scsi_cmnd *SCpnt)
{ {
struct mptfc_rport_info *ri; struct mptfc_rport_info *ri;
struct fc_rport *rport = starget_to_rport(scsi_target(SCpnt->device)); struct fc_rport *rport = starget_to_rport(scsi_target(SCpnt->device));
@ -658,14 +658,14 @@ mptfc_qcmd_lck(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *))
if (!vdevice || !vdevice->vtarget) { if (!vdevice || !vdevice->vtarget) {
SCpnt->result = DID_NO_CONNECT << 16; SCpnt->result = DID_NO_CONNECT << 16;
done(SCpnt); SCpnt->scsi_done(SCpnt);
return 0; return 0;
} }
err = fc_remote_port_chkready(rport); err = fc_remote_port_chkready(rport);
if (unlikely(err)) { if (unlikely(err)) {
SCpnt->result = err; SCpnt->result = err;
done(SCpnt); SCpnt->scsi_done(SCpnt);
return 0; return 0;
} }
@ -673,15 +673,13 @@ mptfc_qcmd_lck(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *))
ri = *((struct mptfc_rport_info **)rport->dd_data); ri = *((struct mptfc_rport_info **)rport->dd_data);
if (unlikely(!ri)) { if (unlikely(!ri)) {
SCpnt->result = DID_IMM_RETRY << 16; SCpnt->result = DID_IMM_RETRY << 16;
done(SCpnt); SCpnt->scsi_done(SCpnt);
return 0; return 0;
} }
return mptscsih_qcmd(SCpnt,done); return mptscsih_qcmd(SCpnt);
} }
static DEF_SCSI_QCMD(mptfc_qcmd)
/* /*
* mptfc_display_port_link_speed - displaying link speed * mptfc_display_port_link_speed - displaying link speed
* @ioc: Pointer to MPT_ADAPTER structure * @ioc: Pointer to MPT_ADAPTER structure

View File

@ -1896,7 +1896,7 @@ mptsas_slave_alloc(struct scsi_device *sdev)
} }
static int static int
mptsas_qcmd_lck(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)) mptsas_qcmd(struct Scsi_Host *shost, struct scsi_cmnd *SCpnt)
{ {
MPT_SCSI_HOST *hd; MPT_SCSI_HOST *hd;
MPT_ADAPTER *ioc; MPT_ADAPTER *ioc;
@ -1904,11 +1904,11 @@ mptsas_qcmd_lck(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *))
if (!vdevice || !vdevice->vtarget || vdevice->vtarget->deleted) { if (!vdevice || !vdevice->vtarget || vdevice->vtarget->deleted) {
SCpnt->result = DID_NO_CONNECT << 16; SCpnt->result = DID_NO_CONNECT << 16;
done(SCpnt); SCpnt->scsi_done(SCpnt);
return 0; return 0;
} }
hd = shost_priv(SCpnt->device->host); hd = shost_priv(shost);
ioc = hd->ioc; ioc = hd->ioc;
if (ioc->sas_discovery_quiesce_io) if (ioc->sas_discovery_quiesce_io)
@ -1917,11 +1917,9 @@ mptsas_qcmd_lck(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *))
if (ioc->debug_level & MPT_DEBUG_SCSI) if (ioc->debug_level & MPT_DEBUG_SCSI)
scsi_print_command(SCpnt); scsi_print_command(SCpnt);
return mptscsih_qcmd(SCpnt,done); return mptscsih_qcmd(SCpnt);
} }
static DEF_SCSI_QCMD(mptsas_qcmd)
/** /**
* mptsas_mptsas_eh_timed_out - resets the scsi_cmnd timeout * mptsas_mptsas_eh_timed_out - resets the scsi_cmnd timeout
* if the device under question is currently in the * if the device under question is currently in the

View File

@ -1304,7 +1304,6 @@ int mptscsih_show_info(struct seq_file *m, struct Scsi_Host *host)
/** /**
* mptscsih_qcmd - Primary Fusion MPT SCSI initiator IO start routine. * mptscsih_qcmd - Primary Fusion MPT SCSI initiator IO start routine.
* @SCpnt: Pointer to scsi_cmnd structure * @SCpnt: Pointer to scsi_cmnd structure
* @done: Pointer SCSI mid-layer IO completion function
* *
* (linux scsi_host_template.queuecommand routine) * (linux scsi_host_template.queuecommand routine)
* This is the primary SCSI IO start routine. Create a MPI SCSIIORequest * This is the primary SCSI IO start routine. Create a MPI SCSIIORequest
@ -1313,7 +1312,7 @@ int mptscsih_show_info(struct seq_file *m, struct Scsi_Host *host)
* Returns 0. (rtn value discarded by linux scsi mid-layer) * Returns 0. (rtn value discarded by linux scsi mid-layer)
*/ */
int int
mptscsih_qcmd(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)) mptscsih_qcmd(struct scsi_cmnd *SCpnt)
{ {
MPT_SCSI_HOST *hd; MPT_SCSI_HOST *hd;
MPT_FRAME_HDR *mf; MPT_FRAME_HDR *mf;
@ -1329,10 +1328,9 @@ mptscsih_qcmd(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *))
hd = shost_priv(SCpnt->device->host); hd = shost_priv(SCpnt->device->host);
ioc = hd->ioc; ioc = hd->ioc;
SCpnt->scsi_done = done;
dmfprintk(ioc, printk(MYIOC_s_DEBUG_FMT "qcmd: SCpnt=%p, done()=%p\n", dmfprintk(ioc, printk(MYIOC_s_DEBUG_FMT "qcmd: SCpnt=%p\n",
ioc->name, SCpnt, done)); ioc->name, SCpnt));
if (ioc->taskmgmt_quiesce_io) if (ioc->taskmgmt_quiesce_io)
return SCSI_MLQUEUE_HOST_BUSY; return SCSI_MLQUEUE_HOST_BUSY;

View File

@ -113,7 +113,7 @@ extern int mptscsih_resume(struct pci_dev *pdev);
#endif #endif
extern int mptscsih_show_info(struct seq_file *, struct Scsi_Host *); extern int mptscsih_show_info(struct seq_file *, struct Scsi_Host *);
extern const char * mptscsih_info(struct Scsi_Host *SChost); extern const char * mptscsih_info(struct Scsi_Host *SChost);
extern int mptscsih_qcmd(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)); extern int mptscsih_qcmd(struct scsi_cmnd *SCpnt);
extern int mptscsih_IssueTaskMgmt(MPT_SCSI_HOST *hd, u8 type, u8 channel, extern int mptscsih_IssueTaskMgmt(MPT_SCSI_HOST *hd, u8 type, u8 channel,
u8 id, int lun, int ctx2abort, ulong timeout); u8 id, int lun, int ctx2abort, ulong timeout);
extern void mptscsih_slave_destroy(struct scsi_device *device); extern void mptscsih_slave_destroy(struct scsi_device *device);

View File

@ -780,33 +780,31 @@ static int mptspi_slave_configure(struct scsi_device *sdev)
} }
static int static int
mptspi_qcmd_lck(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)) mptspi_qcmd(struct Scsi_Host *shost, struct scsi_cmnd *SCpnt)
{ {
struct _MPT_SCSI_HOST *hd = shost_priv(SCpnt->device->host); struct _MPT_SCSI_HOST *hd = shost_priv(shost);
VirtDevice *vdevice = SCpnt->device->hostdata; VirtDevice *vdevice = SCpnt->device->hostdata;
MPT_ADAPTER *ioc = hd->ioc; MPT_ADAPTER *ioc = hd->ioc;
if (!vdevice || !vdevice->vtarget) { if (!vdevice || !vdevice->vtarget) {
SCpnt->result = DID_NO_CONNECT << 16; SCpnt->result = DID_NO_CONNECT << 16;
done(SCpnt); SCpnt->scsi_done(SCpnt);
return 0; return 0;
} }
if (SCpnt->device->channel == 1 && if (SCpnt->device->channel == 1 &&
mptscsih_is_phys_disk(ioc, 0, SCpnt->device->id) == 0) { mptscsih_is_phys_disk(ioc, 0, SCpnt->device->id) == 0) {
SCpnt->result = DID_NO_CONNECT << 16; SCpnt->result = DID_NO_CONNECT << 16;
done(SCpnt); SCpnt->scsi_done(SCpnt);
return 0; return 0;
} }
if (spi_dv_pending(scsi_target(SCpnt->device))) if (spi_dv_pending(scsi_target(SCpnt->device)))
ddvprintk(ioc, scsi_print_command(SCpnt)); ddvprintk(ioc, scsi_print_command(SCpnt));
return mptscsih_qcmd(SCpnt,done); return mptscsih_qcmd(SCpnt);
} }
static DEF_SCSI_QCMD(mptspi_qcmd)
static void mptspi_slave_destroy(struct scsi_device *sdev) static void mptspi_slave_destroy(struct scsi_device *sdev)
{ {
struct scsi_target *starget = scsi_target(sdev); struct scsi_target *starget = scsi_target(sdev);