Linux SCSI subsystem development
 help / color / mirror / Atom feed
* [PATCH 1/3] ipr: Add new CCIN for new adapters support
@ 2016-07-12 21:02 wenxiong
  2016-07-12 21:02 ` [PATCH 2/3] ipr: Increase MSIX vectors number wenxiong
                   ` (4 more replies)
  0 siblings, 5 replies; 10+ messages in thread
From: wenxiong @ 2016-07-12 21:02 UTC (permalink / raw)
  To: linux-scsi; +Cc: JBottomley, martin.petersen, brking, krisman, Wen Xiong

From: Wen Xiong <wenxiong@linux.vnet.ibm.com>

Add the appropriate definitions and table entries for new
adapters support.

Signed-off-by: Wen Xiong <wenxiong@linux.vnet.ibm.com>
---
 drivers/scsi/ipr.c |    7 ++++++-
 drivers/scsi/ipr.h |    3 +++
 2 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/drivers/scsi/ipr.c b/drivers/scsi/ipr.c
index d6803a9..01dc065 100644
--- a/drivers/scsi/ipr.c
+++ b/drivers/scsi/ipr.c
@@ -194,7 +194,8 @@ static const struct ipr_chip_t ipr_chip[] = {
 	{ PCI_VENDOR_ID_IBM, PCI_DEVICE_ID_IBM_SNIPE, IPR_USE_LSI, IPR_SIS32, IPR_PCI_CFG, &ipr_chip_cfg[1] },
 	{ PCI_VENDOR_ID_ADAPTEC2, PCI_DEVICE_ID_ADAPTEC2_SCAMP, IPR_USE_LSI, IPR_SIS32, IPR_PCI_CFG, &ipr_chip_cfg[1] },
 	{ PCI_VENDOR_ID_IBM, PCI_DEVICE_ID_IBM_CROC_FPGA_E2, IPR_USE_MSI, IPR_SIS64, IPR_MMIO, &ipr_chip_cfg[2] },
-	{ PCI_VENDOR_ID_IBM, PCI_DEVICE_ID_IBM_CROCODILE, IPR_USE_MSI, IPR_SIS64, IPR_MMIO, &ipr_chip_cfg[2] }
+	{ PCI_VENDOR_ID_IBM, PCI_DEVICE_ID_IBM_CROCODILE, IPR_USE_MSI, IPR_SIS64, IPR_MMIO, &ipr_chip_cfg[2] },
+	{ PCI_VENDOR_ID_IBM, PCI_DEVICE_ID_IBM_RATTLESNAKE, IPR_USE_MSI, IPR_SIS64, IPR_MMIO, &ipr_chip_cfg[2] }
 };
 
 static int ipr_max_bus_speeds[] = {
@@ -10565,6 +10566,10 @@ static struct pci_device_id ipr_pci_table[] = {
 		PCI_VENDOR_ID_IBM, IPR_SUBS_DEV_ID_2CD2, 0, 0, 0 },
 	{ PCI_VENDOR_ID_IBM, PCI_DEVICE_ID_IBM_CROCODILE,
 		PCI_VENDOR_ID_IBM, IPR_SUBS_DEV_ID_2CCD, 0, 0, 0 },
+	{ PCI_VENDOR_ID_IBM, PCI_DEVICE_ID_IBM_RATTLESNAKE,
+		PCI_VENDOR_ID_IBM, IPR_SUBS_DEV_ID_580A, 0, 0, 0 },
+	{ PCI_VENDOR_ID_IBM, PCI_DEVICE_ID_IBM_RATTLESNAKE,
+		PCI_VENDOR_ID_IBM, IPR_SUBS_DEV_ID_580B, 0, 0, 0 },
 	{ }
 };
 MODULE_DEVICE_TABLE(pci, ipr_pci_table);
diff --git a/drivers/scsi/ipr.h b/drivers/scsi/ipr.h
index 56c5706..1d42c74 100644
--- a/drivers/scsi/ipr.h
+++ b/drivers/scsi/ipr.h
@@ -60,6 +60,7 @@
 
 #define PCI_DEVICE_ID_IBM_CROC_FPGA_E2          0x033D
 #define PCI_DEVICE_ID_IBM_CROCODILE             0x034A
+#define PCI_DEVICE_ID_IBM_RATTLESNAKE		0x04DA
 
 #define IPR_SUBS_DEV_ID_2780	0x0264
 #define IPR_SUBS_DEV_ID_5702	0x0266
@@ -111,6 +112,8 @@
 #define IPR_SUBS_DEV_ID_2CCA	0x04C7
 #define IPR_SUBS_DEV_ID_2CD2	0x04C8
 #define IPR_SUBS_DEV_ID_2CCD	0x04C9
+#define IPR_SUBS_DEV_ID_580A	0x04FC
+#define IPR_SUBS_DEV_ID_580B	0x04FB
 #define IPR_NAME				"ipr"
 
 /*
-- 
1.7.1


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 2/3] ipr: Increase MSIX vectors number
  2016-07-12 21:02 [PATCH 1/3] ipr: Add new CCIN for new adapters support wenxiong
@ 2016-07-12 21:02 ` wenxiong
  2016-07-12 21:44   ` Gabriel Krisman Bertazi
  2016-07-12 22:00   ` Brian King
  2016-07-12 21:02 ` [PATCH 3/3] ipr: Add scsi multi-queue support wenxiong
                   ` (3 subsequent siblings)
  4 siblings, 2 replies; 10+ messages in thread
From: wenxiong @ 2016-07-12 21:02 UTC (permalink / raw)
  To: linux-scsi; +Cc: JBottomley, martin.petersen, brking, krisman, Wen Xiong

From: Wen Xiong <wenxiong@linux.vnet.ibm.com>

Increase MSIX vectors from 2 to 16 by default.

Signed-off-by: Wen Xiong <wenxiong@linux.vnet.ibm.com>
---
 drivers/scsi/ipr.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/ipr.c b/drivers/scsi/ipr.c
index 01dc065..1f539c2 100644
--- a/drivers/scsi/ipr.c
+++ b/drivers/scsi/ipr.c
@@ -98,7 +98,7 @@ static unsigned int ipr_transop_timeout = 0;
 static unsigned int ipr_debug = 0;
 static unsigned int ipr_max_devs = IPR_DEFAULT_SIS64_DEVS;
 static unsigned int ipr_dual_ioa_raid = 1;
-static unsigned int ipr_number_of_msix = 2;
+static unsigned int ipr_number_of_msix = 16;
 static unsigned int ipr_fast_reboot;
 static DEFINE_SPINLOCK(ipr_driver_lock);
 
@@ -222,7 +222,7 @@ module_param_named(max_devs, ipr_max_devs, int, 0);
 MODULE_PARM_DESC(max_devs, "Specify the maximum number of physical devices. "
 		 "[Default=" __stringify(IPR_DEFAULT_SIS64_DEVS) "]");
 module_param_named(number_of_msix, ipr_number_of_msix, int, 0);
-MODULE_PARM_DESC(number_of_msix, "Specify the number of MSIX interrupts to use on capable adapters (1 - 16).  (default:2)");
+MODULE_PARM_DESC(number_of_msix, "Specify the number of MSIX interrupts to use on capable adapters (1 - 16).  (default:16)");
 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_LICENSE("GPL");
-- 
1.7.1


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 3/3] ipr: Add scsi multi-queue support
  2016-07-12 21:02 [PATCH 1/3] ipr: Add new CCIN for new adapters support wenxiong
  2016-07-12 21:02 ` [PATCH 2/3] ipr: Increase MSIX vectors number wenxiong
@ 2016-07-12 21:02 ` wenxiong
  2016-07-12 21:59   ` Brian King
  2016-07-13  0:55   ` Christoph Hellwig
  2016-07-12 21:43 ` [PATCH 1/3] ipr: Add new CCIN for new adapters support Gabriel Krisman Bertazi
                   ` (2 subsequent siblings)
  4 siblings, 2 replies; 10+ messages in thread
From: wenxiong @ 2016-07-12 21:02 UTC (permalink / raw)
  To: linux-scsi; +Cc: JBottomley, martin.petersen, brking, krisman, Wen Xiong

From: Wen Xiong <wenxiong@linux.vnet.ibm.com>

Add scsi multi-queue support in ipr driver. This feature
is enabled by setting ipr_use_blk_mq=1 when loading ipr
module and scsi blk-mq is enabled in the kernel.

Signed-off-by: Wen Xiong <wenxiong@linux.vnet.ibm.com>
---
 drivers/scsi/ipr.c |   16 ++++++++++++++--
 drivers/scsi/ipr.h |    1 +
 2 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/ipr.c b/drivers/scsi/ipr.c
index 1f539c2..21b6da6 100644
--- a/drivers/scsi/ipr.c
+++ b/drivers/scsi/ipr.c
@@ -100,6 +100,7 @@ static unsigned int ipr_max_devs = IPR_DEFAULT_SIS64_DEVS;
 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_use_blk_mq = 0;
 static DEFINE_SPINLOCK(ipr_driver_lock);
 
 /* This table describes the differences between DMA controller chips */
@@ -225,6 +226,8 @@ module_param_named(number_of_msix, ipr_number_of_msix, int, 0);
 MODULE_PARM_DESC(number_of_msix, "Specify the number of MSIX interrupts to use on capable adapters (1 - 16).  (default:16)");
 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(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);
 
@@ -6316,6 +6319,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;
 
@@ -6329,7 +6333,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);
@@ -10144,6 +10153,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;
 
@@ -10377,7 +10388,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);
@@ -10406,6 +10417,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++) {
diff --git a/drivers/scsi/ipr.h b/drivers/scsi/ipr.h
index 1d42c74..f79c96b 100644
--- a/drivers/scsi/ipr.h
+++ b/drivers/scsi/ipr.h
@@ -1597,6 +1597,7 @@ struct ipr_ioa_cfg {
 	} vectors_info[IPR_MAX_MSIX_VECTORS];
 
 	u32 iopoll_weight;
+	u32 use_blk_mq;
 
 }; /* struct ipr_ioa_cfg */
 
-- 
1.7.1


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH 1/3] ipr: Add new CCIN for new adapters support
  2016-07-12 21:02 [PATCH 1/3] ipr: Add new CCIN for new adapters support wenxiong
  2016-07-12 21:02 ` [PATCH 2/3] ipr: Increase MSIX vectors number wenxiong
  2016-07-12 21:02 ` [PATCH 3/3] ipr: Add scsi multi-queue support wenxiong
@ 2016-07-12 21:43 ` Gabriel Krisman Bertazi
  2016-07-12 22:00 ` Brian King
  2016-07-14  2:43 ` Martin K. Petersen
  4 siblings, 0 replies; 10+ messages in thread
From: Gabriel Krisman Bertazi @ 2016-07-12 21:43 UTC (permalink / raw)
  To: wenxiong; +Cc: linux-scsi, JBottomley, martin.petersen, brking

wenxiong@linux.vnet.ibm.com writes:

> From: Wen Xiong <wenxiong@linux.vnet.ibm.com>
>
> Add the appropriate definitions and table entries for new
> adapters support.
>
> Signed-off-by: Wen Xiong <wenxiong@linux.vnet.ibm.com>

Reviewed-by: Gabriel Krisman Bertazi <krisman@linux.vnet.ibm.com>


-- 
Gabriel Krisman Bertazi


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 2/3] ipr: Increase MSIX vectors number
  2016-07-12 21:02 ` [PATCH 2/3] ipr: Increase MSIX vectors number wenxiong
@ 2016-07-12 21:44   ` Gabriel Krisman Bertazi
  2016-07-12 22:00   ` Brian King
  1 sibling, 0 replies; 10+ messages in thread
From: Gabriel Krisman Bertazi @ 2016-07-12 21:44 UTC (permalink / raw)
  To: wenxiong; +Cc: linux-scsi, JBottomley, martin.petersen, brking

wenxiong@linux.vnet.ibm.com writes:

> From: Wen Xiong <wenxiong@linux.vnet.ibm.com>
>
> Increase MSIX vectors from 2 to 16 by default.
>
> Signed-off-by: Wen Xiong <wenxiong@linux.vnet.ibm.com>
> ---

Reviewed-by: Gabriel Krisman Bertazi <krisman@linux.vnet.ibm.com>

Thanks,

-- 
Gabriel Krisman Bertazi


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 3/3] ipr: Add scsi multi-queue support
  2016-07-12 21:02 ` [PATCH 3/3] ipr: Add scsi multi-queue support wenxiong
@ 2016-07-12 21:59   ` Brian King
  2016-07-13  0:55   ` Christoph Hellwig
  1 sibling, 0 replies; 10+ messages in thread
From: Brian King @ 2016-07-12 21:59 UTC (permalink / raw)
  To: wenxiong, linux-scsi; +Cc: JBottomley, martin.petersen, krisman

On 07/12/2016 04:02 PM, wenxiong@linux.vnet.ibm.com wrote:
> From: Wen Xiong <wenxiong@linux.vnet.ibm.com>
> 
> Add scsi multi-queue support in ipr driver. This feature
> is enabled by setting ipr_use_blk_mq=1 when loading ipr
> module and scsi blk-mq is enabled in the kernel.
> 
> Signed-off-by: Wen Xiong <wenxiong@linux.vnet.ibm.com>
> ---
>  drivers/scsi/ipr.c |   16 ++++++++++++++--
>  drivers/scsi/ipr.h |    1 +
>  2 files changed, 15 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/scsi/ipr.c b/drivers/scsi/ipr.c
> index 1f539c2..21b6da6 100644
> --- a/drivers/scsi/ipr.c
> +++ b/drivers/scsi/ipr.c
> @@ -100,6 +100,7 @@ static unsigned int ipr_max_devs = IPR_DEFAULT_SIS64_DEVS;
>  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_use_blk_mq = 0;

No need to initialize a static to 0. Can you be sure to run scripts/checkpatch.pl
in future? 


> @@ -6329,7 +6333,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);
> @@ -10144,6 +10153,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;

Prior to this patch we reserved HRRQ 0 for error interrupts. This changes that
to use it also for normal I/O interrupts. One side effect of this is that we
can now no longer use iopoll for HRRQ 0. It would be nice to not change this
behavior and keep using HRRQ 0 for errors only, since we have an MMIO read
in that path we wanted to avoid in the normal I/O path.

I think if we just change the line above to:

host->nr_hw_queues = ioa_cfg->hrrq_num - 1;

Then this should resolve this. Can you verify this doesn't break anything?

Thanks,

Brian

-- 
Brian King
Power Linux I/O
IBM Linux Technology Center


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 1/3] ipr: Add new CCIN for new adapters support
  2016-07-12 21:02 [PATCH 1/3] ipr: Add new CCIN for new adapters support wenxiong
                   ` (2 preceding siblings ...)
  2016-07-12 21:43 ` [PATCH 1/3] ipr: Add new CCIN for new adapters support Gabriel Krisman Bertazi
@ 2016-07-12 22:00 ` Brian King
  2016-07-14  2:43 ` Martin K. Petersen
  4 siblings, 0 replies; 10+ messages in thread
From: Brian King @ 2016-07-12 22:00 UTC (permalink / raw)
  To: wenxiong, linux-scsi; +Cc: JBottomley, martin.petersen, krisman

Acked-by: Brian King <brking@linux.vnet.ibm.com>


-- 
Brian King
Power Linux I/O
IBM Linux Technology Center


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 2/3] ipr: Increase MSIX vectors number
  2016-07-12 21:02 ` [PATCH 2/3] ipr: Increase MSIX vectors number wenxiong
  2016-07-12 21:44   ` Gabriel Krisman Bertazi
@ 2016-07-12 22:00   ` Brian King
  1 sibling, 0 replies; 10+ messages in thread
From: Brian King @ 2016-07-12 22:00 UTC (permalink / raw)
  To: wenxiong, linux-scsi; +Cc: JBottomley, martin.petersen, krisman

Acked-by: Brian King <brking@linux.vnet.ibm.com>

-- 
Brian King
Power Linux I/O
IBM Linux Technology Center


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 3/3] ipr: Add scsi multi-queue support
  2016-07-12 21:02 ` [PATCH 3/3] ipr: Add scsi multi-queue support wenxiong
  2016-07-12 21:59   ` Brian King
@ 2016-07-13  0:55   ` Christoph Hellwig
  1 sibling, 0 replies; 10+ messages in thread
From: Christoph Hellwig @ 2016-07-13  0:55 UTC (permalink / raw)
  To: wenxiong; +Cc: linux-scsi, JBottomley, martin.petersen, brking, krisman

On Tue, Jul 12, 2016 at 04:02:09PM -0500, wenxiong@linux.vnet.ibm.com wrote:
> From: Wen Xiong <wenxiong@linux.vnet.ibm.com>
> 
> Add scsi multi-queue support in ipr driver. This feature
> is enabled by setting ipr_use_blk_mq=1 when loading ipr
> module and scsi blk-mq is enabled in the kernel.

This is not a useful option, as using of blk-mq is not up to the
driver.  If you want to control the number of queues used please
add a nr_queues option instead.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 1/3] ipr: Add new CCIN for new adapters support
  2016-07-12 21:02 [PATCH 1/3] ipr: Add new CCIN for new adapters support wenxiong
                   ` (3 preceding siblings ...)
  2016-07-12 22:00 ` Brian King
@ 2016-07-14  2:43 ` Martin K. Petersen
  4 siblings, 0 replies; 10+ messages in thread
From: Martin K. Petersen @ 2016-07-14  2:43 UTC (permalink / raw)
  To: wenxiong; +Cc: linux-scsi, JBottomley, martin.petersen, brking, krisman

>>>>> "wenxiong" == wenxiong  <wenxiong@linux.vnet.ibm.com> writes:

wenxiong> Add the appropriate definitions and table entries for new
wenxiong> adapters support.

Applied patch 1+2 to 4.8/scsi-queue.

-- 
Martin K. Petersen	Oracle Linux Engineering

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2016-07-14  2:44 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-07-12 21:02 [PATCH 1/3] ipr: Add new CCIN for new adapters support wenxiong
2016-07-12 21:02 ` [PATCH 2/3] ipr: Increase MSIX vectors number wenxiong
2016-07-12 21:44   ` Gabriel Krisman Bertazi
2016-07-12 22:00   ` Brian King
2016-07-12 21:02 ` [PATCH 3/3] ipr: Add scsi multi-queue support wenxiong
2016-07-12 21:59   ` Brian King
2016-07-13  0:55   ` Christoph Hellwig
2016-07-12 21:43 ` [PATCH 1/3] ipr: Add new CCIN for new adapters support Gabriel Krisman Bertazi
2016-07-12 22:00 ` Brian King
2016-07-14  2:43 ` Martin K. Petersen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox