linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 07/21] lpfc: Fix setting of EQ delay Multiplier
@ 2015-02-05 19:24 James Smart
  2015-02-06 12:18 ` Tomas Henzl
  0 siblings, 1 reply; 3+ messages in thread
From: James Smart @ 2015-02-05 19:24 UTC (permalink / raw)
  To: linux-scsi

---
 drivers/scsi/lpfc/lpfc_init.c | 8 ++++++++
 drivers/scsi/lpfc/lpfc_sli.c  | 9 +++------
 drivers/scsi/lpfc/lpfc_sli4.h | 2 +-
 3 files changed, 12 insertions(+), 7 deletions(-)

diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c
index 74672e0..e01619c 100644
--- a/drivers/scsi/lpfc/lpfc_init.c
+++ b/drivers/scsi/lpfc/lpfc_init.c
@@ -7721,6 +7721,14 @@ lpfc_sli4_queue_setup(struct lpfc_hba *phba)
 			goto out_destroy_els_rq;
 		}
 	}
+
+	/*
+	 * Configure EQ delay multipier for interrupt coalescing using
+	 * MODIFY_EQ_DELAY for all EQs created, LPFC_MAX_EQ_DELAY at a time.
+	 */
+	for (fcp_eqidx = 0; fcp_eqidx < phba->cfg_fcp_io_channel;
+			fcp_eqidx += LPFC_MAX_EQ_DELAY)
+		lpfc_modify_fcp_eq_delay(phba, fcp_eqidx);
 	return 0;
 
 out_destroy_els_rq:
diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c
index 207a43d..303b231 100644
--- a/drivers/scsi/lpfc/lpfc_sli.c
+++ b/drivers/scsi/lpfc/lpfc_sli.c
@@ -12842,7 +12842,7 @@ lpfc_dual_chute_pci_bar_map(struct lpfc_hba *phba, uint16_t pci_barset)
  * fails this function will return -ENXIO.
  **/
 int
-lpfc_modify_fcp_eq_delay(struct lpfc_hba *phba, uint16_t startq)
+lpfc_modify_fcp_eq_delay(struct lpfc_hba *phba, uint32_t startq)
 {
 	struct lpfc_mbx_modify_eq_delay *eq_delay;
 	LPFC_MBOXQ_t *mbox;
@@ -12959,11 +12959,8 @@ lpfc_eq_create(struct lpfc_hba *phba, struct lpfc_queue *eq, uint32_t imax)
 	bf_set(lpfc_eq_context_size, &eq_create->u.request.context,
 	       LPFC_EQE_SIZE);
 	bf_set(lpfc_eq_context_valid, &eq_create->u.request.context, 1);
-	/* Calculate delay multiper from maximum interrupt per second */
-	if (imax > LPFC_DMULT_CONST)
-		dmult = 0;
-	else
-		dmult = LPFC_DMULT_CONST/imax - 1;
+	/* don't setup delay multiplier using EQ_CREATE */
+	dmult = 0;
 	bf_set(lpfc_eq_context_delay_multi, &eq_create->u.request.context,
 	       dmult);
 	switch (eq->entry_count) {
diff --git a/drivers/scsi/lpfc/lpfc_sli4.h b/drivers/scsi/lpfc/lpfc_sli4.h
index 22ceb2b..935b8eb 100644
--- a/drivers/scsi/lpfc/lpfc_sli4.h
+++ b/drivers/scsi/lpfc/lpfc_sli4.h
@@ -671,7 +671,7 @@ struct lpfc_queue *lpfc_sli4_queue_alloc(struct lpfc_hba *, uint32_t,
 			uint32_t);
 void lpfc_sli4_queue_free(struct lpfc_queue *);
 int lpfc_eq_create(struct lpfc_hba *, struct lpfc_queue *, uint32_t);
-int lpfc_modify_fcp_eq_delay(struct lpfc_hba *, uint16_t);
+int lpfc_modify_fcp_eq_delay(struct lpfc_hba *, uint32_t);
 int lpfc_cq_create(struct lpfc_hba *, struct lpfc_queue *,
 			struct lpfc_queue *, uint32_t, uint32_t);
 int32_t lpfc_mq_create(struct lpfc_hba *, struct lpfc_queue *,
-- 
1.7.11.7

Signed-off-by: James Smart <james.smart@emulex.com>
Signed-off-by: Dick Kennedy <dick.kennedy@emulex.com>




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

* Re: [PATCH 07/21] lpfc: Fix setting of EQ delay Multiplier
  2015-02-05 19:24 [PATCH 07/21] lpfc: Fix setting of EQ delay Multiplier James Smart
@ 2015-02-06 12:18 ` Tomas Henzl
  2015-02-16 16:19   ` James Smart
  0 siblings, 1 reply; 3+ messages in thread
From: Tomas Henzl @ 2015-02-06 12:18 UTC (permalink / raw)
  To: james.smart, linux-scsi

On 02/05/2015 08:24 PM, James Smart wrote:
> ---
>  drivers/scsi/lpfc/lpfc_init.c | 8 ++++++++
>  drivers/scsi/lpfc/lpfc_sli.c  | 9 +++------
>  drivers/scsi/lpfc/lpfc_sli4.h | 2 +-
>  3 files changed, 12 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c
> index 74672e0..e01619c 100644
> --- a/drivers/scsi/lpfc/lpfc_init.c
> +++ b/drivers/scsi/lpfc/lpfc_init.c
> @@ -7721,6 +7721,14 @@ lpfc_sli4_queue_setup(struct lpfc_hba *phba)
>  			goto out_destroy_els_rq;
>  		}
>  	}
> +
> +	/*
> +	 * Configure EQ delay multipier for interrupt coalescing using
> +	 * MODIFY_EQ_DELAY for all EQs created, LPFC_MAX_EQ_DELAY at a time.
> +	 */
> +	for (fcp_eqidx = 0; fcp_eqidx < phba->cfg_fcp_io_channel;
> +			fcp_eqidx += LPFC_MAX_EQ_DELAY)
> +		lpfc_modify_fcp_eq_delay(phba, fcp_eqidx);
>  	return 0;
>  
>  out_destroy_els_rq:
> diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c
> index 207a43d..303b231 100644
> --- a/drivers/scsi/lpfc/lpfc_sli.c
> +++ b/drivers/scsi/lpfc/lpfc_sli.c
> @@ -12842,7 +12842,7 @@ lpfc_dual_chute_pci_bar_map(struct lpfc_hba *phba, uint16_t pci_barset)
>   * fails this function will return -ENXIO.
>   **/
>  int
> -lpfc_modify_fcp_eq_delay(struct lpfc_hba *phba, uint16_t startq)
> +lpfc_modify_fcp_eq_delay(struct lpfc_hba *phba, uint32_t startq)
>  {
>  	struct lpfc_mbx_modify_eq_delay *eq_delay;
>  	LPFC_MBOXQ_t *mbox;
> @@ -12959,11 +12959,8 @@ lpfc_eq_create(struct lpfc_hba *phba, struct lpfc_queue *eq, uint32_t imax)
>  	bf_set(lpfc_eq_context_size, &eq_create->u.request.context,
>  	       LPFC_EQE_SIZE);
>  	bf_set(lpfc_eq_context_valid, &eq_create->u.request.context, 1);
> -	/* Calculate delay multiper from maximum interrupt per second */
> -	if (imax > LPFC_DMULT_CONST)
> -		dmult = 0;
> -	else
> -		dmult = LPFC_DMULT_CONST/imax - 1;
> +	/* don't setup delay multiplier using EQ_CREATE */
> +	dmult = 0;
>  	bf_set(lpfc_eq_context_delay_multi, &eq_create->u.request.context,
>  	       dmult);

This is the only use of 'dmult' in this function, please remove the variable completely 
and use this instead - 	bf_set(lpfc_eq_context_delay_multi, &eq_create->u.request.context, 0);
Thanks, Tomas

>  	switch (eq->entry_count) {
> diff --git a/drivers/scsi/lpfc/lpfc_sli4.h b/drivers/scsi/lpfc/lpfc_sli4.h
> index 22ceb2b..935b8eb 100644
> --- a/drivers/scsi/lpfc/lpfc_sli4.h
> +++ b/drivers/scsi/lpfc/lpfc_sli4.h
> @@ -671,7 +671,7 @@ struct lpfc_queue *lpfc_sli4_queue_alloc(struct lpfc_hba *, uint32_t,
>  			uint32_t);
>  void lpfc_sli4_queue_free(struct lpfc_queue *);
>  int lpfc_eq_create(struct lpfc_hba *, struct lpfc_queue *, uint32_t);
> -int lpfc_modify_fcp_eq_delay(struct lpfc_hba *, uint16_t);
> +int lpfc_modify_fcp_eq_delay(struct lpfc_hba *, uint32_t);
>  int lpfc_cq_create(struct lpfc_hba *, struct lpfc_queue *,
>  			struct lpfc_queue *, uint32_t, uint32_t);
>  int32_t lpfc_mq_create(struct lpfc_hba *, struct lpfc_queue *,


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

* Re: [PATCH 07/21] lpfc: Fix setting of EQ delay Multiplier
  2015-02-06 12:18 ` Tomas Henzl
@ 2015-02-16 16:19   ` James Smart
  0 siblings, 0 replies; 3+ messages in thread
From: James Smart @ 2015-02-16 16:19 UTC (permalink / raw)
  To: Tomas Henzl; +Cc: linux-scsi

Tomas,

This one I'm going to leave as is.  bf_set is a macro and I'd prefer we 
kept the variable with a real data type and not be subject to any 
compiler-based type conversions in the equations.  I'd rather not risk 
any disruption to the macro to add all the paren'd type declarations.

-- james


On 2/6/2015 7:18 AM, Tomas Henzl wrote:
> @@ -12959,11 +12959,8 @@ lpfc_eq_create(struct lpfc_hba *phba, struct lpfc_queue *eq, uint32_t imax)
>   	bf_set(lpfc_eq_context_size, &eq_create->u.request.context,
>   	       LPFC_EQE_SIZE);
>   	bf_set(lpfc_eq_context_valid, &eq_create->u.request.context, 1);
> -	/* Calculate delay multiper from maximum interrupt per second */
> -	if (imax > LPFC_DMULT_CONST)
> -		dmult = 0;
> -	else
> -		dmult = LPFC_DMULT_CONST/imax - 1;
> +	/* don't setup delay multiplier using EQ_CREATE */
> +	dmult = 0;
>   	bf_set(lpfc_eq_context_delay_multi, &eq_create->u.request.context,
>   	       dmult);
> This is the only use of 'dmult' in this function, please remove the variable completely
> and use this instead - 	bf_set(lpfc_eq_context_delay_multi, &eq_create->u.request.context, 0);
> Thanks, Tomas
>
>


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

end of thread, other threads:[~2015-02-16 16:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-02-05 19:24 [PATCH 07/21] lpfc: Fix setting of EQ delay Multiplier James Smart
2015-02-06 12:18 ` Tomas Henzl
2015-02-16 16:19   ` James Smart

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).