All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] pm8001: raise host can queue
@ 2011-09-22  2:05 Jack Wang
  2011-09-22  4:25 ` Dan Williams
  2012-04-25 17:02 ` [PATCH] pm8001: raise host can queue (take 2) Mark Salyzyn
  0 siblings, 2 replies; 5+ messages in thread
From: Jack Wang @ 2011-09-22  2:05 UTC (permalink / raw)
  To: linux-scsi, JBottomley
  Cc: 'lindar_liu', crystal_yu, john_gong, mark_salyzyn

[-- Attachment #1: Type: text/plain, Size: 1012 bytes --]

Hi James,

Because Dan change device queue depth to 256, and as point by Mark this may
result in starvation, so I bump the host can queue value to 510.

Best regards!

Jack

>From 3647cde88d66760ca336ad127a5b1fdf5c1d28f7 Mon Sep 17 00:00:00 2001
From: Jack Wang <jack_wang@usish.com>
Date: Thu, 22 Sep 2011 09:50:54 +0800
Subject: [PATCH] bump host can queue to follow libsas queue depth change

Signed-off-by: Jack Wang <jack_wang@usish.com>
---
 pm8001_defs.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/pm8001_defs.h b/pm8001_defs.h
index 944afad..704b492 100644
--- a/pm8001_defs.h
+++ b/pm8001_defs.h
@@ -68,7 +68,7 @@ enum port_type {
 #define	PM8001_MAX_CCB		 512	/* max ccbs supported */
 #define	PM8001_MAX_INB_NUM	 1
 #define	PM8001_MAX_OUTB_NUM	 1
-#define	PM8001_CAN_QUEUE	 128	/* SCSI Queue depth */
+#define	PM8001_CAN_QUEUE	 510	/* SCSI Queue depth */
 
 /* unchangeable hardware details */
 #define	PM8001_MAX_PHYS		 8	/* max. possible phys */
-- 
1.7.4.msysgit.0



[-- Attachment #2: 0001-bump-host-can-queue-to-follow-libsas-queue-depth-cha.patch --]
[-- Type: application/octet-stream, Size: 863 bytes --]

>From 3647cde88d66760ca336ad127a5b1fdf5c1d28f7 Mon Sep 17 00:00:00 2001
From: Jack Wang <jack_wang@usish.com>
Date: Thu, 22 Sep 2011 09:50:54 +0800
Subject: [PATCH] bump host can queue to follow libsas queue depth change

Signed-off-by: Jack Wang <jack_wang@usish.com>
---
 pm8001_defs.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/pm8001_defs.h b/pm8001_defs.h
index 944afad..704b492 100644
--- a/pm8001_defs.h
+++ b/pm8001_defs.h
@@ -68,7 +68,7 @@ enum port_type {
 #define	PM8001_MAX_CCB		 512	/* max ccbs supported */
 #define	PM8001_MAX_INB_NUM	 1
 #define	PM8001_MAX_OUTB_NUM	 1
-#define	PM8001_CAN_QUEUE	 128	/* SCSI Queue depth */
+#define	PM8001_CAN_QUEUE	 510	/* SCSI Queue depth */
 
 /* unchangeable hardware details */
 #define	PM8001_MAX_PHYS		 8	/* max. possible phys */
-- 
1.7.4.msysgit.0


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

* Re: [PATCH] pm8001: raise host can queue
  2011-09-22  2:05 [PATCH] pm8001: raise host can queue Jack Wang
@ 2011-09-22  4:25 ` Dan Williams
  2011-09-22  4:34   ` Jack Wang
  2012-04-25 17:02 ` [PATCH] pm8001: raise host can queue (take 2) Mark Salyzyn
  1 sibling, 1 reply; 5+ messages in thread
From: Dan Williams @ 2011-09-22  4:25 UTC (permalink / raw)
  To: Jack Wang
  Cc: linux-scsi, JBottomley, lindar_liu, crystal_yu, john_gong,
	mark_salyzyn, Christoph Hellwig

On Wed, Sep 21, 2011 at 7:05 PM, Jack Wang <jack_wang@usish.com> wrote:
> Hi James,
>
> Because Dan change device queue depth to 256, and as point by Mark this may
> result in starvation, so I bump the host can queue value to 510.

Hi,

Is this a theoretical or actual concern?  Because the mid-layer should
be handling starvation if I understand the mechanics of the
shost->starved_list.

--
Dan

> Best regards!
>
> Jack
>
> From 3647cde88d66760ca336ad127a5b1fdf5c1d28f7 Mon Sep 17 00:00:00 2001
> From: Jack Wang <jack_wang@usish.com>
> Date: Thu, 22 Sep 2011 09:50:54 +0800
> Subject: [PATCH] bump host can queue to follow libsas queue depth change
>
> Signed-off-by: Jack Wang <jack_wang@usish.com>
> ---
>  pm8001_defs.h |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/pm8001_defs.h b/pm8001_defs.h
> index 944afad..704b492 100644
> --- a/pm8001_defs.h
> +++ b/pm8001_defs.h
> @@ -68,7 +68,7 @@ enum port_type {
>  #define        PM8001_MAX_CCB           512    /* max ccbs supported */
>  #define        PM8001_MAX_INB_NUM       1
>  #define        PM8001_MAX_OUTB_NUM      1
> -#define        PM8001_CAN_QUEUE         128    /* SCSI Queue depth */
> +#define        PM8001_CAN_QUEUE         510    /* SCSI Queue depth */


>
>  /* unchangeable hardware details */
>  #define        PM8001_MAX_PHYS          8      /* max. possible phys */
> --
> 1.7.4.msysgit.0
>
>
>
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH] pm8001: raise host can queue
  2011-09-22  4:25 ` Dan Williams
@ 2011-09-22  4:34   ` Jack Wang
  0 siblings, 0 replies; 5+ messages in thread
From: Jack Wang @ 2011-09-22  4:34 UTC (permalink / raw)
  To: 'Dan Williams'
  Cc: linux-scsi, JBottomley, 'lindar_liu',
	crystal_yu, john_gong, mark_salyzyn, 'Christoph Hellwig'

Hi Dan

Not a real concern, the hardware is not limit to process 128 commands.

Jack
Re: [PATCH] pm8001: raise host can queue
> 
> On Wed, Sep 21, 2011 at 7:05 PM, Jack Wang <jack_wang@usish.com> wrote:
> > Hi James,
> >
> > Because Dan change device queue depth to 256, and as point by Mark this
may
> > result in starvation, so I bump the host can queue value to 510.
> 
> Hi,
> 
> Is this a theoretical or actual concern?  Because the mid-layer should
> be handling starvation if I understand the mechanics of the
> shost->starved_list.
> 
> --
> Dan
> 
> > Best regards!
> >
> > Jack
> >
> > From 3647cde88d66760ca336ad127a5b1fdf5c1d28f7 Mon Sep 17 00:00:00 2001
> > From: Jack Wang <jack_wang@usish.com>
> > Date: Thu, 22 Sep 2011 09:50:54 +0800
> > Subject: [PATCH] bump host can queue to follow libsas queue depth change
> >
> > Signed-off-by: Jack Wang <jack_wang@usish.com>
> > ---
> >  pm8001_defs.h |    2 +-
> >  1 files changed, 1 insertions(+), 1 deletions(-)
> >
> > diff --git a/pm8001_defs.h b/pm8001_defs.h
> > index 944afad..704b492 100644
> > --- a/pm8001_defs.h
> > +++ b/pm8001_defs.h
> > @@ -68,7 +68,7 @@ enum port_type {
> >  #define        PM8001_MAX_CCB           512    /* max ccbs supported
> */
> >  #define        PM8001_MAX_INB_NUM       1
> >  #define        PM8001_MAX_OUTB_NUM      1
> > -#define        PM8001_CAN_QUEUE         128    /* SCSI Queue depth */
> > +#define        PM8001_CAN_QUEUE         510    /* SCSI Queue depth */
> 
> 
> >
> >  /* unchangeable hardware details */
> >  #define        PM8001_MAX_PHYS          8      /* max. possible phys
> */
> > --
> > 1.7.4.msysgit.0
> >
> >
> >

--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH] pm8001: raise host can queue (take 2)
  2011-09-22  2:05 [PATCH] pm8001: raise host can queue Jack Wang
  2011-09-22  4:25 ` Dan Williams
@ 2012-04-25 17:02 ` Mark Salyzyn
  2012-04-27  8:14   ` Jack Wang
  1 sibling, 1 reply; 5+ messages in thread
From: Mark Salyzyn @ 2012-04-25 17:02 UTC (permalink / raw)
  To: linux-scsi
  Cc: Mark Salyzyn, James Bottomley, lindar_liu,
	于爱华,
	john_gong, Jack Wang

[-- Attachment #1: Type: text/plain, Size: 6008 bytes --]

This is a followup to a patch provided by Jack Wang on September 21 2011.

After increasing the CAN_QUEUE to 510 in pm8001 we discovered some performance
degredation from time to time. We needed to increase the MPI queue to
compensate and ensure we never hit that limit. We also needed to double
the margin to support event and administrivial commands that take from
the pool resulting in an occasional largely unproductive command completion
with soft error to the caller when the command pool is overloaded temporarily.

Signed-off-by: Mark Salyzyn <mark_salyzyn@xyratex.com>

 drivers/scsi/pm8001/pm8001_defs.h |    3 ++-
 drivers/scsi/pm8001/pm8001_hwi.c  |   17 ++++++++++-------
 drivers/scsi/pm8001/pm8001_init.c |   10 +++++-----
 3 files changed, 17 insertions(+), 13 deletions(-)

diff --git a/drivers/scsi/pm8001/pm8001_defs.h b/drivers/scsi/pm8001/pm8001_defs.h
index 944afad..c3d20c8 100644
--- a/drivers/scsi/pm8001/pm8001_defs.h
+++ b/drivers/scsi/pm8001/pm8001_defs.h
@@ -66,9 +66,10 @@ enum port_type {
 
 /* driver compile-time configuration */
 #define	PM8001_MAX_CCB		 512	/* max ccbs supported */
+#define PM8001_MPI_QUEUE         1024   /* maximum mpi queue entries */
 #define	PM8001_MAX_INB_NUM	 1
 #define	PM8001_MAX_OUTB_NUM	 1
-#define	PM8001_CAN_QUEUE	 128	/* SCSI Queue depth */
+#define	PM8001_CAN_QUEUE	 508	/* SCSI Queue depth */
 
 /* unchangeable hardware details */
 #define	PM8001_MAX_PHYS		 8	/* max. possible phys */
diff --git a/drivers/scsi/pm8001/pm8001_hwi.c b/drivers/scsi/pm8001/pm8001_hwi.c
index 8477df4..0d6c8b9 100644
--- a/drivers/scsi/pm8001/pm8001_hwi.c
+++ b/drivers/scsi/pm8001/pm8001_hwi.c
@@ -192,7 +192,7 @@ init_default_table_values(struct pm8001_hba_info *pm8001_ha)
 	pm8001_ha->main_cfg_tbl.fatal_err_interrupt		= 0x01;
 	for (i = 0; i < qn; i++) {
 		pm8001_ha->inbnd_q_tbl[i].element_pri_size_cnt	=
-			0x00000100 | (0x00000040 << 16) | (0x00<<30);
+			PM8001_MPI_QUEUE | (64 << 16) | (0x00<<30);
 		pm8001_ha->inbnd_q_tbl[i].upper_base_addr	=
 			pm8001_ha->memoryMap.region[IB].phys_addr_hi;
 		pm8001_ha->inbnd_q_tbl[i].lower_base_addr	=
@@ -218,7 +218,7 @@ init_default_table_values(struct pm8001_hba_info *pm8001_ha)
 	}
 	for (i = 0; i < qn; i++) {
 		pm8001_ha->outbnd_q_tbl[i].element_size_cnt	=
-			256 | (64 << 16) | (1<<30);
+			PM8001_MPI_QUEUE | (64 << 16) | (0x01<<30);
 		pm8001_ha->outbnd_q_tbl[i].upper_base_addr	=
 			pm8001_ha->memoryMap.region[OB].phys_addr_hi;
 		pm8001_ha->outbnd_q_tbl[i].lower_base_addr	=
@@ -1245,7 +1245,7 @@ static int mpi_msg_free_get(struct inbound_queue_table *circularQ,
 	/* Stores the new consumer index */
 	consumer_index = pm8001_read_32(circularQ->ci_virt);
 	circularQ->consumer_index = cpu_to_le32(consumer_index);
-	if (((circularQ->producer_idx + bcCount) % 256) ==
+	if (((circularQ->producer_idx + bcCount) % PM8001_MPI_QUEUE) ==
 		le32_to_cpu(circularQ->consumer_index)) {
 		*messagePtr = NULL;
 		return -1;
@@ -1253,7 +1253,8 @@ static int mpi_msg_free_get(struct inbound_queue_table *circularQ,
 	/* get memory IOMB buffer address */
 	offset = circularQ->producer_idx * 64;
 	/* increment to next bcCount element */
-	circularQ->producer_idx = (circularQ->producer_idx + bcCount) % 256;
+	circularQ->producer_idx = (circularQ->producer_idx + bcCount)
+				% PM8001_MPI_QUEUE;
 	/* Adds that distance to the base of the region virtual address plus
 	the message header size*/
 	msgHeader = (struct mpi_msg_hdr *)(circularQ->base_virt	+ offset);
@@ -1326,7 +1327,8 @@ static u32 mpi_msg_free_set(struct pm8001_hba_info *pm8001_ha, void *pMsg,
 		return 0;
 	}
 	/* free the circular queue buffer elements associated with the message*/
-	circularQ->consumer_idx = (circularQ->consumer_idx + bc) % 256;
+	circularQ->consumer_idx = (circularQ->consumer_idx + bc)
+				% PM8001_MPI_QUEUE;
 	/* update the CI of outbound queue */
 	pm8001_cw32(pm8001_ha, circularQ->ci_pci_bar, circularQ->ci_offset,
 		circularQ->consumer_idx);
@@ -1383,7 +1385,8 @@ static u32 mpi_msg_consume(struct pm8001_hba_info *pm8001_ha,
 					circularQ->consumer_idx =
 						(circularQ->consumer_idx +
 						((le32_to_cpu(msgHeader_tmp)
-						>> 24) & 0x1f)) % 256;
+						 >> 24) & 0x1f))
+							% PM8001_MPI_QUEUE;
 					msgHeader_tmp = 0;
 					pm8001_write_32(msgHeader, 0, 0);
 					/* update the CI of outbound queue */
@@ -1396,7 +1399,7 @@ static u32 mpi_msg_consume(struct pm8001_hba_info *pm8001_ha,
 				circularQ->consumer_idx =
 					(circularQ->consumer_idx +
 					((le32_to_cpu(msgHeader_tmp) >> 24) &
-					0x1f)) % 256;
+					0x1f)) % PM8001_MPI_QUEUE;
 				msgHeader_tmp = 0;
 				pm8001_write_32(msgHeader, 0, 0);
 				/* update the CI of outbound queue */
diff --git a/drivers/scsi/pm8001/pm8001_init.c b/drivers/scsi/pm8001/pm8001_init.c
index 36efaa7..0267c22 100644
--- a/drivers/scsi/pm8001/pm8001_init.c
+++ b/drivers/scsi/pm8001/pm8001_init.c
@@ -235,15 +235,15 @@ static int __devinit pm8001_alloc(struct pm8001_hba_info *pm8001_ha)
 	pm8001_ha->memoryMap.region[PI].alignment = 4;
 
 	/* MPI Memory region 5 inbound queues */
-	pm8001_ha->memoryMap.region[IB].num_elements = 256;
+	pm8001_ha->memoryMap.region[IB].num_elements = PM8001_MPI_QUEUE;
 	pm8001_ha->memoryMap.region[IB].element_size = 64;
-	pm8001_ha->memoryMap.region[IB].total_len = 256 * 64;
+	pm8001_ha->memoryMap.region[IB].total_len = PM8001_MPI_QUEUE * 64;
 	pm8001_ha->memoryMap.region[IB].alignment = 64;
 
-	/* MPI Memory region 6 inbound queues */
-	pm8001_ha->memoryMap.region[OB].num_elements = 256;
+	/* MPI Memory region 6 outbound queues */
+	pm8001_ha->memoryMap.region[OB].num_elements = PM8001_MPI_QUEUE;
 	pm8001_ha->memoryMap.region[OB].element_size = 64;
-	pm8001_ha->memoryMap.region[OB].total_len = 256 * 64;
+	pm8001_ha->memoryMap.region[OB].total_len = PM8001_MPI_QUEUE * 64;
 	pm8001_ha->memoryMap.region[OB].alignment = 64;
 
 	/* Memory region write DMA*/



[-- Attachment #2: mpi-queue-2.patch --]
[-- Type: application/octet-stream, Size: 5857 bytes --]

Subject: [PATCH] pm8001: rais host can queue (take 2)

After increasing the CAN_QUEUE to 510 in pm8001 we discovered some performance
degredation from time to time. We needed to increase the MPI queue to
compensate and ensure we never hit that limit. We also needed to double
the margin to support event and administrivial commands that take from
the pool resulting in an occasional largely unproductive command completion
with soft error to the caller when the command pool is overloaded temporarily.

Signed-off-by: Mark Salyzyn <mark_salyzyn@xyratex.com>

 drivers/scsi/pm8001/pm8001_defs.h |    3 ++-
 drivers/scsi/pm8001/pm8001_hwi.c  |   17 ++++++++++-------
 drivers/scsi/pm8001/pm8001_init.c |   10 +++++-----
 3 files changed, 17 insertions(+), 13 deletions(-)

diff --git a/drivers/scsi/pm8001/pm8001_defs.h b/drivers/scsi/pm8001/pm8001_defs.h
index 944afad..c3d20c8 100644
--- a/drivers/scsi/pm8001/pm8001_defs.h
+++ b/drivers/scsi/pm8001/pm8001_defs.h
@@ -66,9 +66,10 @@ enum port_type {
 
 /* driver compile-time configuration */
 #define	PM8001_MAX_CCB		 512	/* max ccbs supported */
+#define PM8001_MPI_QUEUE         1024   /* maximum mpi queue entries */
 #define	PM8001_MAX_INB_NUM	 1
 #define	PM8001_MAX_OUTB_NUM	 1
-#define	PM8001_CAN_QUEUE	 128	/* SCSI Queue depth */
+#define	PM8001_CAN_QUEUE	 508	/* SCSI Queue depth */
 
 /* unchangeable hardware details */
 #define	PM8001_MAX_PHYS		 8	/* max. possible phys */
diff --git a/drivers/scsi/pm8001/pm8001_hwi.c b/drivers/scsi/pm8001/pm8001_hwi.c
index 8477df4..0d6c8b9 100644
--- a/drivers/scsi/pm8001/pm8001_hwi.c
+++ b/drivers/scsi/pm8001/pm8001_hwi.c
@@ -192,7 +192,7 @@ init_default_table_values(struct pm8001_hba_info *pm8001_ha)
 	pm8001_ha->main_cfg_tbl.fatal_err_interrupt		= 0x01;
 	for (i = 0; i < qn; i++) {
 		pm8001_ha->inbnd_q_tbl[i].element_pri_size_cnt	=
-			0x00000100 | (0x00000040 << 16) | (0x00<<30);
+			PM8001_MPI_QUEUE | (64 << 16) | (0x00<<30);
 		pm8001_ha->inbnd_q_tbl[i].upper_base_addr	=
 			pm8001_ha->memoryMap.region[IB].phys_addr_hi;
 		pm8001_ha->inbnd_q_tbl[i].lower_base_addr	=
@@ -218,7 +218,7 @@ init_default_table_values(struct pm8001_hba_info *pm8001_ha)
 	}
 	for (i = 0; i < qn; i++) {
 		pm8001_ha->outbnd_q_tbl[i].element_size_cnt	=
-			256 | (64 << 16) | (1<<30);
+			PM8001_MPI_QUEUE | (64 << 16) | (0x01<<30);
 		pm8001_ha->outbnd_q_tbl[i].upper_base_addr	=
 			pm8001_ha->memoryMap.region[OB].phys_addr_hi;
 		pm8001_ha->outbnd_q_tbl[i].lower_base_addr	=
@@ -1245,7 +1245,7 @@ static int mpi_msg_free_get(struct inbound_queue_table *circularQ,
 	/* Stores the new consumer index */
 	consumer_index = pm8001_read_32(circularQ->ci_virt);
 	circularQ->consumer_index = cpu_to_le32(consumer_index);
-	if (((circularQ->producer_idx + bcCount) % 256) ==
+	if (((circularQ->producer_idx + bcCount) % PM8001_MPI_QUEUE) ==
 		le32_to_cpu(circularQ->consumer_index)) {
 		*messagePtr = NULL;
 		return -1;
@@ -1253,7 +1253,8 @@ static int mpi_msg_free_get(struct inbound_queue_table *circularQ,
 	/* get memory IOMB buffer address */
 	offset = circularQ->producer_idx * 64;
 	/* increment to next bcCount element */
-	circularQ->producer_idx = (circularQ->producer_idx + bcCount) % 256;
+	circularQ->producer_idx = (circularQ->producer_idx + bcCount)
+				% PM8001_MPI_QUEUE;
 	/* Adds that distance to the base of the region virtual address plus
 	the message header size*/
 	msgHeader = (struct mpi_msg_hdr *)(circularQ->base_virt	+ offset);
@@ -1326,7 +1327,8 @@ static u32 mpi_msg_free_set(struct pm8001_hba_info *pm8001_ha, void *pMsg,
 		return 0;
 	}
 	/* free the circular queue buffer elements associated with the message*/
-	circularQ->consumer_idx = (circularQ->consumer_idx + bc) % 256;
+	circularQ->consumer_idx = (circularQ->consumer_idx + bc)
+				% PM8001_MPI_QUEUE;
 	/* update the CI of outbound queue */
 	pm8001_cw32(pm8001_ha, circularQ->ci_pci_bar, circularQ->ci_offset,
 		circularQ->consumer_idx);
@@ -1383,7 +1385,8 @@ static u32 mpi_msg_consume(struct pm8001_hba_info *pm8001_ha,
 					circularQ->consumer_idx =
 						(circularQ->consumer_idx +
 						((le32_to_cpu(msgHeader_tmp)
-						>> 24) & 0x1f)) % 256;
+						 >> 24) & 0x1f))
+							% PM8001_MPI_QUEUE;
 					msgHeader_tmp = 0;
 					pm8001_write_32(msgHeader, 0, 0);
 					/* update the CI of outbound queue */
@@ -1396,7 +1399,7 @@ static u32 mpi_msg_consume(struct pm8001_hba_info *pm8001_ha,
 				circularQ->consumer_idx =
 					(circularQ->consumer_idx +
 					((le32_to_cpu(msgHeader_tmp) >> 24) &
-					0x1f)) % 256;
+					0x1f)) % PM8001_MPI_QUEUE;
 				msgHeader_tmp = 0;
 				pm8001_write_32(msgHeader, 0, 0);
 				/* update the CI of outbound queue */
diff --git a/drivers/scsi/pm8001/pm8001_init.c b/drivers/scsi/pm8001/pm8001_init.c
index 36efaa7..0267c22 100644
--- a/drivers/scsi/pm8001/pm8001_init.c
+++ b/drivers/scsi/pm8001/pm8001_init.c
@@ -235,15 +235,15 @@ static int __devinit pm8001_alloc(struct pm8001_hba_info *pm8001_ha)
 	pm8001_ha->memoryMap.region[PI].alignment = 4;
 
 	/* MPI Memory region 5 inbound queues */
-	pm8001_ha->memoryMap.region[IB].num_elements = 256;
+	pm8001_ha->memoryMap.region[IB].num_elements = PM8001_MPI_QUEUE;
 	pm8001_ha->memoryMap.region[IB].element_size = 64;
-	pm8001_ha->memoryMap.region[IB].total_len = 256 * 64;
+	pm8001_ha->memoryMap.region[IB].total_len = PM8001_MPI_QUEUE * 64;
 	pm8001_ha->memoryMap.region[IB].alignment = 64;
 
-	/* MPI Memory region 6 inbound queues */
-	pm8001_ha->memoryMap.region[OB].num_elements = 256;
+	/* MPI Memory region 6 outbound queues */
+	pm8001_ha->memoryMap.region[OB].num_elements = PM8001_MPI_QUEUE;
 	pm8001_ha->memoryMap.region[OB].element_size = 64;
-	pm8001_ha->memoryMap.region[OB].total_len = 256 * 64;
+	pm8001_ha->memoryMap.region[OB].total_len = PM8001_MPI_QUEUE * 64;
 	pm8001_ha->memoryMap.region[OB].alignment = 64;
 
 	/* Memory region write DMA*/

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

* Re: [PATCH] pm8001: raise host can queue (take 2)
  2012-04-25 17:02 ` [PATCH] pm8001: raise host can queue (take 2) Mark Salyzyn
@ 2012-04-27  8:14   ` Jack Wang
  0 siblings, 0 replies; 5+ messages in thread
From: Jack Wang @ 2012-04-27  8:14 UTC (permalink / raw)
  To: 'Mark Salyzyn', linux-scsi
  Cc: 'James Bottomley', 'lindar_liu',
	'于爱华', 'john_gong'

Looks OK to me. Thanks.
Acked-by: Jack Wang@usish.com
> 
> This is a followup to a patch provided by Jack Wang on September 21 2011.
> 
> After increasing the CAN_QUEUE to 510 in pm8001 we discovered some
performance
> degredation from time to time. We needed to increase the MPI queue to
> compensate and ensure we never hit that limit. We also needed to double
> the margin to support event and administrivial commands that take from
> the pool resulting in an occasional largely unproductive command
completion
> with soft error to the caller when the command pool is overloaded
temporarily.
> 
> Signed-off-by: Mark Salyzyn <mark_salyzyn@xyratex.com>
> 
>  drivers/scsi/pm8001/pm8001_defs.h |    3 ++-
>  drivers/scsi/pm8001/pm8001_hwi.c  |   17 ++++++++++-------
>  drivers/scsi/pm8001/pm8001_init.c |   10 +++++-----
>  3 files changed, 17 insertions(+), 13 deletions(-)
> 
> diff --git a/drivers/scsi/pm8001/pm8001_defs.h
> b/drivers/scsi/pm8001/pm8001_defs.h
> index 944afad..c3d20c8 100644
> --- a/drivers/scsi/pm8001/pm8001_defs.h
> +++ b/drivers/scsi/pm8001/pm8001_defs.h
> @@ -66,9 +66,10 @@ enum port_type {
> 
>  /* driver compile-time configuration */
>  #define	PM8001_MAX_CCB		 512	/* max ccbs supported */
> +#define PM8001_MPI_QUEUE         1024   /* maximum mpi queue entries */
>  #define	PM8001_MAX_INB_NUM	 1
>  #define	PM8001_MAX_OUTB_NUM	 1
> -#define	PM8001_CAN_QUEUE	 128	/* SCSI Queue depth */
> +#define	PM8001_CAN_QUEUE	 508	/* SCSI Queue depth */
> 
>  /* unchangeable hardware details */
>  #define	PM8001_MAX_PHYS		 8	/* max. possible phys */
> diff --git a/drivers/scsi/pm8001/pm8001_hwi.c
> b/drivers/scsi/pm8001/pm8001_hwi.c
> index 8477df4..0d6c8b9 100644
> --- a/drivers/scsi/pm8001/pm8001_hwi.c
> +++ b/drivers/scsi/pm8001/pm8001_hwi.c
> @@ -192,7 +192,7 @@ init_default_table_values(struct pm8001_hba_info
> *pm8001_ha)
>  	pm8001_ha->main_cfg_tbl.fatal_err_interrupt		= 0x01;
>  	for (i = 0; i < qn; i++) {
>  		pm8001_ha->inbnd_q_tbl[i].element_pri_size_cnt
> -			0x00000100 | (0x00000040 << 16) | (0x00<<30);
> +			PM8001_MPI_QUEUE | (64 << 16) | (0x00<<30);
>  		pm8001_ha->inbnd_q_tbl[i].upper_base_addr
>  			pm8001_ha->memoryMap.region[IB].phys_addr_hi;
>  		pm8001_ha->inbnd_q_tbl[i].lower_base_addr
> @@ -218,7 +218,7 @@ init_default_table_values(struct pm8001_hba_info
> *pm8001_ha)
>  	}
>  	for (i = 0; i < qn; i++) {
>  		pm8001_ha->outbnd_q_tbl[i].element_size_cnt
> -			256 | (64 << 16) | (1<<30);
> +			PM8001_MPI_QUEUE | (64 << 16) | (0x01<<30);
>  		pm8001_ha->outbnd_q_tbl[i].upper_base_addr
>  			pm8001_ha->memoryMap.region[OB].phys_addr_hi;
>  		pm8001_ha->outbnd_q_tbl[i].lower_base_addr
> @@ -1245,7 +1245,7 @@ static int mpi_msg_free_get(struct
inbound_queue_table
> *circularQ,
>  	/* Stores the new consumer index */
>  	consumer_index = pm8001_read_32(circularQ->ci_virt);
>  	circularQ->consumer_index = cpu_to_le32(consumer_index);
> -	if (((circularQ->producer_idx + bcCount) % 256) =
> +	if (((circularQ->producer_idx + bcCount) % PM8001_MPI_QUEUE) =
>  		le32_to_cpu(circularQ->consumer_index)) {
>  		*messagePtr = NULL;
>  		return -1;
> @@ -1253,7 +1253,8 @@ static int mpi_msg_free_get(struct
inbound_queue_table
> *circularQ,
>  	/* get memory IOMB buffer address */
>  	offset = circularQ->producer_idx * 64;
>  	/* increment to next bcCount element */
> -	circularQ->producer_idx = (circularQ->producer_idx + bcCount) % 256;
> +	circularQ->producer_idx = (circularQ->producer_idx + bcCount)
> +				% PM8001_MPI_QUEUE;
>  	/* Adds that distance to the base of the region virtual address plus
>  	the message header size*/
>  	msgHeader = (struct mpi_msg_hdr *)(circularQ->base_virt	+ offset);
> @@ -1326,7 +1327,8 @@ static u32 mpi_msg_free_set(struct pm8001_hba_info
> *pm8001_ha, void *pMsg,
>  		return 0;
>  	}
>  	/* free the circular queue buffer elements associated with the
message*/
> -	circularQ->consumer_idx = (circularQ->consumer_idx + bc) % 256;
> +	circularQ->consumer_idx = (circularQ->consumer_idx + bc)
> +				% PM8001_MPI_QUEUE;
>  	/* update the CI of outbound queue */
>  	pm8001_cw32(pm8001_ha, circularQ->ci_pci_bar, circularQ->ci_offset,
>  		circularQ->consumer_idx);
> @@ -1383,7 +1385,8 @@ static u32 mpi_msg_consume(struct pm8001_hba_info
> *pm8001_ha,
>  					circularQ->consumer_idx
>  						(circularQ->consumer_idx +
>  						((le32_to_cpu(msgHeader_tmp)
> -						>> 24) & 0x1f)) % 256;
> +						 >> 24) & 0x1f))
> +							% PM8001_MPI_QUEUE;
>  					msgHeader_tmp = 0;
>  					pm8001_write_32(msgHeader, 0, 0);
>  					/* update the CI of outbound queue
*/
> @@ -1396,7 +1399,7 @@ static u32 mpi_msg_consume(struct pm8001_hba_info
> *pm8001_ha,
>  				circularQ->consumer_idx
>  					(circularQ->consumer_idx +
>  					((le32_to_cpu(msgHeader_tmp) >> 24)
&
> -					0x1f)) % 256;
> +					0x1f)) % PM8001_MPI_QUEUE;
>  				msgHeader_tmp = 0;
>  				pm8001_write_32(msgHeader, 0, 0);
>  				/* update the CI of outbound queue */
> diff --git a/drivers/scsi/pm8001/pm8001_init.c
> b/drivers/scsi/pm8001/pm8001_init.c
> index 36efaa7..0267c22 100644
> --- a/drivers/scsi/pm8001/pm8001_init.c
> +++ b/drivers/scsi/pm8001/pm8001_init.c
> @@ -235,15 +235,15 @@ static int __devinit pm8001_alloc(struct
pm8001_hba_info
> *pm8001_ha)
>  	pm8001_ha->memoryMap.region[PI].alignment = 4;
> 
>  	/* MPI Memory region 5 inbound queues */
> -	pm8001_ha->memoryMap.region[IB].num_elements = 256;
> +	pm8001_ha->memoryMap.region[IB].num_elements = PM8001_MPI_QUEUE;
>  	pm8001_ha->memoryMap.region[IB].element_size = 64;
> -	pm8001_ha->memoryMap.region[IB].total_len = 256 * 64;
> +	pm8001_ha->memoryMap.region[IB].total_len = PM8001_MPI_QUEUE * 64;
>  	pm8001_ha->memoryMap.region[IB].alignment = 64;
> 
> -	/* MPI Memory region 6 inbound queues */
> -	pm8001_ha->memoryMap.region[OB].num_elements = 256;
> +	/* MPI Memory region 6 outbound queues */
> +	pm8001_ha->memoryMap.region[OB].num_elements = PM8001_MPI_QUEUE;
>  	pm8001_ha->memoryMap.region[OB].element_size = 64;
> -	pm8001_ha->memoryMap.region[OB].total_len = 256 * 64;
> +	pm8001_ha->memoryMap.region[OB].total_len = PM8001_MPI_QUEUE * 64;
>  	pm8001_ha->memoryMap.region[OB].alignment = 64;
> 
>  	/* Memory region write DMA*/
> 



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

end of thread, other threads:[~2012-04-27  8:14 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-09-22  2:05 [PATCH] pm8001: raise host can queue Jack Wang
2011-09-22  4:25 ` Dan Williams
2011-09-22  4:34   ` Jack Wang
2012-04-25 17:02 ` [PATCH] pm8001: raise host can queue (take 2) Mark Salyzyn
2012-04-27  8:14   ` Jack Wang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.