Skip to content

Commit a48ac9e

Browse files
Matthew WilcoxChristoph Hellwig
authored andcommitted
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>
1 parent ecc3bc9 commit a48ac9e

5 files changed

Lines changed: 18 additions & 26 deletions

File tree

‎drivers/message/fusion/mptfc.c‎

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -649,7 +649,7 @@ mptfc_slave_alloc(struct scsi_device *sdev)
649649
}
650650

651651
static int
652-
mptfc_qcmd_lck(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *))
652+
mptfc_qcmd(struct Scsi_Host *shost, struct scsi_cmnd *SCpnt)
653653
{
654654
struct mptfc_rport_info *ri;
655655
struct fc_rport *rport = starget_to_rport(scsi_target(SCpnt->device));
@@ -658,30 +658,28 @@ mptfc_qcmd_lck(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *))
658658

659659
if (!vdevice || !vdevice->vtarget) {
660660
SCpnt->result = DID_NO_CONNECT << 16;
661-
done(SCpnt);
661+
SCpnt->scsi_done(SCpnt);
662662
return 0;
663663
}
664664

665665
err = fc_remote_port_chkready(rport);
666666
if (unlikely(err)) {
667667
SCpnt->result = err;
668-
done(SCpnt);
668+
SCpnt->scsi_done(SCpnt);
669669
return 0;
670670
}
671671

672672
/* dd_data is null until finished adding target */
673673
ri = *((struct mptfc_rport_info **)rport->dd_data);
674674
if (unlikely(!ri)) {
675675
SCpnt->result = DID_IMM_RETRY << 16;
676-
done(SCpnt);
676+
SCpnt->scsi_done(SCpnt);
677677
return 0;
678678
}
679679

680-
return mptscsih_qcmd(SCpnt,done);
680+
return mptscsih_qcmd(SCpnt);
681681
}
682682

683-
static DEF_SCSI_QCMD(mptfc_qcmd)
684-
685683
/*
686684
* mptfc_display_port_link_speed - displaying link speed
687685
* @ioc: Pointer to MPT_ADAPTER structure

‎drivers/message/fusion/mptsas.c‎

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1896,19 +1896,19 @@ mptsas_slave_alloc(struct scsi_device *sdev)
18961896
}
18971897

18981898
static int
1899-
mptsas_qcmd_lck(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *))
1899+
mptsas_qcmd(struct Scsi_Host *shost, struct scsi_cmnd *SCpnt)
19001900
{
19011901
MPT_SCSI_HOST *hd;
19021902
MPT_ADAPTER *ioc;
19031903
VirtDevice *vdevice = SCpnt->device->hostdata;
19041904

19051905
if (!vdevice || !vdevice->vtarget || vdevice->vtarget->deleted) {
19061906
SCpnt->result = DID_NO_CONNECT << 16;
1907-
done(SCpnt);
1907+
SCpnt->scsi_done(SCpnt);
19081908
return 0;
19091909
}
19101910

1911-
hd = shost_priv(SCpnt->device->host);
1911+
hd = shost_priv(shost);
19121912
ioc = hd->ioc;
19131913

19141914
if (ioc->sas_discovery_quiesce_io)
@@ -1917,11 +1917,9 @@ mptsas_qcmd_lck(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *))
19171917
if (ioc->debug_level & MPT_DEBUG_SCSI)
19181918
scsi_print_command(SCpnt);
19191919

1920-
return mptscsih_qcmd(SCpnt,done);
1920+
return mptscsih_qcmd(SCpnt);
19211921
}
19221922

1923-
static DEF_SCSI_QCMD(mptsas_qcmd)
1924-
19251923
/**
19261924
* mptsas_mptsas_eh_timed_out - resets the scsi_cmnd timeout
19271925
* if the device under question is currently in the

‎drivers/message/fusion/mptscsih.c‎

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1304,7 +1304,6 @@ int mptscsih_show_info(struct seq_file *m, struct Scsi_Host *host)
13041304
/**
13051305
* mptscsih_qcmd - Primary Fusion MPT SCSI initiator IO start routine.
13061306
* @SCpnt: Pointer to scsi_cmnd structure
1307-
* @done: Pointer SCSI mid-layer IO completion function
13081307
*
13091308
* (linux scsi_host_template.queuecommand routine)
13101309
* 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)
13131312
* Returns 0. (rtn value discarded by linux scsi mid-layer)
13141313
*/
13151314
int
1316-
mptscsih_qcmd(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *))
1315+
mptscsih_qcmd(struct scsi_cmnd *SCpnt)
13171316
{
13181317
MPT_SCSI_HOST *hd;
13191318
MPT_FRAME_HDR *mf;
@@ -1329,10 +1328,9 @@ mptscsih_qcmd(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *))
13291328

13301329
hd = shost_priv(SCpnt->device->host);
13311330
ioc = hd->ioc;
1332-
SCpnt->scsi_done = done;
13331331

1334-
dmfprintk(ioc, printk(MYIOC_s_DEBUG_FMT "qcmd: SCpnt=%p, done()=%p\n",
1335-
ioc->name, SCpnt, done));
1332+
dmfprintk(ioc, printk(MYIOC_s_DEBUG_FMT "qcmd: SCpnt=%p\n",
1333+
ioc->name, SCpnt));
13361334

13371335
if (ioc->taskmgmt_quiesce_io)
13381336
return SCSI_MLQUEUE_HOST_BUSY;

‎drivers/message/fusion/mptscsih.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ extern int mptscsih_resume(struct pci_dev *pdev);
113113
#endif
114114
extern int mptscsih_show_info(struct seq_file *, struct Scsi_Host *);
115115
extern const char * mptscsih_info(struct Scsi_Host *SChost);
116-
extern int mptscsih_qcmd(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *));
116+
extern int mptscsih_qcmd(struct scsi_cmnd *SCpnt);
117117
extern int mptscsih_IssueTaskMgmt(MPT_SCSI_HOST *hd, u8 type, u8 channel,
118118
u8 id, int lun, int ctx2abort, ulong timeout);
119119
extern void mptscsih_slave_destroy(struct scsi_device *device);

‎drivers/message/fusion/mptspi.c‎

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -780,33 +780,31 @@ static int mptspi_slave_configure(struct scsi_device *sdev)
780780
}
781781

782782
static int
783-
mptspi_qcmd_lck(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *))
783+
mptspi_qcmd(struct Scsi_Host *shost, struct scsi_cmnd *SCpnt)
784784
{
785-
struct _MPT_SCSI_HOST *hd = shost_priv(SCpnt->device->host);
785+
struct _MPT_SCSI_HOST *hd = shost_priv(shost);
786786
VirtDevice *vdevice = SCpnt->device->hostdata;
787787
MPT_ADAPTER *ioc = hd->ioc;
788788

789789
if (!vdevice || !vdevice->vtarget) {
790790
SCpnt->result = DID_NO_CONNECT << 16;
791-
done(SCpnt);
791+
SCpnt->scsi_done(SCpnt);
792792
return 0;
793793
}
794794

795795
if (SCpnt->device->channel == 1 &&
796796
mptscsih_is_phys_disk(ioc, 0, SCpnt->device->id) == 0) {
797797
SCpnt->result = DID_NO_CONNECT << 16;
798-
done(SCpnt);
798+
SCpnt->scsi_done(SCpnt);
799799
return 0;
800800
}
801801

802802
if (spi_dv_pending(scsi_target(SCpnt->device)))
803803
ddvprintk(ioc, scsi_print_command(SCpnt));
804804

805-
return mptscsih_qcmd(SCpnt,done);
805+
return mptscsih_qcmd(SCpnt);
806806
}
807807

808-
static DEF_SCSI_QCMD(mptspi_qcmd)
809-
810808
static void mptspi_slave_destroy(struct scsi_device *sdev)
811809
{
812810
struct scsi_target *starget = scsi_target(sdev);

0 commit comments

Comments
 (0)