* [PATCH RESEND 4/18] megaraid_sas : Move controller's queue depth calculation in adapter specific function
@ 2015-04-20 12:33 Sumit.Saxena
2015-04-21 10:21 ` Hannes Reinecke
0 siblings, 1 reply; 3+ messages in thread
From: Sumit.Saxena @ 2015-04-20 12:33 UTC (permalink / raw)
To: linux-scsi
Cc: thenzl, martin.petersen, hch, jbottomley, kashyap.desai,
sumit.saxena
This patch will move controller's queue depth calculation in adapter specific functions.
Signed-off-by: Kashyap Desai <kashyap.desai@avagotech.com>
Signed-off-by: Sumit Saxena <sumit.saxena@avagotech.com>
---
drivers/scsi/megaraid/megaraid_sas_base.c | 39 ++++++++++----------------
drivers/scsi/megaraid/megaraid_sas_fusion.c | 9 ++++++
2 files changed, 24 insertions(+), 24 deletions(-)
diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c b/drivers/scsi/megaraid/megaraid_sas_base.c
index e6cb2bd..7f426e0 100644
--- a/drivers/scsi/megaraid/megaraid_sas_base.c
+++ b/drivers/scsi/megaraid/megaraid_sas_base.c
@@ -4354,6 +4354,21 @@ megasas_init_adapter_mfi(struct megasas_instance *instance)
instance->max_num_sge = (instance->instancet->read_fw_status_reg(reg_set) & 0xFF0000) >>
0x10;
/*
+ * For MFI skinny adapters, MEGASAS_SKINNY_INT_CMDS commands
+ * are reserved for IOCTL + driver's internal DCMDs.
+ */
+ if ((instance->pdev->device == PCI_DEVICE_ID_LSI_SAS0073SKINNY) ||
+ (instance->pdev->device == PCI_DEVICE_ID_LSI_SAS0071SKINNY)) {
+ instance->max_scsi_cmds = (instance->max_fw_cmds -
+ MEGASAS_SKINNY_INT_CMDS);
+ sema_init(&instance->ioctl_sem, MEGASAS_SKINNY_INT_CMDS);
+ } else {
+ instance->max_scsi_cmds = (instance->max_fw_cmds -
+ MEGASAS_INT_CMDS);
+ sema_init(&instance->ioctl_sem, (MEGASAS_INT_CMDS - 5));
+ }
+
+ /*
* Create a pool of commands
*/
if (megasas_alloc_cmds(instance))
@@ -4751,30 +4766,6 @@ static int megasas_init_fw(struct megasas_instance *instance)
if (tmp_sectors && (instance->max_sectors_per_req > tmp_sectors))
instance->max_sectors_per_req = tmp_sectors;
- /*
- * 1. For fusion adapters, 3 commands for IOCTL and 5 commands
- * for driver's internal DCMDs.
- * 2. For MFI skinny adapters, 5 commands for IOCTL + driver's
- * internal DCMDs.
- * 3. For rest of MFI adapters, 27 commands reserved for IOCTLs
- * and 5 commands for drivers's internal DCMD.
- */
- if (instance->ctrl_context) {
- instance->max_scsi_cmds = instance->max_fw_cmds -
- (MEGASAS_FUSION_INTERNAL_CMDS +
- MEGASAS_FUSION_IOCTL_CMDS);
- sema_init(&instance->ioctl_sem, MEGASAS_FUSION_IOCTL_CMDS);
- } else if ((instance->pdev->device == PCI_DEVICE_ID_LSI_SAS0073SKINNY) ||
- (instance->pdev->device == PCI_DEVICE_ID_LSI_SAS0071SKINNY)) {
- instance->max_scsi_cmds = instance->max_fw_cmds -
- MEGASAS_SKINNY_INT_CMDS;
- sema_init(&instance->ioctl_sem, MEGASAS_SKINNY_INT_CMDS);
- } else {
- instance->max_scsi_cmds = instance->max_fw_cmds -
- MEGASAS_INT_CMDS;
- sema_init(&instance->ioctl_sem, (MEGASAS_INT_CMDS - 5));
- }
-
/* Check for valid throttlequeuedepth module parameter */
if (throttlequeuedepth &&
throttlequeuedepth <= instance->max_scsi_cmds)
diff --git a/drivers/scsi/megaraid/megaraid_sas_fusion.c b/drivers/scsi/megaraid/megaraid_sas_fusion.c
index c5619f8..3cd1d5f 100644
--- a/drivers/scsi/megaraid/megaraid_sas_fusion.c
+++ b/drivers/scsi/megaraid/megaraid_sas_fusion.c
@@ -1061,6 +1061,15 @@ megasas_init_adapter_fusion(struct megasas_instance *instance)
fusion->last_reply_idx[i] = 0;
/*
+ * For fusion adapters, 3 commands for IOCTL and 5 commands
+ * for driver's internal DCMDs.
+ */
+ instance->max_scsi_cmds = instance->max_fw_cmds -
+ (MEGASAS_FUSION_INTERNAL_CMDS +
+ MEGASAS_FUSION_IOCTL_CMDS);
+ sema_init(&instance->ioctl_sem, MEGASAS_FUSION_IOCTL_CMDS);
+
+ /*
* Allocate memory for descriptors
* Create a pool of commands
*/
--
1.7.1
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH RESEND 4/18] megaraid_sas : Move controller's queue depth calculation in adapter specific function
2015-04-20 12:33 [PATCH RESEND 4/18] megaraid_sas : Move controller's queue depth calculation in adapter specific function Sumit.Saxena
@ 2015-04-21 10:21 ` Hannes Reinecke
2015-04-21 11:00 ` Sumit Saxena
0 siblings, 1 reply; 3+ messages in thread
From: Hannes Reinecke @ 2015-04-21 10:21 UTC (permalink / raw)
To: Sumit.Saxena, linux-scsi
Cc: thenzl, martin.petersen, hch, jbottomley, kashyap.desai
On 04/20/2015 02:33 PM, Sumit.Saxena@avagotech.com wrote:
> This patch will move controller's queue depth calculation in adapter specific functions.
>
> Signed-off-by: Kashyap Desai <kashyap.desai@avagotech.com>
> Signed-off-by: Sumit Saxena <sumit.saxena@avagotech.com>
>
> ---
> drivers/scsi/megaraid/megaraid_sas_base.c | 39 ++++++++++----------------
> drivers/scsi/megaraid/megaraid_sas_fusion.c | 9 ++++++
> 2 files changed, 24 insertions(+), 24 deletions(-)
>
> diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c b/drivers/scsi/megaraid/megaraid_sas_base.c
> index e6cb2bd..7f426e0 100644
> --- a/drivers/scsi/megaraid/megaraid_sas_base.c
> +++ b/drivers/scsi/megaraid/megaraid_sas_base.c
> @@ -4354,6 +4354,21 @@ megasas_init_adapter_mfi(struct megasas_instance *instance)
> instance->max_num_sge = (instance->instancet->read_fw_status_reg(reg_set) & 0xFF0000) >>
> 0x10;
> /*
> + * For MFI skinny adapters, MEGASAS_SKINNY_INT_CMDS commands
> + * are reserved for IOCTL + driver's internal DCMDs.
> + */
> + if ((instance->pdev->device == PCI_DEVICE_ID_LSI_SAS0073SKINNY) ||
> + (instance->pdev->device == PCI_DEVICE_ID_LSI_SAS0071SKINNY)) {
> + instance->max_scsi_cmds = (instance->max_fw_cmds -
> + MEGASAS_SKINNY_INT_CMDS);
> + sema_init(&instance->ioctl_sem, MEGASAS_SKINNY_INT_CMDS);
> + } else {
> + instance->max_scsi_cmds = (instance->max_fw_cmds -
> + MEGASAS_INT_CMDS);
> + sema_init(&instance->ioctl_sem, (MEGASAS_INT_CMDS - 5));
'- 5' ?
I'd prefer to have a separate #define as you did for the fusion side...
> + }
> +
> + /*
> * Create a pool of commands
> */
> if (megasas_alloc_cmds(instance))
> @@ -4751,30 +4766,6 @@ static int megasas_init_fw(struct megasas_instance *instance)
> if (tmp_sectors && (instance->max_sectors_per_req > tmp_sectors))
> instance->max_sectors_per_req = tmp_sectors;
>
> - /*
> - * 1. For fusion adapters, 3 commands for IOCTL and 5 commands
> - * for driver's internal DCMDs.
> - * 2. For MFI skinny adapters, 5 commands for IOCTL + driver's
> - * internal DCMDs.
> - * 3. For rest of MFI adapters, 27 commands reserved for IOCTLs
> - * and 5 commands for drivers's internal DCMD.
> - */
> - if (instance->ctrl_context) {
> - instance->max_scsi_cmds = instance->max_fw_cmds -
> - (MEGASAS_FUSION_INTERNAL_CMDS +
> - MEGASAS_FUSION_IOCTL_CMDS);
> - sema_init(&instance->ioctl_sem, MEGASAS_FUSION_IOCTL_CMDS);
> - } else if ((instance->pdev->device == PCI_DEVICE_ID_LSI_SAS0073SKINNY) ||
> - (instance->pdev->device == PCI_DEVICE_ID_LSI_SAS0071SKINNY)) {
> - instance->max_scsi_cmds = instance->max_fw_cmds -
> - MEGASAS_SKINNY_INT_CMDS;
> - sema_init(&instance->ioctl_sem, MEGASAS_SKINNY_INT_CMDS);
> - } else {
> - instance->max_scsi_cmds = instance->max_fw_cmds -
> - MEGASAS_INT_CMDS;
> - sema_init(&instance->ioctl_sem, (MEGASAS_INT_CMDS - 5));
> - }
> -
> /* Check for valid throttlequeuedepth module parameter */
> if (throttlequeuedepth &&
> throttlequeuedepth <= instance->max_scsi_cmds)
> diff --git a/drivers/scsi/megaraid/megaraid_sas_fusion.c b/drivers/scsi/megaraid/megaraid_sas_fusion.c
> index c5619f8..3cd1d5f 100644
> --- a/drivers/scsi/megaraid/megaraid_sas_fusion.c
> +++ b/drivers/scsi/megaraid/megaraid_sas_fusion.c
> @@ -1061,6 +1061,15 @@ megasas_init_adapter_fusion(struct megasas_instance *instance)
> fusion->last_reply_idx[i] = 0;
>
> /*
> + * For fusion adapters, 3 commands for IOCTL and 5 commands
> + * for driver's internal DCMDs.
> + */
> + instance->max_scsi_cmds = instance->max_fw_cmds -
> + (MEGASAS_FUSION_INTERNAL_CMDS +
> + MEGASAS_FUSION_IOCTL_CMDS);
> + sema_init(&instance->ioctl_sem, MEGASAS_FUSION_IOCTL_CMDS);
> +
> + /*
> * Allocate memory for descriptors
> * Create a pool of commands
> */
>
See? Here it's a #define ...
Cheers,
Hannes
--
Dr. Hannes Reinecke zSeries & Storage
hare@suse.de +49 911 74053 688
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: J. Hawn, J. Guild, F. Imendörffer, HRB 16746 (AG Nürnberg)
--
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] 3+ messages in thread* RE: [PATCH RESEND 4/18] megaraid_sas : Move controller's queue depth calculation in adapter specific function
2015-04-21 10:21 ` Hannes Reinecke
@ 2015-04-21 11:00 ` Sumit Saxena
0 siblings, 0 replies; 3+ messages in thread
From: Sumit Saxena @ 2015-04-21 11:00 UTC (permalink / raw)
To: Hannes Reinecke, linux-scsi
Cc: thenzl, martin.petersen, hch, jbottomley, Kashyap Desai
>-----Original Message-----
>From: Hannes Reinecke [mailto:hare@suse.de]
>Sent: Tuesday, April 21, 2015 3:52 PM
>To: Sumit.Saxena@avagotech.com; linux-scsi@vger.kernel.org
>Cc: thenzl@redhat.com; martin.petersen@oracle.com; hch@infradead.org;
>jbottomley@parallels.com; kashyap.desai@avagotech.com
>Subject: Re: [PATCH RESEND 4/18] megaraid_sas : Move controller's queue
>depth calculation in adapter specific function
>
>On 04/20/2015 02:33 PM, Sumit.Saxena@avagotech.com wrote:
>> This patch will move controller's queue depth calculation in adapter
specific
>functions.
>>
>> Signed-off-by: Kashyap Desai <kashyap.desai@avagotech.com>
>> Signed-off-by: Sumit Saxena <sumit.saxena@avagotech.com>
>>
>> ---
>> drivers/scsi/megaraid/megaraid_sas_base.c | 39
++++++++++--------------
>--
>> drivers/scsi/megaraid/megaraid_sas_fusion.c | 9 ++++++
>> 2 files changed, 24 insertions(+), 24 deletions(-)
>>
>> diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c
>> b/drivers/scsi/megaraid/megaraid_sas_base.c
>> index e6cb2bd..7f426e0 100644
>> --- a/drivers/scsi/megaraid/megaraid_sas_base.c
>> +++ b/drivers/scsi/megaraid/megaraid_sas_base.c
>> @@ -4354,6 +4354,21 @@ megasas_init_adapter_mfi(struct
>megasas_instance *instance)
>> instance->max_num_sge = (instance->instancet-
>>read_fw_status_reg(reg_set) & 0xFF0000) >>
>> 0x10;
>> /*
>> + * For MFI skinny adapters, MEGASAS_SKINNY_INT_CMDS commands
>> + * are reserved for IOCTL + driver's internal DCMDs.
>> + */
>> + if ((instance->pdev->device == PCI_DEVICE_ID_LSI_SAS0073SKINNY)
>||
>> + (instance->pdev->device ==
>PCI_DEVICE_ID_LSI_SAS0071SKINNY)) {
>> + instance->max_scsi_cmds = (instance->max_fw_cmds -
>> + MEGASAS_SKINNY_INT_CMDS);
>> + sema_init(&instance->ioctl_sem,
>MEGASAS_SKINNY_INT_CMDS);
>> + } else {
>> + instance->max_scsi_cmds = (instance->max_fw_cmds -
>> + MEGASAS_INT_CMDS);
>> + sema_init(&instance->ioctl_sem, (MEGASAS_INT_CMDS - 5));
>'- 5' ?
>I'd prefer to have a separate #define as you did for the fusion side...
I will resend this patch series(as there are comments from Christoph
Hellwig to rework for other patches of the series as well) and take care
of it.
>
>> + }
>> +
>> + /*
>> * Create a pool of commands
>> */
>> if (megasas_alloc_cmds(instance))
>> @@ -4751,30 +4766,6 @@ static int megasas_init_fw(struct
>megasas_instance *instance)
>> if (tmp_sectors && (instance->max_sectors_per_req > tmp_sectors))
>> instance->max_sectors_per_req = tmp_sectors;
>>
>> - /*
>> - * 1. For fusion adapters, 3 commands for IOCTL and 5 commands
>> - * for driver's internal DCMDs.
>> - * 2. For MFI skinny adapters, 5 commands for IOCTL + driver's
>> - * internal DCMDs.
>> - * 3. For rest of MFI adapters, 27 commands reserved for IOCTLs
>> - * and 5 commands for drivers's internal DCMD.
>> - */
>> - if (instance->ctrl_context) {
>> - instance->max_scsi_cmds = instance->max_fw_cmds -
>> -
> (MEGASAS_FUSION_INTERNAL_CMDS +
>> - MEGASAS_FUSION_IOCTL_CMDS);
>> - sema_init(&instance->ioctl_sem,
>MEGASAS_FUSION_IOCTL_CMDS);
>> - } else if ((instance->pdev->device ==
>PCI_DEVICE_ID_LSI_SAS0073SKINNY) ||
>> - (instance->pdev->device ==
>PCI_DEVICE_ID_LSI_SAS0071SKINNY)) {
>> - instance->max_scsi_cmds = instance->max_fw_cmds -
>> -
> MEGASAS_SKINNY_INT_CMDS;
>> - sema_init(&instance->ioctl_sem,
>MEGASAS_SKINNY_INT_CMDS);
>> - } else {
>> - instance->max_scsi_cmds = instance->max_fw_cmds -
>> - MEGASAS_INT_CMDS;
>> - sema_init(&instance->ioctl_sem, (MEGASAS_INT_CMDS - 5));
>> - }
>> -
>> /* Check for valid throttlequeuedepth module parameter */
>> if (throttlequeuedepth &&
>> throttlequeuedepth <= instance->max_scsi_cmds)
>diff --git
>> a/drivers/scsi/megaraid/megaraid_sas_fusion.c
>> b/drivers/scsi/megaraid/megaraid_sas_fusion.c
>> index c5619f8..3cd1d5f 100644
>> --- a/drivers/scsi/megaraid/megaraid_sas_fusion.c
>> +++ b/drivers/scsi/megaraid/megaraid_sas_fusion.c
>> @@ -1061,6 +1061,15 @@ megasas_init_adapter_fusion(struct
>megasas_instance *instance)
>> fusion->last_reply_idx[i] = 0;
>>
>> /*
>> + * For fusion adapters, 3 commands for IOCTL and 5 commands
>> + * for driver's internal DCMDs.
>> + */
>> + instance->max_scsi_cmds = instance->max_fw_cmds -
>> + (MEGASAS_FUSION_INTERNAL_CMDS +
>> + MEGASAS_FUSION_IOCTL_CMDS);
>> + sema_init(&instance->ioctl_sem, MEGASAS_FUSION_IOCTL_CMDS);
>> +
>> + /*
>> * Allocate memory for descriptors
>> * Create a pool of commands
>> */
>>
>See? Here it's a #define ...
>
>Cheers,
>
>Hannes
>--
>Dr. Hannes Reinecke zSeries & Storage
>hare@suse.de +49 911 74053 688
>SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg
>GF: J. Hawn, J. Guild, F. Imendörffer, HRB 16746 (AG Nürnberg)
--
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] 3+ messages in thread
end of thread, other threads:[~2015-04-21 11:00 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-04-20 12:33 [PATCH RESEND 4/18] megaraid_sas : Move controller's queue depth calculation in adapter specific function Sumit.Saxena
2015-04-21 10:21 ` Hannes Reinecke
2015-04-21 11:00 ` Sumit Saxena
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox