diff mbox

[14/43] qla2xxx: Add option for use reserve exch for ELS

Message ID 20171220065644.21511-15-himanshu.madhani@cavium.com (mailing list archive)
State Changes Requested
Headers show

Commit Message

Madhani, Himanshu Dec. 20, 2017, 6:56 a.m. UTC
From: Quinn Tran <quinn.tran@cavium.com>

Add option to tell FW to reserve 1/2 of emergency exchanges for ELS.

Signed-off-by: Quinn Tran <quinn.tran@cavium.com>
Signed-off-by: Himanshu Madhani <himanshu.madhani@cavium.com>
---
 drivers/scsi/qla2xxx/qla_gbl.h  | 1 +
 drivers/scsi/qla2xxx/qla_init.c | 6 ++++++
 drivers/scsi/qla2xxx/qla_os.c   | 6 ++++++
 3 files changed, 13 insertions(+)

Comments

Bart Van Assche Dec. 20, 2017, 4:53 p.m. UTC | #1
On Tue, 2017-12-19 at 22:56 -0800, Himanshu Madhani wrote:
> +int qla2xuseresexchforels;

> +module_param(qla2xuseresexchforels, int, 0444);

> +MODULE_PARM_DESC(qla2xuseresexchforels,

> +		 "Reserve 1/2 of emergency exchanges for ELS.\n"

> +		 " 0 (default): disabled");


Same question here as for another kernel module parameter: does this have to
be a kernel module parameter or could this have been implemented as a sysfs
attribute?

Thanks,

Bart.
Madhani, Himanshu Dec. 20, 2017, 9:40 p.m. UTC | #2
Hi Bart, 

> On Dec 20, 2017, at 10:53 AM, Bart Van Assche <bart.vanassche@wdc.com> wrote:
> 
> On Tue, 2017-12-19 at 22:56 -0800, Himanshu Madhani wrote:
>> +int qla2xuseresexchforels;
>> +module_param(qla2xuseresexchforels, int, 0444);
>> +MODULE_PARM_DESC(qla2xuseresexchforels,
>> +		 "Reserve 1/2 of emergency exchanges for ELS.\n"
>> +		 " 0 (default): disabled");
> 
> Same question here as for another kernel module parameter: does this have to
> be a kernel module parameter or could this have been implemented as a sysfs
> attribute?
> 
> Thanks,
> 
> Bart.

This does not have to be module parameter. Let me work on changing this to sysfs and
submit in next series with the correction

Thanks,
- Himanshu
diff mbox

Patch

diff --git a/drivers/scsi/qla2xxx/qla_gbl.h b/drivers/scsi/qla2xxx/qla_gbl.h
index fb1c9ffdc05a..88c7746c023a 100644
--- a/drivers/scsi/qla2xxx/qla_gbl.h
+++ b/drivers/scsi/qla2xxx/qla_gbl.h
@@ -149,6 +149,7 @@  extern int ql2xnvmeenable;
 extern int ql2xautodetectsfp;
 extern int ql2xenablemsix;
 extern int ql2xtrackfwres;
+extern int qla2xuseresexchforels;
 
 extern int qla2x00_loop_reset(scsi_qla_host_t *);
 extern void qla2x00_abort_all_cmds(scsi_qla_host_t *, int);
diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c
index 61b74fd220a3..6223dfe20767 100644
--- a/drivers/scsi/qla2xxx/qla_init.c
+++ b/drivers/scsi/qla2xxx/qla_init.c
@@ -3387,6 +3387,12 @@  qla24xx_update_fw_options(scsi_qla_host_t *vha)
 			ha->fw_options[2] |= BIT_4;
 		else
 			ha->fw_options[2] &= ~BIT_4;
+
+		/* Reserve 1/2 of emergency exchanges for ELS.*/
+		if (qla2xuseresexchforels)
+			ha->fw_options[2] |= BIT_8;
+		else
+			ha->fw_options[2] &= ~BIT_8;
 	}
 
 	ql_dbg(ql_dbg_init, vha, 0x00e8,
diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c
index 66e6fe73a035..fd107c4feda5 100644
--- a/drivers/scsi/qla2xxx/qla_os.c
+++ b/drivers/scsi/qla2xxx/qla_os.c
@@ -282,6 +282,12 @@  module_param(ql2xtrackfwres, int, 0444);
 MODULE_PARM_DESC(ql2xtrackfwres,
 		 "Track FW resource.  0(default): disabled");
 
+int qla2xuseresexchforels;
+module_param(qla2xuseresexchforels, int, 0444);
+MODULE_PARM_DESC(qla2xuseresexchforels,
+		 "Reserve 1/2 of emergency exchanges for ELS.\n"
+		 " 0 (default): disabled");
+
 /*
  * SCSI host template entry points
  */