Skip to content

Commit

Permalink
scsi: kill off the legacy IO path
Browse files Browse the repository at this point in the history
This removes the legacy (non-mq) IO path for SCSI.

Cc: [email protected]
Acked-by: Himanshu Madhani <[email protected]>
Reviewed-by: Hannes Reinecke <[email protected]>
Tested-by: Ming Lei <[email protected]>
Reviewed-by: Omar Sandoval <[email protected]>
Acked-by: Martin K. Petersen <[email protected]>
Signed-off-by: Jens Axboe <[email protected]>
  • Loading branch information
axboe committed Nov 7, 2018
1 parent 3a7ea2c commit f664a3c
Show file tree
Hide file tree
Showing 17 changed files with 77 additions and 680 deletions.
5 changes: 0 additions & 5 deletions Documentation/scsi/scsi-parameters.txt
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,6 @@ parameters may be changed at runtime by the command
allowing boot to proceed. none ignores them, expecting
user space to do the scan.

scsi_mod.use_blk_mq=
[SCSI] use blk-mq I/O path by default
See SCSI_MQ_DEFAULT in drivers/scsi/Kconfig.
Format: <y/n>

sim710= [SCSI,HW]
See header of drivers/scsi/sim710.c.

Expand Down
12 changes: 0 additions & 12 deletions drivers/scsi/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -50,18 +50,6 @@ config SCSI_NETLINK
default n
depends on NET

config SCSI_MQ_DEFAULT
bool "SCSI: use blk-mq I/O path by default"
default y
depends on SCSI
---help---
This option enables the blk-mq based I/O path for SCSI devices by
default. With this option the scsi_mod.use_blk_mq module/boot
option defaults to Y, without it to N, but it can still be
overridden either way.

If unsure say Y.

config SCSI_PROC_FS
bool "legacy /proc/scsi/ support"
depends on SCSI && PROC_FS
Expand Down
6 changes: 0 additions & 6 deletions drivers/scsi/cxlflash/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -3088,12 +3088,6 @@ static ssize_t hwq_mode_store(struct device *dev,
return -EINVAL;
}

if ((mode == HWQ_MODE_TAG) && !shost_use_blk_mq(shost)) {
dev_info(cfgdev, "SCSI-MQ is not enabled, use a different "
"HWQ steering mode.\n");
return -EINVAL;
}

afu->hwq_mode = mode;

return count;
Expand Down
29 changes: 6 additions & 23 deletions drivers/scsi/hosts.c
Original file line number Diff line number Diff line change
Expand Up @@ -222,18 +222,9 @@ int scsi_add_host_with_dma(struct Scsi_Host *shost, struct device *dev,
if (error)
goto fail;

if (shost_use_blk_mq(shost)) {
error = scsi_mq_setup_tags(shost);
if (error)
goto fail;
} else {
shost->bqt = blk_init_tags(shost->can_queue,
shost->hostt->tag_alloc_policy);
if (!shost->bqt) {
error = -ENOMEM;
goto fail;
}
}
error = scsi_mq_setup_tags(shost);
if (error)
goto fail;

if (!shost->shost_gendev.parent)
shost->shost_gendev.parent = dev ? dev : &platform_bus;
Expand Down Expand Up @@ -309,8 +300,7 @@ int scsi_add_host_with_dma(struct Scsi_Host *shost, struct device *dev,
pm_runtime_disable(&shost->shost_gendev);
pm_runtime_set_suspended(&shost->shost_gendev);
pm_runtime_put_noidle(&shost->shost_gendev);
if (shost_use_blk_mq(shost))
scsi_mq_destroy_tags(shost);
scsi_mq_destroy_tags(shost);
fail:
return error;
}
Expand Down Expand Up @@ -344,13 +334,8 @@ static void scsi_host_dev_release(struct device *dev)
kfree(dev_name(&shost->shost_dev));
}

if (shost_use_blk_mq(shost)) {
if (shost->tag_set.tags)
scsi_mq_destroy_tags(shost);
} else {
if (shost->bqt)
blk_free_tags(shost->bqt);
}
if (shost->tag_set.tags)
scsi_mq_destroy_tags(shost);

kfree(shost->shost_data);

Expand Down Expand Up @@ -472,8 +457,6 @@ struct Scsi_Host *scsi_host_alloc(struct scsi_host_template *sht, int privsize)
else
shost->dma_boundary = 0xffffffff;

shost->use_blk_mq = scsi_use_blk_mq || shost->hostt->force_blk_mq;

device_initialize(&shost->shost_gendev);
dev_set_name(&shost->shost_gendev, "host%d", shost->host_no);
shost->shost_gendev.bus = &scsi_bus_type;
Expand Down
2 changes: 1 addition & 1 deletion drivers/scsi/lpfc/lpfc_scsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -3914,7 +3914,7 @@ int lpfc_sli4_scmd_to_wqidx_distr(struct lpfc_hba *phba,
uint32_t tag;
uint16_t hwq;

if (cmnd && shost_use_blk_mq(cmnd->device->host)) {
if (cmnd) {
tag = blk_mq_unique_tag(cmnd->request);
hwq = blk_mq_unique_tag_to_hwq(tag);

Expand Down
3 changes: 1 addition & 2 deletions drivers/scsi/qedi/qedi_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -644,8 +644,7 @@ static struct qedi_ctx *qedi_host_alloc(struct pci_dev *pdev)
qedi->max_active_conns = ISCSI_MAX_SESS_PER_HBA;
qedi->max_sqes = QEDI_SQ_SIZE;

if (shost_use_blk_mq(shost))
shost->nr_hw_queues = MIN_NUM_CPUS_MSIX(qedi);
shost->nr_hw_queues = MIN_NUM_CPUS_MSIX(qedi);

pci_set_drvdata(pdev, qedi);

Expand Down
30 changes: 9 additions & 21 deletions drivers/scsi/qla2xxx/qla_os.c
Original file line number Diff line number Diff line change
Expand Up @@ -857,13 +857,9 @@ qla2xxx_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *cmd)
}

if (ha->mqenable) {
if (shost_use_blk_mq(vha->host)) {
tag = blk_mq_unique_tag(cmd->request);
hwq = blk_mq_unique_tag_to_hwq(tag);
qpair = ha->queue_pair_map[hwq];
} else if (vha->vp_idx && vha->qpair) {
qpair = vha->qpair;
}
tag = blk_mq_unique_tag(cmd->request);
hwq = blk_mq_unique_tag_to_hwq(tag);
qpair = ha->queue_pair_map[hwq];

if (qpair)
return qla2xxx_mqueuecommand(host, cmd, qpair);
Expand Down Expand Up @@ -3153,7 +3149,7 @@ qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)
goto probe_failed;
}

if (ha->mqenable && shost_use_blk_mq(host)) {
if (ha->mqenable) {
/* number of hardware queues supported by blk/scsi-mq*/
host->nr_hw_queues = ha->max_qpairs;

Expand Down Expand Up @@ -3265,25 +3261,17 @@ qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)
base_vha->mgmt_svr_loop_id, host->sg_tablesize);

if (ha->mqenable) {
bool mq = false;
bool startit = false;

if (QLA_TGT_MODE_ENABLED()) {
mq = true;
if (QLA_TGT_MODE_ENABLED())
startit = false;
}

if ((ql2x_ini_mode == QLA2XXX_INI_MODE_ENABLED) &&
shost_use_blk_mq(host)) {
mq = true;
if (ql2x_ini_mode == QLA2XXX_INI_MODE_ENABLED)
startit = true;
}

if (mq) {
/* Create start of day qpairs for Block MQ */
for (i = 0; i < ha->max_qpairs; i++)
qla2xxx_create_qpair(base_vha, 5, 0, startit);
}
/* Create start of day qpairs for Block MQ */
for (i = 0; i < ha->max_qpairs; i++)
qla2xxx_create_qpair(base_vha, 5, 0, startit);
}

if (ha->flags.running_gold_fw)
Expand Down
5 changes: 1 addition & 4 deletions drivers/scsi/scsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -780,11 +780,8 @@ MODULE_LICENSE("GPL");
module_param(scsi_logging_level, int, S_IRUGO|S_IWUSR);
MODULE_PARM_DESC(scsi_logging_level, "a bit mask of logging levels");

#ifdef CONFIG_SCSI_MQ_DEFAULT
/* This should go away in the future, it doesn't do anything anymore */
bool scsi_use_blk_mq = true;
#else
bool scsi_use_blk_mq = false;
#endif
module_param_named(use_blk_mq, scsi_use_blk_mq, bool, S_IWUSR | S_IRUGO);

static int __init init_scsi(void)
Expand Down
3 changes: 1 addition & 2 deletions drivers/scsi/scsi_debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -5881,8 +5881,7 @@ static int sdebug_driver_probe(struct device *dev)
}
/* Decide whether to tell scsi subsystem that we want mq */
/* Following should give the same answer for each host */
if (shost_use_blk_mq(hpnt))
hpnt->nr_hw_queues = submit_queues;
hpnt->nr_hw_queues = submit_queues;

sdbg_host->shost = hpnt;
*((struct sdebug_host_info **)hpnt->hostdata) = sdbg_host;
Expand Down
2 changes: 1 addition & 1 deletion drivers/scsi/scsi_error.c
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ enum blk_eh_timer_return scsi_times_out(struct request *req)
* error handler. In that case we can return immediately as no
* further action is required.
*/
if (req->q->mq_ops && !blk_mq_mark_complete(req))
if (!blk_mq_mark_complete(req))
return rtn;
if (scsi_abort_command(scmd) != SUCCESS) {
set_host_byte(scmd, DID_TIME_OUT);
Expand Down
Loading

0 comments on commit f664a3c

Please sign in to comment.