From: Wen Xiong <[email protected]>
---
drivers/scsi/ipr.c | 18 +++++++++++++++---
1 files changed, 15 insertions(+), 3 deletions(-)
diff --git a/drivers/scsi/ipr.c b/drivers/scsi/ipr.c
index 494c0fc..f2df57a 100644
--- a/drivers/scsi/ipr.c
+++ b/drivers/scsi/ipr.c
@@ -101,6 +101,7 @@ static unsigned int ipr_dual_ioa_raid = 1;
static unsigned int ipr_number_of_msix = 16;
static unsigned int ipr_fast_reboot;
static unsigned int ipr_cpu_map;
+static unsigned int ipr_use_blk_mq;
static unsigned int *ipr_used_cpu;
static unsigned int ipr_possible_cpu_cnt;
@@ -230,7 +231,9 @@ MODULE_PARM_DESC(number_of_msix, "Specify the number of
MSIX interrupts to use o
module_param_named(fast_reboot, ipr_fast_reboot, int, S_IRUGO | S_IWUSR);
MODULE_PARM_DESC(fast_reboot, "Skip adapter shutdown during reboot. Set to 1
to enable. (default: 0)");
module_param_named(cpu_map, ipr_cpu_map, int, 0);
-MODULE_PARM_DESC(cpu_map, "Enable CPU affinity per adapter. (default:0)");
+MODULE_PARM_DESC(cpu_map, "Enable CPU affinity per adapter. (default: 0)");
+module_param_named(use_blk_mq, ipr_use_blk_mq, uint, S_IRUGO);
+MODULE_PARM_DESC(use_blk_mq, "ipr use block mq enable/disable. (default: 0)");
MODULE_LICENSE("GPL");
MODULE_VERSION(IPR_DRIVER_VERSION);
@@ -6403,6 +6406,7 @@ static int ipr_queuecommand(struct Scsi_Host *shost,
int rc;
struct ipr_hrr_queue *hrrq;
int hrrq_id;
+ uint32_t tag;
ioa_cfg = (struct ipr_ioa_cfg *)shost->hostdata;
@@ -6416,7 +6420,12 @@ static int ipr_queuecommand(struct Scsi_Host *shost,
return rc;
}
- hrrq_id = ipr_get_hrrq_index(ioa_cfg);
+ if (ioa_cfg->use_blk_mq && shost_use_blk_mq(scsi_cmd->device->host)) {
+ tag = blk_mq_unique_tag(scsi_cmd->request);
+ hrrq_id = blk_mq_unique_tag_to_hwq(tag);
+ } else
+ hrrq_id = ipr_get_hrrq_index(ioa_cfg);
+
hrrq = &ioa_cfg->hrrq[hrrq_id];
spin_lock_irqsave(hrrq->lock, hrrq_flags);
@@ -10349,6 +10358,8 @@ static int ipr_probe_ioa(struct pci_dev *pdev,
(unsigned int)num_online_cpus(),
(unsigned int)IPR_MAX_HRRQ_NUM);
+ host->nr_hw_queues = ioa_cfg->hrrq_num;
+
if ((rc = ipr_save_pcix_cmd_reg(ioa_cfg)))
goto out_msi_disable;
@@ -10585,7 +10596,7 @@ static int ipr_probe(struct pci_dev *pdev, const struct
pci_device_id *dev_id)
return rc;
}
- rc = scsi_add_host(ioa_cfg->host, &pdev->dev);
+ rc = scsi_add_host_with_dma(ioa_cfg->host, &pdev->dev, &pdev->dev);
if (rc) {
__ipr_remove(pdev);
@@ -10614,6 +10625,7 @@ static int ipr_probe(struct pci_dev *pdev, const struct
pci_device_id *dev_id)
scsi_scan_host(ioa_cfg->host);
ioa_cfg->iopoll_weight = ioa_cfg->chip_cfg->iopoll_weight;
+ ioa_cfg->use_blk_mq = ipr_use_blk_mq;
if (ioa_cfg->iopoll_weight && ioa_cfg->sis64 && ioa_cfg->nvectors > 1) {
for (i = 1; i < ioa_cfg->hrrq_num; i++) {
--
1.7.1
------------------------------------------------------------------------------
_______________________________________________
Iprdd-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/iprdd-devel