Skip to content

Commit f664a3c

Browse files
committed
scsi: kill off the legacy IO path
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]>
1 parent 3a7ea2c commit f664a3c

File tree

17 files changed

+77
-680
lines changed

17 files changed

+77
-680
lines changed

Documentation/scsi/scsi-parameters.txt

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -97,11 +97,6 @@ parameters may be changed at runtime by the command
9797
allowing boot to proceed. none ignores them, expecting
9898
user space to do the scan.
9999

100-
scsi_mod.use_blk_mq=
101-
[SCSI] use blk-mq I/O path by default
102-
See SCSI_MQ_DEFAULT in drivers/scsi/Kconfig.
103-
Format: <y/n>
104-
105100
sim710= [SCSI,HW]
106101
See header of drivers/scsi/sim710.c.
107102

drivers/scsi/Kconfig

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -50,18 +50,6 @@ config SCSI_NETLINK
5050
default n
5151
depends on NET
5252

53-
config SCSI_MQ_DEFAULT
54-
bool "SCSI: use blk-mq I/O path by default"
55-
default y
56-
depends on SCSI
57-
---help---
58-
This option enables the blk-mq based I/O path for SCSI devices by
59-
default. With this option the scsi_mod.use_blk_mq module/boot
60-
option defaults to Y, without it to N, but it can still be
61-
overridden either way.
62-
63-
If unsure say Y.
64-
6553
config SCSI_PROC_FS
6654
bool "legacy /proc/scsi/ support"
6755
depends on SCSI && PROC_FS

drivers/scsi/cxlflash/main.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3088,12 +3088,6 @@ static ssize_t hwq_mode_store(struct device *dev,
30883088
return -EINVAL;
30893089
}
30903090

3091-
if ((mode == HWQ_MODE_TAG) && !shost_use_blk_mq(shost)) {
3092-
dev_info(cfgdev, "SCSI-MQ is not enabled, use a different "
3093-
"HWQ steering mode.\n");
3094-
return -EINVAL;
3095-
}
3096-
30973091
afu->hwq_mode = mode;
30983092

30993093
return count;

drivers/scsi/hosts.c

Lines changed: 6 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -222,18 +222,9 @@ int scsi_add_host_with_dma(struct Scsi_Host *shost, struct device *dev,
222222
if (error)
223223
goto fail;
224224

225-
if (shost_use_blk_mq(shost)) {
226-
error = scsi_mq_setup_tags(shost);
227-
if (error)
228-
goto fail;
229-
} else {
230-
shost->bqt = blk_init_tags(shost->can_queue,
231-
shost->hostt->tag_alloc_policy);
232-
if (!shost->bqt) {
233-
error = -ENOMEM;
234-
goto fail;
235-
}
236-
}
225+
error = scsi_mq_setup_tags(shost);
226+
if (error)
227+
goto fail;
237228

238229
if (!shost->shost_gendev.parent)
239230
shost->shost_gendev.parent = dev ? dev : &platform_bus;
@@ -309,8 +300,7 @@ int scsi_add_host_with_dma(struct Scsi_Host *shost, struct device *dev,
309300
pm_runtime_disable(&shost->shost_gendev);
310301
pm_runtime_set_suspended(&shost->shost_gendev);
311302
pm_runtime_put_noidle(&shost->shost_gendev);
312-
if (shost_use_blk_mq(shost))
313-
scsi_mq_destroy_tags(shost);
303+
scsi_mq_destroy_tags(shost);
314304
fail:
315305
return error;
316306
}
@@ -344,13 +334,8 @@ static void scsi_host_dev_release(struct device *dev)
344334
kfree(dev_name(&shost->shost_dev));
345335
}
346336

347-
if (shost_use_blk_mq(shost)) {
348-
if (shost->tag_set.tags)
349-
scsi_mq_destroy_tags(shost);
350-
} else {
351-
if (shost->bqt)
352-
blk_free_tags(shost->bqt);
353-
}
337+
if (shost->tag_set.tags)
338+
scsi_mq_destroy_tags(shost);
354339

355340
kfree(shost->shost_data);
356341

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

475-
shost->use_blk_mq = scsi_use_blk_mq || shost->hostt->force_blk_mq;
476-
477460
device_initialize(&shost->shost_gendev);
478461
dev_set_name(&shost->shost_gendev, "host%d", shost->host_no);
479462
shost->shost_gendev.bus = &scsi_bus_type;

drivers/scsi/lpfc/lpfc_scsi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3914,7 +3914,7 @@ int lpfc_sli4_scmd_to_wqidx_distr(struct lpfc_hba *phba,
39143914
uint32_t tag;
39153915
uint16_t hwq;
39163916

3917-
if (cmnd && shost_use_blk_mq(cmnd->device->host)) {
3917+
if (cmnd) {
39183918
tag = blk_mq_unique_tag(cmnd->request);
39193919
hwq = blk_mq_unique_tag_to_hwq(tag);
39203920

drivers/scsi/qedi/qedi_main.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -644,8 +644,7 @@ static struct qedi_ctx *qedi_host_alloc(struct pci_dev *pdev)
644644
qedi->max_active_conns = ISCSI_MAX_SESS_PER_HBA;
645645
qedi->max_sqes = QEDI_SQ_SIZE;
646646

647-
if (shost_use_blk_mq(shost))
648-
shost->nr_hw_queues = MIN_NUM_CPUS_MSIX(qedi);
647+
shost->nr_hw_queues = MIN_NUM_CPUS_MSIX(qedi);
649648

650649
pci_set_drvdata(pdev, qedi);
651650

drivers/scsi/qla2xxx/qla_os.c

Lines changed: 9 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -857,13 +857,9 @@ qla2xxx_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *cmd)
857857
}
858858

859859
if (ha->mqenable) {
860-
if (shost_use_blk_mq(vha->host)) {
861-
tag = blk_mq_unique_tag(cmd->request);
862-
hwq = blk_mq_unique_tag_to_hwq(tag);
863-
qpair = ha->queue_pair_map[hwq];
864-
} else if (vha->vp_idx && vha->qpair) {
865-
qpair = vha->qpair;
866-
}
860+
tag = blk_mq_unique_tag(cmd->request);
861+
hwq = blk_mq_unique_tag_to_hwq(tag);
862+
qpair = ha->queue_pair_map[hwq];
867863

868864
if (qpair)
869865
return qla2xxx_mqueuecommand(host, cmd, qpair);
@@ -3153,7 +3149,7 @@ qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)
31533149
goto probe_failed;
31543150
}
31553151

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

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

32673263
if (ha->mqenable) {
3268-
bool mq = false;
32693264
bool startit = false;
32703265

3271-
if (QLA_TGT_MODE_ENABLED()) {
3272-
mq = true;
3266+
if (QLA_TGT_MODE_ENABLED())
32733267
startit = false;
3274-
}
32753268

3276-
if ((ql2x_ini_mode == QLA2XXX_INI_MODE_ENABLED) &&
3277-
shost_use_blk_mq(host)) {
3278-
mq = true;
3269+
if (ql2x_ini_mode == QLA2XXX_INI_MODE_ENABLED)
32793270
startit = true;
3280-
}
32813271

3282-
if (mq) {
3283-
/* Create start of day qpairs for Block MQ */
3284-
for (i = 0; i < ha->max_qpairs; i++)
3285-
qla2xxx_create_qpair(base_vha, 5, 0, startit);
3286-
}
3272+
/* Create start of day qpairs for Block MQ */
3273+
for (i = 0; i < ha->max_qpairs; i++)
3274+
qla2xxx_create_qpair(base_vha, 5, 0, startit);
32873275
}
32883276

32893277
if (ha->flags.running_gold_fw)

drivers/scsi/scsi.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -780,11 +780,8 @@ MODULE_LICENSE("GPL");
780780
module_param(scsi_logging_level, int, S_IRUGO|S_IWUSR);
781781
MODULE_PARM_DESC(scsi_logging_level, "a bit mask of logging levels");
782782

783-
#ifdef CONFIG_SCSI_MQ_DEFAULT
783+
/* This should go away in the future, it doesn't do anything anymore */
784784
bool scsi_use_blk_mq = true;
785-
#else
786-
bool scsi_use_blk_mq = false;
787-
#endif
788785
module_param_named(use_blk_mq, scsi_use_blk_mq, bool, S_IWUSR | S_IRUGO);
789786

790787
static int __init init_scsi(void)

drivers/scsi/scsi_debug.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5881,8 +5881,7 @@ static int sdebug_driver_probe(struct device *dev)
58815881
}
58825882
/* Decide whether to tell scsi subsystem that we want mq */
58835883
/* Following should give the same answer for each host */
5884-
if (shost_use_blk_mq(hpnt))
5885-
hpnt->nr_hw_queues = submit_queues;
5884+
hpnt->nr_hw_queues = submit_queues;
58865885

58875886
sdbg_host->shost = hpnt;
58885887
*((struct sdebug_host_info **)hpnt->hostdata) = sdbg_host;

drivers/scsi/scsi_error.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ enum blk_eh_timer_return scsi_times_out(struct request *req)
308308
* error handler. In that case we can return immediately as no
309309
* further action is required.
310310
*/
311-
if (req->q->mq_ops && !blk_mq_mark_complete(req))
311+
if (!blk_mq_mark_complete(req))
312312
return rtn;
313313
if (scsi_abort_command(scmd) != SUCCESS) {
314314
set_host_byte(scmd, DID_TIME_OUT);

0 commit comments

Comments
 (0)