linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/7] qla2xxx driver features
@ 2022-08-26 10:25 Nilesh Javali
  2022-08-26 10:25 ` [PATCH v2 1/7] Revert "scsi: qla2xxx: Fix response queue handler reading stale packets" Nilesh Javali
                   ` (7 more replies)
  0 siblings, 8 replies; 23+ messages in thread
From: Nilesh Javali @ 2022-08-26 10:25 UTC (permalink / raw)
  To: martin.petersen
  Cc: linux-scsi, GR-QLogic-Storage-Upstream, bhazarika, agurumurthy

Martin,

Please apply the qla2xxx driver features to the scsi tree
at your earliest convenience.

v2:
- Revert and incorporate fix based on review comments for,
"qla2xxx: Fix response queue handler reading stale packets"
- Incorporate review comments for adding enhancement to driver tracing
infrastucture.

Thanks,
Nilesh

Anil Gurumurthy (1):
  qla2xxx: Add NVMe parameters support in Auxiliary Image Status

Arun Easi (4):
  Revert "scsi: qla2xxx: Fix response queue handler reading stale
    packets"
  qla2xxx: Fix response queue handler reading stale packets
  qla2xxx: Add debugfs create/delete helpers
  qla2xxx: Enhance driver tracing with separate tunable and more

Nilesh Javali (2):
  qla2xxx: define static symbols
  qla2xxx: Update version to 10.02.07.900-k

 drivers/scsi/qla2xxx/qla_bsg.c     |  8 ++-
 drivers/scsi/qla2xxx/qla_bsg.h     |  3 +-
 drivers/scsi/qla2xxx/qla_dbg.c     | 50 +++++++++++-----
 drivers/scsi/qla2xxx/qla_dbg.h     | 43 ++++++++++++++
 drivers/scsi/qla2xxx/qla_def.h     |  7 +++
 drivers/scsi/qla2xxx/qla_dfs.c     | 93 ++++++++++++++++++++++++++++++
 drivers/scsi/qla2xxx/qla_fw.h      |  3 +
 drivers/scsi/qla2xxx/qla_gbl.h     |  3 +-
 drivers/scsi/qla2xxx/qla_init.c    |  8 ++-
 drivers/scsi/qla2xxx/qla_isr.c     | 22 +++----
 drivers/scsi/qla2xxx/qla_os.c      | 47 +++++++++++----
 drivers/scsi/qla2xxx/qla_version.h |  4 +-
 12 files changed, 242 insertions(+), 49 deletions(-)


base-commit: d957e7ffb2c72410bcc1a514153a46719255a5da
-- 
2.19.0.rc0


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

* [PATCH v2 1/7] Revert "scsi: qla2xxx: Fix response queue handler reading stale packets"
  2022-08-26 10:25 [PATCH v2 0/7] qla2xxx driver features Nilesh Javali
@ 2022-08-26 10:25 ` Nilesh Javali
  2022-08-29 16:09   ` Himanshu Madhani
  2022-08-26 10:25 ` [PATCH v2 2/7] qla2xxx: Fix response queue handler reading stale packets Nilesh Javali
                   ` (6 subsequent siblings)
  7 siblings, 1 reply; 23+ messages in thread
From: Nilesh Javali @ 2022-08-26 10:25 UTC (permalink / raw)
  To: martin.petersen
  Cc: linux-scsi, GR-QLogic-Storage-Upstream, bhazarika, agurumurthy

From: Arun Easi <aeasi@marvell.com>

Reverting this patch so that a fixed up patch, without adding new module
parameters, could be submitted.

    Link: https://lore.kernel.org/stable/166039743723771@kroah.com/

This reverts commit b1f707146923335849fb70237eec27d4d1ae7d62.

Cc: stable@vger.kernel.org
Signed-off-by: Arun Easi <aeasi@marvell.com>
Signed-off-by: Nilesh Javali <njavali@marvell.com>
---
 drivers/scsi/qla2xxx/qla_gbl.h |  2 --
 drivers/scsi/qla2xxx/qla_isr.c | 25 ++-----------------------
 drivers/scsi/qla2xxx/qla_os.c  | 10 ----------
 3 files changed, 2 insertions(+), 35 deletions(-)

diff --git a/drivers/scsi/qla2xxx/qla_gbl.h b/drivers/scsi/qla2xxx/qla_gbl.h
index 5dd2932382ee..bb69fa8b956a 100644
--- a/drivers/scsi/qla2xxx/qla_gbl.h
+++ b/drivers/scsi/qla2xxx/qla_gbl.h
@@ -193,8 +193,6 @@ extern int ql2xsecenable;
 extern int ql2xenforce_iocb_limit;
 extern int ql2xabts_wait_nvme;
 extern u32 ql2xnvme_queues;
-extern int ql2xrspq_follow_inptr;
-extern int ql2xrspq_follow_inptr_legacy;
 
 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_isr.c b/drivers/scsi/qla2xxx/qla_isr.c
index 76e79f350a22..ede76357ccb6 100644
--- a/drivers/scsi/qla2xxx/qla_isr.c
+++ b/drivers/scsi/qla2xxx/qla_isr.c
@@ -3763,8 +3763,7 @@ void qla24xx_process_response_queue(struct scsi_qla_host *vha,
 	struct qla_hw_data *ha = vha->hw;
 	struct purex_entry_24xx *purex_entry;
 	struct purex_item *pure_item;
-	u16 rsp_in = 0, cur_ring_index;
-	int follow_inptr, is_shadow_hba;
+	u16 cur_ring_index;
 
 	if (!ha->flags.fw_started)
 		return;
@@ -3774,25 +3773,7 @@ void qla24xx_process_response_queue(struct scsi_qla_host *vha,
 		qla_cpu_update(rsp->qpair, smp_processor_id());
 	}
 
-#define __update_rsp_in(_update, _is_shadow_hba, _rsp, _rsp_in)		\
-	do {								\
-		if (_update) {						\
-			_rsp_in = _is_shadow_hba ? *(_rsp)->in_ptr :	\
-				rd_reg_dword_relaxed((_rsp)->rsp_q_in);	\
-		}							\
-	} while (0)
-
-	is_shadow_hba = IS_SHADOW_REG_CAPABLE(ha);
-	follow_inptr = is_shadow_hba ? ql2xrspq_follow_inptr :
-				ql2xrspq_follow_inptr_legacy;
-
-	__update_rsp_in(follow_inptr, is_shadow_hba, rsp, rsp_in);
-
-	while ((likely(follow_inptr &&
-		       rsp->ring_index != rsp_in &&
-		       rsp->ring_ptr->signature != RESPONSE_PROCESSED)) ||
-		       (!follow_inptr &&
-			rsp->ring_ptr->signature != RESPONSE_PROCESSED)) {
+	while (rsp->ring_ptr->signature != RESPONSE_PROCESSED) {
 		pkt = (struct sts_entry_24xx *)rsp->ring_ptr;
 		cur_ring_index = rsp->ring_index;
 
@@ -3906,8 +3887,6 @@ void qla24xx_process_response_queue(struct scsi_qla_host *vha,
 				}
 				pure_item = qla27xx_copy_fpin_pkt(vha,
 							  (void **)&pkt, &rsp);
-				__update_rsp_in(follow_inptr, is_shadow_hba,
-						rsp, rsp_in);
 				if (!pure_item)
 					break;
 				qla24xx_queue_purex_item(vha, pure_item,
diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c
index 0bd0fd1042df..1c7fb6484db2 100644
--- a/drivers/scsi/qla2xxx/qla_os.c
+++ b/drivers/scsi/qla2xxx/qla_os.c
@@ -338,16 +338,6 @@ module_param(ql2xdelay_before_pci_error_handling, uint, 0644);
 MODULE_PARM_DESC(ql2xdelay_before_pci_error_handling,
 	"Number of seconds delayed before qla begin PCI error self-handling (default: 5).\n");
 
-int ql2xrspq_follow_inptr = 1;
-module_param(ql2xrspq_follow_inptr, int, 0644);
-MODULE_PARM_DESC(ql2xrspq_follow_inptr,
-		 "Follow RSP IN pointer for RSP updates for HBAs 27xx and newer (default: 1).");
-
-int ql2xrspq_follow_inptr_legacy = 1;
-module_param(ql2xrspq_follow_inptr_legacy, int, 0644);
-MODULE_PARM_DESC(ql2xrspq_follow_inptr_legacy,
-		 "Follow RSP IN pointer for RSP updates for HBAs older than 27XX. (default: 1).");
-
 static void qla2x00_clear_drv_active(struct qla_hw_data *);
 static void qla2x00_free_device(scsi_qla_host_t *);
 static int qla2xxx_map_queues(struct Scsi_Host *shost);
-- 
2.19.0.rc0


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

* [PATCH v2 2/7] qla2xxx: Fix response queue handler reading stale packets
  2022-08-26 10:25 [PATCH v2 0/7] qla2xxx driver features Nilesh Javali
  2022-08-26 10:25 ` [PATCH v2 1/7] Revert "scsi: qla2xxx: Fix response queue handler reading stale packets" Nilesh Javali
@ 2022-08-26 10:25 ` Nilesh Javali
  2022-08-29 16:10   ` Himanshu Madhani
  2022-08-26 10:25 ` [PATCH v2 3/7] qla2xxx: Add debugfs create/delete helpers Nilesh Javali
                   ` (5 subsequent siblings)
  7 siblings, 1 reply; 23+ messages in thread
From: Nilesh Javali @ 2022-08-26 10:25 UTC (permalink / raw)
  To: martin.petersen
  Cc: linux-scsi, GR-QLogic-Storage-Upstream, bhazarika, agurumurthy

From: Arun Easi <aeasi@marvell.com>

On some platforms, the current logic of relying on finding new packet
solely based on signature pattern can lead to driver reading stale
packets. Though this is a bug in those platforms, reduce such exposures by
limiting reading packets until the IN pointer.

Cc: stable@vger.kernel.org
Signed-off-by: Arun Easi <aeasi@marvell.com>
Signed-off-by: Nilesh Javali <njavali@marvell.com>
---
 drivers/scsi/qla2xxx/qla_isr.c | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/qla2xxx/qla_isr.c b/drivers/scsi/qla2xxx/qla_isr.c
index ede76357ccb6..e19fde304e5c 100644
--- a/drivers/scsi/qla2xxx/qla_isr.c
+++ b/drivers/scsi/qla2xxx/qla_isr.c
@@ -3763,7 +3763,8 @@ void qla24xx_process_response_queue(struct scsi_qla_host *vha,
 	struct qla_hw_data *ha = vha->hw;
 	struct purex_entry_24xx *purex_entry;
 	struct purex_item *pure_item;
-	u16 cur_ring_index;
+	u16 rsp_in = 0, cur_ring_index;
+	int is_shadow_hba;
 
 	if (!ha->flags.fw_started)
 		return;
@@ -3773,7 +3774,18 @@ void qla24xx_process_response_queue(struct scsi_qla_host *vha,
 		qla_cpu_update(rsp->qpair, smp_processor_id());
 	}
 
-	while (rsp->ring_ptr->signature != RESPONSE_PROCESSED) {
+#define __update_rsp_in(_is_shadow_hba, _rsp, _rsp_in)			\
+	do {								\
+		_rsp_in = _is_shadow_hba ? *(_rsp)->in_ptr :		\
+				rd_reg_dword_relaxed((_rsp)->rsp_q_in);	\
+	} while (0)
+
+	is_shadow_hba = IS_SHADOW_REG_CAPABLE(ha);
+
+	__update_rsp_in(is_shadow_hba, rsp, rsp_in);
+
+	while (rsp->ring_index != rsp_in &&
+		       rsp->ring_ptr->signature != RESPONSE_PROCESSED) {
 		pkt = (struct sts_entry_24xx *)rsp->ring_ptr;
 		cur_ring_index = rsp->ring_index;
 
@@ -3887,6 +3899,7 @@ void qla24xx_process_response_queue(struct scsi_qla_host *vha,
 				}
 				pure_item = qla27xx_copy_fpin_pkt(vha,
 							  (void **)&pkt, &rsp);
+				__update_rsp_in(is_shadow_hba, rsp, rsp_in);
 				if (!pure_item)
 					break;
 				qla24xx_queue_purex_item(vha, pure_item,
-- 
2.19.0.rc0


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

* [PATCH v2 3/7] qla2xxx: Add debugfs create/delete helpers
  2022-08-26 10:25 [PATCH v2 0/7] qla2xxx driver features Nilesh Javali
  2022-08-26 10:25 ` [PATCH v2 1/7] Revert "scsi: qla2xxx: Fix response queue handler reading stale packets" Nilesh Javali
  2022-08-26 10:25 ` [PATCH v2 2/7] qla2xxx: Fix response queue handler reading stale packets Nilesh Javali
@ 2022-08-26 10:25 ` Nilesh Javali
  2022-08-29 16:10   ` Himanshu Madhani
  2022-08-26 10:25 ` [PATCH v2 4/7] qla2xxx: Add NVMe parameters support in Auxiliary Image Status Nilesh Javali
                   ` (4 subsequent siblings)
  7 siblings, 1 reply; 23+ messages in thread
From: Nilesh Javali @ 2022-08-26 10:25 UTC (permalink / raw)
  To: martin.petersen
  Cc: linux-scsi, GR-QLogic-Storage-Upstream, bhazarika, agurumurthy

From: Arun Easi <aeasi@marvell.com>

Define a few helpful macros for creating debugfs files.

Signed-off-by: Arun Easi <aeasi@marvell.com>
Signed-off-by: Nilesh Javali <njavali@marvell.com>
---
 drivers/scsi/qla2xxx/qla_def.h |  5 ++
 drivers/scsi/qla2xxx/qla_dfs.c | 93 ++++++++++++++++++++++++++++++++++
 2 files changed, 98 insertions(+)

diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h
index 3ec6a200942e..22274b405d01 100644
--- a/drivers/scsi/qla2xxx/qla_def.h
+++ b/drivers/scsi/qla2xxx/qla_def.h
@@ -35,6 +35,11 @@
 
 #include <uapi/scsi/fc/fc_els.h>
 
+#define QLA_DFS_DEFINE_DENTRY(_debugfs_file_name) \
+	struct dentry *dfs_##_debugfs_file_name
+#define QLA_DFS_ROOT_DEFINE_DENTRY(_debugfs_file_name) \
+	struct dentry *qla_dfs_##_debugfs_file_name
+
 /* Big endian Fibre Channel S_ID (source ID) or D_ID (destination ID). */
 typedef struct {
 	uint8_t domain;
diff --git a/drivers/scsi/qla2xxx/qla_dfs.c b/drivers/scsi/qla2xxx/qla_dfs.c
index 85bd0e468d43..777808af5634 100644
--- a/drivers/scsi/qla2xxx/qla_dfs.c
+++ b/drivers/scsi/qla2xxx/qla_dfs.c
@@ -489,6 +489,99 @@ qla_dfs_naqp_show(struct seq_file *s, void *unused)
 	return 0;
 }
 
+/*
+ * Helper macros for setting up debugfs entries.
+ * _name: The name of the debugfs entry
+ * _ctx_struct: The context that was passed when creating the debugfs file
+ *
+ * QLA_DFS_SETUP_RD could be used when there is only a show function.
+ * - show function take the name qla_dfs_<sysfs-name>_show
+ *
+ * QLA_DFS_SETUP_RW could be used when there are both show and write functions.
+ * - show function take the name  qla_dfs_<sysfs-name>_show
+ * - write function take the name qla_dfs_<sysfs-name>_write
+ *
+ * To have a new debugfs entry, do:
+ * 1. Create a "struct dentry *" in the appropriate structure in the format
+ * dfs_<sysfs-name>
+ * 2. Setup debugfs entries using QLA_DFS_SETUP_RD / QLA_DFS_SETUP_RW
+ * 3. Create debugfs file in qla2x00_dfs_setup() using QLA_DFS_CREATE_FILE
+ * or QLA_DFS_ROOT_CREATE_FILE
+ * 4. Remove debugfs file in qla2x00_dfs_remove() using QLA_DFS_REMOVE_FILE
+ * or QLA_DFS_ROOT_REMOVE_FILE
+ *
+ * Example for creating "TEST" sysfs file:
+ * 1. struct qla_hw_data { ... struct dentry *dfs_TEST; }
+ * 2. QLA_DFS_SETUP_RD(TEST, scsi_qla_host_t);
+ * 3. In qla2x00_dfs_setup():
+ * QLA_DFS_CREATE_FILE(ha, TEST, 0600, ha->dfs_dir, vha);
+ * 4. In qla2x00_dfs_remove():
+ * QLA_DFS_REMOVE_FILE(ha, TEST);
+ */
+#define QLA_DFS_SETUP_RD(_name, _ctx_struct)				\
+static int								\
+qla_dfs_##_name##_open(struct inode *inode, struct file *file)		\
+{									\
+	_ctx_struct *__ctx = inode->i_private;				\
+									\
+	return single_open(file, qla_dfs_##_name##_show, __ctx);	\
+}									\
+									\
+static const struct file_operations qla_dfs_##_name##_ops = {		\
+	.open           = qla_dfs_##_name##_open,			\
+	.read           = seq_read,					\
+	.llseek         = seq_lseek,					\
+	.release        = single_release,				\
+};
+
+#define QLA_DFS_SETUP_RW(_name, _ctx_struct)				\
+static int								\
+qla_dfs_##_name##_open(struct inode *inode, struct file *file)		\
+{									\
+	_ctx_struct *__ctx = inode->i_private;				\
+									\
+	return single_open(file, qla_dfs_##_name##_show, __ctx);	\
+}									\
+									\
+static const struct file_operations qla_dfs_##_name##_ops = {		\
+	.open           = qla_dfs_##_name##_open,			\
+	.read           = seq_read,					\
+	.llseek         = seq_lseek,					\
+	.release        = single_release,				\
+	.write		= qla_dfs_##_name##_write,			\
+};
+
+#define QLA_DFS_ROOT_CREATE_FILE(_name, _perm, _ctx)			\
+	do {								\
+		if (!qla_dfs_##_name)					\
+			qla_dfs_##_name = debugfs_create_file(#_name,	\
+					_perm, qla2x00_dfs_root, _ctx,	\
+					&qla_dfs_##_name##_ops);	\
+	} while (0)
+
+#define QLA_DFS_ROOT_REMOVE_FILE(_name)					\
+	do {								\
+		if (qla_dfs_##_name) {					\
+			debugfs_remove(qla_dfs_##_name);		\
+			qla_dfs_##_name = NULL;				\
+		}							\
+	} while (0)
+
+#define QLA_DFS_CREATE_FILE(_struct, _name, _perm, _parent, _ctx)	\
+	do {								\
+		(_struct)->dfs_##_name = debugfs_create_file(#_name,	\
+					_perm, _parent, _ctx,		\
+					&qla_dfs_##_name##_ops)		\
+	} while (0)
+
+#define QLA_DFS_REMOVE_FILE(_struct, _name)				\
+	do {								\
+		if ((_struct)->dfs_##_name) {				\
+			debugfs_remove((_struct)->dfs_##_name);		\
+			(_struct)->dfs_##_name = NULL;			\
+		}							\
+	} while (0)
+
 static int
 qla_dfs_naqp_open(struct inode *inode, struct file *file)
 {
-- 
2.19.0.rc0


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

* [PATCH v2 4/7] qla2xxx: Add NVMe parameters support in Auxiliary Image Status
  2022-08-26 10:25 [PATCH v2 0/7] qla2xxx driver features Nilesh Javali
                   ` (2 preceding siblings ...)
  2022-08-26 10:25 ` [PATCH v2 3/7] qla2xxx: Add debugfs create/delete helpers Nilesh Javali
@ 2022-08-26 10:25 ` Nilesh Javali
  2022-08-29 16:15   ` Himanshu Madhani
  2022-08-26 10:25 ` [PATCH v2 5/7] qla2xxx: Enhance driver tracing with separate tunable and more Nilesh Javali
                   ` (3 subsequent siblings)
  7 siblings, 1 reply; 23+ messages in thread
From: Nilesh Javali @ 2022-08-26 10:25 UTC (permalink / raw)
  To: martin.petersen
  Cc: linux-scsi, GR-QLogic-Storage-Upstream, bhazarika, agurumurthy

From: Anil Gurumurthy <agurumurthy@marvell.com>

Add new API to obtain the NVMe Parameters region status from the
Auxiliary Image Status bitmap.

Signed-off-by: Anil Gurumurthy <agurumurthy@marvell.com>
Signed-off-by: Nilesh Javali <njavali@marvell.com>
---
 drivers/scsi/qla2xxx/qla_bsg.c  | 8 ++++++--
 drivers/scsi/qla2xxx/qla_bsg.h  | 3 ++-
 drivers/scsi/qla2xxx/qla_def.h  | 2 ++
 drivers/scsi/qla2xxx/qla_fw.h   | 3 +++
 drivers/scsi/qla2xxx/qla_init.c | 8 ++++++--
 5 files changed, 19 insertions(+), 5 deletions(-)

diff --git a/drivers/scsi/qla2xxx/qla_bsg.c b/drivers/scsi/qla2xxx/qla_bsg.c
index 5db9bf69dcff..cd75b179410d 100644
--- a/drivers/scsi/qla2xxx/qla_bsg.c
+++ b/drivers/scsi/qla2xxx/qla_bsg.c
@@ -2519,19 +2519,23 @@ qla2x00_get_flash_image_status(struct bsg_job *bsg_job)
 	qla27xx_get_active_image(vha, &active_regions);
 	regions.global_image = active_regions.global;
 
+	if (IS_QLA27XX(ha))
+		regions.nvme_params = QLA27XX_PRIMARY_IMAGE;
+
 	if (IS_QLA28XX(ha)) {
 		qla28xx_get_aux_images(vha, &active_regions);
 		regions.board_config = active_regions.aux.board_config;
 		regions.vpd_nvram = active_regions.aux.vpd_nvram;
 		regions.npiv_config_0_1 = active_regions.aux.npiv_config_0_1;
 		regions.npiv_config_2_3 = active_regions.aux.npiv_config_2_3;
+		regions.nvme_params = active_regions.aux.nvme_params;
 	}
 
 	ql_dbg(ql_dbg_user, vha, 0x70e1,
-	    "%s(%lu): FW=%u BCFG=%u VPDNVR=%u NPIV01=%u NPIV02=%u\n",
+	    "%s(%lu): FW=%u BCFG=%u VPDNVR=%u NPIV01=%u NPIV02=%u NVME_PARAMS=%u\n",
 	    __func__, vha->host_no, regions.global_image,
 	    regions.board_config, regions.vpd_nvram,
-	    regions.npiv_config_0_1, regions.npiv_config_2_3);
+	    regions.npiv_config_0_1, regions.npiv_config_2_3, regions.nvme_params);
 
 	sg_copy_from_buffer(bsg_job->reply_payload.sg_list,
 	    bsg_job->reply_payload.sg_cnt, &regions, sizeof(regions));
diff --git a/drivers/scsi/qla2xxx/qla_bsg.h b/drivers/scsi/qla2xxx/qla_bsg.h
index bb64b9c5a74b..d38dab0a07e8 100644
--- a/drivers/scsi/qla2xxx/qla_bsg.h
+++ b/drivers/scsi/qla2xxx/qla_bsg.h
@@ -314,7 +314,8 @@ struct qla_active_regions {
 	uint8_t vpd_nvram;
 	uint8_t npiv_config_0_1;
 	uint8_t npiv_config_2_3;
-	uint8_t reserved[32];
+	uint8_t nvme_params;
+	uint8_t reserved[31];
 } __packed;
 
 #include "qla_edif_bsg.h"
diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h
index 22274b405d01..802eec6407d9 100644
--- a/drivers/scsi/qla2xxx/qla_def.h
+++ b/drivers/scsi/qla2xxx/qla_def.h
@@ -4773,6 +4773,7 @@ struct active_regions {
 		uint8_t vpd_nvram;
 		uint8_t npiv_config_0_1;
 		uint8_t npiv_config_2_3;
+		uint8_t nvme_params;
 	} aux;
 };
 
@@ -5057,6 +5058,7 @@ struct qla27xx_image_status {
 #define QLA28XX_AUX_IMG_VPD_NVRAM		BIT_1
 #define QLA28XX_AUX_IMG_NPIV_CONFIG_0_1		BIT_2
 #define QLA28XX_AUX_IMG_NPIV_CONFIG_2_3		BIT_3
+#define QLA28XX_AUX_IMG_NVME_PARAMS		BIT_4
 
 #define SET_VP_IDX	1
 #define SET_AL_PA	2
diff --git a/drivers/scsi/qla2xxx/qla_fw.h b/drivers/scsi/qla2xxx/qla_fw.h
index 361015b5763e..f307beed9d29 100644
--- a/drivers/scsi/qla2xxx/qla_fw.h
+++ b/drivers/scsi/qla2xxx/qla_fw.h
@@ -1675,6 +1675,7 @@ struct qla_flt_location {
 #define FLT_REG_VPD_SEC_27XX_1	0x52
 #define FLT_REG_VPD_SEC_27XX_2	0xD8
 #define FLT_REG_VPD_SEC_27XX_3	0xDA
+#define FLT_REG_NVME_PARAMS_27XX	0x21
 
 /* 28xx */
 #define FLT_REG_AUX_IMG_PRI_28XX	0x125
@@ -1691,6 +1692,8 @@ struct qla_flt_location {
 #define FLT_REG_MPI_SEC_28XX		0xF0
 #define FLT_REG_PEP_PRI_28XX		0xD1
 #define FLT_REG_PEP_SEC_28XX		0xF1
+#define FLT_REG_NVME_PARAMS_PRI_28XX	0x14E
+#define FLT_REG_NVME_PARAMS_SEC_28XX	0x179
 
 struct qla_flt_region {
 	__le16	code;
diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c
index e7fe0e52c11d..e12db95de688 100644
--- a/drivers/scsi/qla2xxx/qla_init.c
+++ b/drivers/scsi/qla2xxx/qla_init.c
@@ -7933,6 +7933,9 @@ qla28xx_component_status(
 
 	active_regions->aux.npiv_config_2_3 =
 	    qla28xx_component_bitmask(aux, QLA28XX_AUX_IMG_NPIV_CONFIG_2_3);
+
+	active_regions->aux.nvme_params =
+	    qla28xx_component_bitmask(aux, QLA28XX_AUX_IMG_NVME_PARAMS);
 }
 
 static int
@@ -8041,11 +8044,12 @@ qla28xx_get_aux_images(
 	}
 
 	ql_dbg(ql_dbg_init, vha, 0x018f,
-	    "aux images active: BCFG=%u VPD/NVR=%u NPIV0/1=%u NPIV2/3=%u\n",
+	    "aux images active: BCFG=%u VPD/NVR=%u NPIV0/1=%u NPIV2/3=%u, NVME=%u\n",
 	    active_regions->aux.board_config,
 	    active_regions->aux.vpd_nvram,
 	    active_regions->aux.npiv_config_0_1,
-	    active_regions->aux.npiv_config_2_3);
+	    active_regions->aux.npiv_config_2_3,
+	    active_regions->aux.nvme_params);
 }
 
 void
-- 
2.19.0.rc0


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

* [PATCH v2 5/7] qla2xxx: Enhance driver tracing with separate tunable and more
  2022-08-26 10:25 [PATCH v2 0/7] qla2xxx driver features Nilesh Javali
                   ` (3 preceding siblings ...)
  2022-08-26 10:25 ` [PATCH v2 4/7] qla2xxx: Add NVMe parameters support in Auxiliary Image Status Nilesh Javali
@ 2022-08-26 10:25 ` Nilesh Javali
  2022-08-29 16:24   ` Himanshu Madhani
                     ` (2 more replies)
  2022-08-26 10:25 ` [PATCH v2 6/7] qla2xxx: define static symbols Nilesh Javali
                   ` (2 subsequent siblings)
  7 siblings, 3 replies; 23+ messages in thread
From: Nilesh Javali @ 2022-08-26 10:25 UTC (permalink / raw)
  To: martin.petersen
  Cc: linux-scsi, GR-QLogic-Storage-Upstream, bhazarika, agurumurthy

From: Arun Easi <aeasi@marvell.com>

Older tracing of driver messages was to:
    - log only debug messages to kernel main trace buffer AND
    - log only if extended logging bits corresponding to this
      message is off

This has been modified and extended as follows:
    - Tracing is now controlled via ql2xextended_error_logging_ktrace
      module parameter. Bit usages same as ql2xextended_error_logging.
    - Tracing uses "qla2xxx" trace instance, unless instance creation
      have issues.
    - Tracing is enabled (compile time tunable).
    - All driver messages, include debug and log messages are now traced
      in kernel trace buffer.

Trace messages can be viewed by looking at the qla2xxx instance at:
    /sys/kernel/tracing/instances/qla2xxx/trace

Trace tunable that takes the same bit mask as ql2xextended_error_logging
is:
    ql2xextended_error_logging_ktrace (default=1)

Suggested-by: Daniel Wagner <dwagner@suse.de>
Suggested-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Arun Easi <aeasi@marvell.com>
Signed-off-by: Nilesh Javali <njavali@marvell.com>
---
 drivers/scsi/qla2xxx/qla_dbg.c | 50 ++++++++++++++++++++++++----------
 drivers/scsi/qla2xxx/qla_dbg.h | 43 +++++++++++++++++++++++++++++
 drivers/scsi/qla2xxx/qla_gbl.h |  1 +
 drivers/scsi/qla2xxx/qla_os.c  | 35 ++++++++++++++++++++++++
 4 files changed, 115 insertions(+), 14 deletions(-)

diff --git a/drivers/scsi/qla2xxx/qla_dbg.c b/drivers/scsi/qla2xxx/qla_dbg.c
index 7cf1f78cbaee..d7e8454304ce 100644
--- a/drivers/scsi/qla2xxx/qla_dbg.c
+++ b/drivers/scsi/qla2xxx/qla_dbg.c
@@ -2455,7 +2455,7 @@ qla83xx_fw_dump(scsi_qla_host_t *vha)
 /****************************************************************************/
 
 /* Write the debug message prefix into @pbuf. */
-static void ql_dbg_prefix(char *pbuf, int pbuf_size,
+static void ql_dbg_prefix(char *pbuf, int pbuf_size, struct pci_dev *pdev,
 			  const scsi_qla_host_t *vha, uint msg_id)
 {
 	if (vha) {
@@ -2464,6 +2464,9 @@ static void ql_dbg_prefix(char *pbuf, int pbuf_size,
 		/* <module-name> [<dev-name>]-<msg-id>:<host>: */
 		snprintf(pbuf, pbuf_size, "%s [%s]-%04x:%lu: ", QL_MSGHDR,
 			 dev_name(&(pdev->dev)), msg_id, vha->host_no);
+	} else if (pdev) {
+		snprintf(pbuf, pbuf_size, "%s [%s]-%04x: : ", QL_MSGHDR,
+			 dev_name(&pdev->dev), msg_id);
 	} else {
 		/* <module-name> [<dev-name>]-<msg-id>: : */
 		snprintf(pbuf, pbuf_size, "%s [%s]-%04x: : ", QL_MSGHDR,
@@ -2491,20 +2494,20 @@ ql_dbg(uint level, scsi_qla_host_t *vha, uint id, const char *fmt, ...)
 	struct va_format vaf;
 	char pbuf[64];
 
-	if (!ql_mask_match(level) && !trace_ql_dbg_log_enabled())
+	ql_ktrace(1, level, pbuf, NULL, vha, id, fmt);
+
+	if (!ql_mask_match(level))
 		return;
 
+	if (!pbuf[0]) /* set by ql_ktrace */
+		ql_dbg_prefix(pbuf, ARRAY_SIZE(pbuf), NULL, vha, id);
+
 	va_start(va, fmt);
 
 	vaf.fmt = fmt;
 	vaf.va = &va;
 
-	ql_dbg_prefix(pbuf, ARRAY_SIZE(pbuf), vha, id);
-
-	if (!ql_mask_match(level))
-		trace_ql_dbg_log(pbuf, &vaf);
-	else
-		pr_warn("%s%pV", pbuf, &vaf);
+	pr_warn("%s%pV", pbuf, &vaf);
 
 	va_end(va);
 
@@ -2533,6 +2536,9 @@ ql_dbg_pci(uint level, struct pci_dev *pdev, uint id, const char *fmt, ...)
 
 	if (pdev == NULL)
 		return;
+
+	ql_ktrace(1, level, pbuf, pdev, NULL, id, fmt);
+
 	if (!ql_mask_match(level))
 		return;
 
@@ -2541,7 +2547,9 @@ ql_dbg_pci(uint level, struct pci_dev *pdev, uint id, const char *fmt, ...)
 	vaf.fmt = fmt;
 	vaf.va = &va;
 
-	ql_dbg_prefix(pbuf, ARRAY_SIZE(pbuf), NULL, id + ql_dbg_offset);
+	if (!pbuf[0]) /* set by ql_ktrace */
+		ql_dbg_prefix(pbuf, ARRAY_SIZE(pbuf), pdev, NULL,
+			      id + ql_dbg_offset);
 	pr_warn("%s%pV", pbuf, &vaf);
 
 	va_end(va);
@@ -2570,7 +2578,10 @@ ql_log(uint level, scsi_qla_host_t *vha, uint id, const char *fmt, ...)
 	if (level > ql_errlev)
 		return;
 
-	ql_dbg_prefix(pbuf, ARRAY_SIZE(pbuf), vha, id);
+	ql_ktrace(0, level, pbuf, NULL, vha, id, fmt);
+
+	if (!pbuf[0]) /* set by ql_ktrace */
+		ql_dbg_prefix(pbuf, ARRAY_SIZE(pbuf), NULL, vha, id);
 
 	va_start(va, fmt);
 
@@ -2621,7 +2632,10 @@ ql_log_pci(uint level, struct pci_dev *pdev, uint id, const char *fmt, ...)
 	if (level > ql_errlev)
 		return;
 
-	ql_dbg_prefix(pbuf, ARRAY_SIZE(pbuf), NULL, id);
+	ql_ktrace(0, level, pbuf, pdev, NULL, id, fmt);
+
+	if (!pbuf[0]) /* set by ql_ktrace */
+		ql_dbg_prefix(pbuf, ARRAY_SIZE(pbuf), pdev, NULL, id);
 
 	va_start(va, fmt);
 
@@ -2716,7 +2730,11 @@ ql_log_qp(uint32_t level, struct qla_qpair *qpair, int32_t id,
 	if (level > ql_errlev)
 		return;
 
-	ql_dbg_prefix(pbuf, ARRAY_SIZE(pbuf), qpair ? qpair->vha : NULL, id);
+	ql_ktrace(0, level, pbuf, NULL, qpair ? qpair->vha : NULL, id, fmt);
+
+	if (!pbuf[0]) /* set by ql_ktrace */
+		ql_dbg_prefix(pbuf, ARRAY_SIZE(pbuf), NULL,
+			      qpair ? qpair->vha : NULL, id);
 
 	va_start(va, fmt);
 
@@ -2762,6 +2780,8 @@ ql_dbg_qp(uint32_t level, struct qla_qpair *qpair, int32_t id,
 	struct va_format vaf;
 	char pbuf[128];
 
+	ql_ktrace(1, level, pbuf, NULL, qpair ? qpair->vha : NULL, id, fmt);
+
 	if (!ql_mask_match(level))
 		return;
 
@@ -2770,8 +2790,10 @@ ql_dbg_qp(uint32_t level, struct qla_qpair *qpair, int32_t id,
 	vaf.fmt = fmt;
 	vaf.va = &va;
 
-	ql_dbg_prefix(pbuf, ARRAY_SIZE(pbuf), qpair ? qpair->vha : NULL,
-		      id + ql_dbg_offset);
+	if (!pbuf[0]) /* set by ql_ktrace */
+		ql_dbg_prefix(pbuf, ARRAY_SIZE(pbuf), NULL,
+			      qpair ? qpair->vha : NULL, id + ql_dbg_offset);
+
 	pr_warn("%s%pV", pbuf, &vaf);
 
 	va_end(va);
diff --git a/drivers/scsi/qla2xxx/qla_dbg.h b/drivers/scsi/qla2xxx/qla_dbg.h
index feeb1666227f..70482b55d240 100644
--- a/drivers/scsi/qla2xxx/qla_dbg.h
+++ b/drivers/scsi/qla2xxx/qla_dbg.h
@@ -385,3 +385,46 @@ ql_mask_match(uint level)
 
 	return level && ((level & ql2xextended_error_logging) == level);
 }
+
+static inline int
+ql_mask_match_ext(uint level, int *log_tunable)
+{
+	if (*log_tunable == 1)
+		*log_tunable = QL_DBG_DEFAULT1_MASK;
+
+	return (level & *log_tunable) == level;
+}
+
+/* Assumes local variable pbuf and pbuf_ready present. */
+#define ql_ktrace(dbg_msg, level, pbuf, pdev, vha, id, fmt) do {	\
+	struct va_format _vaf;						\
+	va_list _va;							\
+	u32 dbg_off = dbg_msg ? ql_dbg_offset : 0;			\
+									\
+	pbuf[0] = 0;							\
+	if (!trace_ql_dbg_log_enabled())				\
+		break;							\
+									\
+	if (dbg_msg && !ql_mask_match_ext(level,			\
+				&ql2xextended_error_logging_ktrace))	\
+		break;							\
+									\
+	ql_dbg_prefix(pbuf, ARRAY_SIZE(pbuf), pdev, vha, id + dbg_off);	\
+									\
+	va_start(_va, fmt);						\
+	_vaf.fmt = fmt;							\
+	_vaf.va = &_va;							\
+									\
+	trace_ql_dbg_log(pbuf, &_vaf);					\
+									\
+	va_end(_va);							\
+} while (0)
+
+#define QLA_ENABLE_KERNEL_TRACING
+
+#ifdef QLA_ENABLE_KERNEL_TRACING
+#define QLA_TRACE_ENABLE(_tr) \
+	trace_array_set_clr_event(_tr, "qla", NULL, true)
+#else /* QLA_ENABLE_KERNEL_TRACING */
+#define QLA_TRACE_ENABLE(_tr)
+#endif /* QLA_ENABLE_KERNEL_TRACING */
diff --git a/drivers/scsi/qla2xxx/qla_gbl.h b/drivers/scsi/qla2xxx/qla_gbl.h
index bb69fa8b956a..2fc280e61306 100644
--- a/drivers/scsi/qla2xxx/qla_gbl.h
+++ b/drivers/scsi/qla2xxx/qla_gbl.h
@@ -163,6 +163,7 @@ extern int ql2xrdpenable;
 extern int ql2xsmartsan;
 extern int ql2xallocfwdump;
 extern int ql2xextended_error_logging;
+extern int ql2xextended_error_logging_ktrace;
 extern int ql2xiidmaenable;
 extern int ql2xmqsupport;
 extern int ql2xfwloadbin;
diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c
index 1c7fb6484db2..4a55c1e81327 100644
--- a/drivers/scsi/qla2xxx/qla_os.c
+++ b/drivers/scsi/qla2xxx/qla_os.c
@@ -15,6 +15,8 @@
 #include <linux/blk-mq-pci.h>
 #include <linux/refcount.h>
 #include <linux/crash_dump.h>
+#include <linux/trace_events.h>
+#include <linux/trace.h>
 
 #include <scsi/scsi_tcq.h>
 #include <scsi/scsicam.h>
@@ -35,6 +37,8 @@ static int apidev_major;
  */
 struct kmem_cache *srb_cachep;
 
+struct trace_array *qla_trc_array;
+
 int ql2xfulldump_on_mpifail;
 module_param(ql2xfulldump_on_mpifail, int, S_IRUGO | S_IWUSR);
 MODULE_PARM_DESC(ql2xfulldump_on_mpifail,
@@ -117,6 +121,11 @@ MODULE_PARM_DESC(ql2xextended_error_logging,
 		"ql2xextended_error_logging=1).\n"
 		"\t\tDo LOGICAL OR of the value to enable more than one level");
 
+int ql2xextended_error_logging_ktrace = 1;
+module_param(ql2xextended_error_logging_ktrace, int, S_IRUGO|S_IWUSR);
+MODULE_PARM_DESC(ql2xextended_error_logging_ktrace,
+		"Same BIT definiton as ql2xextended_error_logging, but used to control logging to kernel trace buffer (default=1).\n");
+
 int ql2xshiftctondsd = 6;
 module_param(ql2xshiftctondsd, int, S_IRUGO);
 MODULE_PARM_DESC(ql2xshiftctondsd,
@@ -2839,6 +2848,27 @@ static void qla2x00_iocb_work_fn(struct work_struct *work)
 	spin_unlock_irqrestore(&vha->work_lock, flags);
 }
 
+static void
+qla_trace_init(void)
+{
+	qla_trc_array = trace_array_get_by_name("qla2xxx");
+	if (!qla_trc_array) {
+		ql_log(ql_log_fatal, NULL, 0x0001,
+		       "Unable to create qla2xxx trace instance, instance logging will be disabled.\n");
+		return;
+	}
+
+	QLA_TRACE_ENABLE(qla_trc_array);
+}
+
+static void
+qla_trace_uninit(void)
+{
+	if (!qla_trc_array)
+		return;
+	trace_array_put(qla_trc_array);
+}
+
 /*
  * PCI driver interface
  */
@@ -8181,6 +8211,8 @@ qla2x00_module_init(void)
 	BUILD_BUG_ON(sizeof(sw_info_t) != 32);
 	BUILD_BUG_ON(sizeof(target_id_t) != 2);
 
+	qla_trace_init();
+
 	/* Allocate cache for SRBs. */
 	srb_cachep = kmem_cache_create("qla2xxx_srbs", sizeof(srb_t), 0,
 	    SLAB_HWCACHE_ALIGN, NULL);
@@ -8259,6 +8291,8 @@ qla2x00_module_init(void)
 
 destroy_cache:
 	kmem_cache_destroy(srb_cachep);
+
+	qla_trace_uninit();
 	return ret;
 }
 
@@ -8277,6 +8311,7 @@ qla2x00_module_exit(void)
 	fc_release_transport(qla2xxx_transport_template);
 	qlt_exit();
 	kmem_cache_destroy(srb_cachep);
+	qla_trace_uninit();
 }
 
 module_init(qla2x00_module_init);
-- 
2.19.0.rc0


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

* [PATCH v2 6/7] qla2xxx: define static symbols
  2022-08-26 10:25 [PATCH v2 0/7] qla2xxx driver features Nilesh Javali
                   ` (4 preceding siblings ...)
  2022-08-26 10:25 ` [PATCH v2 5/7] qla2xxx: Enhance driver tracing with separate tunable and more Nilesh Javali
@ 2022-08-26 10:25 ` Nilesh Javali
  2022-08-29 16:25   ` Himanshu Madhani
  2022-08-26 10:25 ` [PATCH v2 7/7] qla2xxx: Update version to 10.02.07.900-k Nilesh Javali
  2022-09-01  4:31 ` [PATCH v2 0/7] qla2xxx driver features Martin K. Petersen
  7 siblings, 1 reply; 23+ messages in thread
From: Nilesh Javali @ 2022-08-26 10:25 UTC (permalink / raw)
  To: martin.petersen
  Cc: linux-scsi, GR-QLogic-Storage-Upstream, bhazarika, agurumurthy

drivers/scsi/qla2xxx/qla_os.c:40:20: warning: symbol 'qla_trc_array'
was not declared. Should it be static?
drivers/scsi/qla2xxx/qla_os.c:345:5: warning: symbol
'ql2xdelay_before_pci_error_handling' was not declared.
Should it be static?

Define qla_trc_array and ql2xdelay_before_pci_error_handling
as static to fix sparse warnings.

Cc: stable@vger.kernel.org
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Nilesh Javali <njavali@marvell.com>
---
 drivers/scsi/qla2xxx/qla_os.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c
index 4a55c1e81327..46c281b55c63 100644
--- a/drivers/scsi/qla2xxx/qla_os.c
+++ b/drivers/scsi/qla2xxx/qla_os.c
@@ -37,7 +37,7 @@ static int apidev_major;
  */
 struct kmem_cache *srb_cachep;
 
-struct trace_array *qla_trc_array;
+static struct trace_array *qla_trc_array;
 
 int ql2xfulldump_on_mpifail;
 module_param(ql2xfulldump_on_mpifail, int, S_IRUGO | S_IWUSR);
@@ -342,7 +342,7 @@ MODULE_PARM_DESC(ql2xabts_wait_nvme,
 		 "To wait for ABTS response on I/O timeouts for NVMe. (default: 1)");
 
 
-u32 ql2xdelay_before_pci_error_handling = 5;
+static u32 ql2xdelay_before_pci_error_handling = 5;
 module_param(ql2xdelay_before_pci_error_handling, uint, 0644);
 MODULE_PARM_DESC(ql2xdelay_before_pci_error_handling,
 	"Number of seconds delayed before qla begin PCI error self-handling (default: 5).\n");
-- 
2.19.0.rc0


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

* [PATCH v2 7/7] qla2xxx: Update version to 10.02.07.900-k
  2022-08-26 10:25 [PATCH v2 0/7] qla2xxx driver features Nilesh Javali
                   ` (5 preceding siblings ...)
  2022-08-26 10:25 ` [PATCH v2 6/7] qla2xxx: define static symbols Nilesh Javali
@ 2022-08-26 10:25 ` Nilesh Javali
  2022-08-29 16:26   ` Himanshu Madhani
  2022-09-01  4:31 ` [PATCH v2 0/7] qla2xxx driver features Martin K. Petersen
  7 siblings, 1 reply; 23+ messages in thread
From: Nilesh Javali @ 2022-08-26 10:25 UTC (permalink / raw)
  To: martin.petersen
  Cc: linux-scsi, GR-QLogic-Storage-Upstream, bhazarika, agurumurthy

Signed-off-by: Nilesh Javali <njavali@marvell.com>
---
 drivers/scsi/qla2xxx/qla_version.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/qla2xxx/qla_version.h b/drivers/scsi/qla2xxx/qla_version.h
index f3257d46b6d2..03f3e2cd62b5 100644
--- a/drivers/scsi/qla2xxx/qla_version.h
+++ b/drivers/scsi/qla2xxx/qla_version.h
@@ -6,9 +6,9 @@
 /*
  * Driver version
  */
-#define QLA2XXX_VERSION      "10.02.07.800-k"
+#define QLA2XXX_VERSION      "10.02.07.900-k"
 
 #define QLA_DRIVER_MAJOR_VER	10
 #define QLA_DRIVER_MINOR_VER	2
 #define QLA_DRIVER_PATCH_VER	7
-#define QLA_DRIVER_BETA_VER	800
+#define QLA_DRIVER_BETA_VER	900
-- 
2.19.0.rc0


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

* Re: [PATCH v2 1/7] Revert "scsi: qla2xxx: Fix response queue handler reading stale packets"
  2022-08-26 10:25 ` [PATCH v2 1/7] Revert "scsi: qla2xxx: Fix response queue handler reading stale packets" Nilesh Javali
@ 2022-08-29 16:09   ` Himanshu Madhani
  0 siblings, 0 replies; 23+ messages in thread
From: Himanshu Madhani @ 2022-08-29 16:09 UTC (permalink / raw)
  To: Nilesh Javali
  Cc: Martin Petersen, linux-scsi, GR-QLogic-Storage-Upstream,
	bhazarika, agurumurthy



> On Aug 26, 2022, at 3:25 AM, Nilesh Javali <njavali@marvell.com> wrote:
> 
> From: Arun Easi <aeasi@marvell.com>
> 
> Reverting this patch so that a fixed up patch, without adding new module
> parameters, could be submitted.
> 
>    Link: https://lore.kernel.org/stable/166039743723771@kroah.com/
> 
> This reverts commit b1f707146923335849fb70237eec27d4d1ae7d62.
> 
> Cc: stable@vger.kernel.org
> Signed-off-by: Arun Easi <aeasi@marvell.com>
> Signed-off-by: Nilesh Javali <njavali@marvell.com>
> ---
> drivers/scsi/qla2xxx/qla_gbl.h |  2 --
> drivers/scsi/qla2xxx/qla_isr.c | 25 ++-----------------------
> drivers/scsi/qla2xxx/qla_os.c  | 10 ----------
> 3 files changed, 2 insertions(+), 35 deletions(-)
> 
> diff --git a/drivers/scsi/qla2xxx/qla_gbl.h b/drivers/scsi/qla2xxx/qla_gbl.h
> index 5dd2932382ee..bb69fa8b956a 100644
> --- a/drivers/scsi/qla2xxx/qla_gbl.h
> +++ b/drivers/scsi/qla2xxx/qla_gbl.h
> @@ -193,8 +193,6 @@ extern int ql2xsecenable;
> extern int ql2xenforce_iocb_limit;
> extern int ql2xabts_wait_nvme;
> extern u32 ql2xnvme_queues;
> -extern int ql2xrspq_follow_inptr;
> -extern int ql2xrspq_follow_inptr_legacy;
> 
> 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_isr.c b/drivers/scsi/qla2xxx/qla_isr.c
> index 76e79f350a22..ede76357ccb6 100644
> --- a/drivers/scsi/qla2xxx/qla_isr.c
> +++ b/drivers/scsi/qla2xxx/qla_isr.c
> @@ -3763,8 +3763,7 @@ void qla24xx_process_response_queue(struct scsi_qla_host *vha,
> 	struct qla_hw_data *ha = vha->hw;
> 	struct purex_entry_24xx *purex_entry;
> 	struct purex_item *pure_item;
> -	u16 rsp_in = 0, cur_ring_index;
> -	int follow_inptr, is_shadow_hba;
> +	u16 cur_ring_index;
> 
> 	if (!ha->flags.fw_started)
> 		return;
> @@ -3774,25 +3773,7 @@ void qla24xx_process_response_queue(struct scsi_qla_host *vha,
> 		qla_cpu_update(rsp->qpair, smp_processor_id());
> 	}
> 
> -#define __update_rsp_in(_update, _is_shadow_hba, _rsp, _rsp_in)		\
> -	do {								\
> -		if (_update) {						\
> -			_rsp_in = _is_shadow_hba ? *(_rsp)->in_ptr :	\
> -				rd_reg_dword_relaxed((_rsp)->rsp_q_in);	\
> -		}							\
> -	} while (0)
> -
> -	is_shadow_hba = IS_SHADOW_REG_CAPABLE(ha);
> -	follow_inptr = is_shadow_hba ? ql2xrspq_follow_inptr :
> -				ql2xrspq_follow_inptr_legacy;
> -
> -	__update_rsp_in(follow_inptr, is_shadow_hba, rsp, rsp_in);
> -
> -	while ((likely(follow_inptr &&
> -		       rsp->ring_index != rsp_in &&
> -		       rsp->ring_ptr->signature != RESPONSE_PROCESSED)) ||
> -		       (!follow_inptr &&
> -			rsp->ring_ptr->signature != RESPONSE_PROCESSED)) {
> +	while (rsp->ring_ptr->signature != RESPONSE_PROCESSED) {
> 		pkt = (struct sts_entry_24xx *)rsp->ring_ptr;
> 		cur_ring_index = rsp->ring_index;
> 
> @@ -3906,8 +3887,6 @@ void qla24xx_process_response_queue(struct scsi_qla_host *vha,
> 				}
> 				pure_item = qla27xx_copy_fpin_pkt(vha,
> 							  (void **)&pkt, &rsp);
> -				__update_rsp_in(follow_inptr, is_shadow_hba,
> -						rsp, rsp_in);
> 				if (!pure_item)
> 					break;
> 				qla24xx_queue_purex_item(vha, pure_item,
> diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c
> index 0bd0fd1042df..1c7fb6484db2 100644
> --- a/drivers/scsi/qla2xxx/qla_os.c
> +++ b/drivers/scsi/qla2xxx/qla_os.c
> @@ -338,16 +338,6 @@ module_param(ql2xdelay_before_pci_error_handling, uint, 0644);
> MODULE_PARM_DESC(ql2xdelay_before_pci_error_handling,
> 	"Number of seconds delayed before qla begin PCI error self-handling (default: 5).\n");
> 
> -int ql2xrspq_follow_inptr = 1;
> -module_param(ql2xrspq_follow_inptr, int, 0644);
> -MODULE_PARM_DESC(ql2xrspq_follow_inptr,
> -		 "Follow RSP IN pointer for RSP updates for HBAs 27xx and newer (default: 1).");
> -
> -int ql2xrspq_follow_inptr_legacy = 1;
> -module_param(ql2xrspq_follow_inptr_legacy, int, 0644);
> -MODULE_PARM_DESC(ql2xrspq_follow_inptr_legacy,
> -		 "Follow RSP IN pointer for RSP updates for HBAs older than 27XX. (default: 1).");
> -
> static void qla2x00_clear_drv_active(struct qla_hw_data *);
> static void qla2x00_free_device(scsi_qla_host_t *);
> static int qla2xxx_map_queues(struct Scsi_Host *shost);
> -- 
> 2.19.0.rc0
> 

Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>

-- 
Himanshu Madhani	Oracle Linux Engineering


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

* Re: [PATCH v2 2/7] qla2xxx: Fix response queue handler reading stale packets
  2022-08-26 10:25 ` [PATCH v2 2/7] qla2xxx: Fix response queue handler reading stale packets Nilesh Javali
@ 2022-08-29 16:10   ` Himanshu Madhani
  0 siblings, 0 replies; 23+ messages in thread
From: Himanshu Madhani @ 2022-08-29 16:10 UTC (permalink / raw)
  To: Nilesh Javali
  Cc: Martin Petersen, linux-scsi, GR-QLogic-Storage-Upstream,
	bhazarika, agurumurthy



> On Aug 26, 2022, at 3:25 AM, Nilesh Javali <njavali@marvell.com> wrote:
> 
> From: Arun Easi <aeasi@marvell.com>
> 
> On some platforms, the current logic of relying on finding new packet
> solely based on signature pattern can lead to driver reading stale
> packets. Though this is a bug in those platforms, reduce such exposures by
> limiting reading packets until the IN pointer.
> 
> Cc: stable@vger.kernel.org
> Signed-off-by: Arun Easi <aeasi@marvell.com>
> Signed-off-by: Nilesh Javali <njavali@marvell.com>
> ---
> drivers/scsi/qla2xxx/qla_isr.c | 17 +++++++++++++++--
> 1 file changed, 15 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/scsi/qla2xxx/qla_isr.c b/drivers/scsi/qla2xxx/qla_isr.c
> index ede76357ccb6..e19fde304e5c 100644
> --- a/drivers/scsi/qla2xxx/qla_isr.c
> +++ b/drivers/scsi/qla2xxx/qla_isr.c
> @@ -3763,7 +3763,8 @@ void qla24xx_process_response_queue(struct scsi_qla_host *vha,
> 	struct qla_hw_data *ha = vha->hw;
> 	struct purex_entry_24xx *purex_entry;
> 	struct purex_item *pure_item;
> -	u16 cur_ring_index;
> +	u16 rsp_in = 0, cur_ring_index;
> +	int is_shadow_hba;
> 
> 	if (!ha->flags.fw_started)
> 		return;
> @@ -3773,7 +3774,18 @@ void qla24xx_process_response_queue(struct scsi_qla_host *vha,
> 		qla_cpu_update(rsp->qpair, smp_processor_id());
> 	}
> 
> -	while (rsp->ring_ptr->signature != RESPONSE_PROCESSED) {
> +#define __update_rsp_in(_is_shadow_hba, _rsp, _rsp_in)			\
> +	do {								\
> +		_rsp_in = _is_shadow_hba ? *(_rsp)->in_ptr :		\
> +				rd_reg_dword_relaxed((_rsp)->rsp_q_in);	\
> +	} while (0)
> +
> +	is_shadow_hba = IS_SHADOW_REG_CAPABLE(ha);
> +
> +	__update_rsp_in(is_shadow_hba, rsp, rsp_in);
> +
> +	while (rsp->ring_index != rsp_in &&
> +		       rsp->ring_ptr->signature != RESPONSE_PROCESSED) {
> 		pkt = (struct sts_entry_24xx *)rsp->ring_ptr;
> 		cur_ring_index = rsp->ring_index;
> 
> @@ -3887,6 +3899,7 @@ void qla24xx_process_response_queue(struct scsi_qla_host *vha,
> 				}
> 				pure_item = qla27xx_copy_fpin_pkt(vha,
> 							  (void **)&pkt, &rsp);
> +				__update_rsp_in(is_shadow_hba, rsp, rsp_in);
> 				if (!pure_item)
> 					break;
> 				qla24xx_queue_purex_item(vha, pure_item,
> -- 
> 2.19.0.rc0
> 

Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>

-- 
Himanshu Madhani	Oracle Linux Engineering


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

* Re: [PATCH v2 3/7] qla2xxx: Add debugfs create/delete helpers
  2022-08-26 10:25 ` [PATCH v2 3/7] qla2xxx: Add debugfs create/delete helpers Nilesh Javali
@ 2022-08-29 16:10   ` Himanshu Madhani
  0 siblings, 0 replies; 23+ messages in thread
From: Himanshu Madhani @ 2022-08-29 16:10 UTC (permalink / raw)
  To: Nilesh Javali
  Cc: Martin Petersen, linux-scsi, GR-QLogic-Storage-Upstream,
	bhazarika, agurumurthy



> On Aug 26, 2022, at 3:25 AM, Nilesh Javali <njavali@marvell.com> wrote:
> 
> From: Arun Easi <aeasi@marvell.com>
> 
> Define a few helpful macros for creating debugfs files.
> 
> Signed-off-by: Arun Easi <aeasi@marvell.com>
> Signed-off-by: Nilesh Javali <njavali@marvell.com>
> ---
> drivers/scsi/qla2xxx/qla_def.h |  5 ++
> drivers/scsi/qla2xxx/qla_dfs.c | 93 ++++++++++++++++++++++++++++++++++
> 2 files changed, 98 insertions(+)
> 
> diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h
> index 3ec6a200942e..22274b405d01 100644
> --- a/drivers/scsi/qla2xxx/qla_def.h
> +++ b/drivers/scsi/qla2xxx/qla_def.h
> @@ -35,6 +35,11 @@
> 
> #include <uapi/scsi/fc/fc_els.h>
> 
> +#define QLA_DFS_DEFINE_DENTRY(_debugfs_file_name) \
> +	struct dentry *dfs_##_debugfs_file_name
> +#define QLA_DFS_ROOT_DEFINE_DENTRY(_debugfs_file_name) \
> +	struct dentry *qla_dfs_##_debugfs_file_name
> +
> /* Big endian Fibre Channel S_ID (source ID) or D_ID (destination ID). */
> typedef struct {
> 	uint8_t domain;
> diff --git a/drivers/scsi/qla2xxx/qla_dfs.c b/drivers/scsi/qla2xxx/qla_dfs.c
> index 85bd0e468d43..777808af5634 100644
> --- a/drivers/scsi/qla2xxx/qla_dfs.c
> +++ b/drivers/scsi/qla2xxx/qla_dfs.c
> @@ -489,6 +489,99 @@ qla_dfs_naqp_show(struct seq_file *s, void *unused)
> 	return 0;
> }
> 
> +/*
> + * Helper macros for setting up debugfs entries.
> + * _name: The name of the debugfs entry
> + * _ctx_struct: The context that was passed when creating the debugfs file
> + *
> + * QLA_DFS_SETUP_RD could be used when there is only a show function.
> + * - show function take the name qla_dfs_<sysfs-name>_show
> + *
> + * QLA_DFS_SETUP_RW could be used when there are both show and write functions.
> + * - show function take the name  qla_dfs_<sysfs-name>_show
> + * - write function take the name qla_dfs_<sysfs-name>_write
> + *
> + * To have a new debugfs entry, do:
> + * 1. Create a "struct dentry *" in the appropriate structure in the format
> + * dfs_<sysfs-name>
> + * 2. Setup debugfs entries using QLA_DFS_SETUP_RD / QLA_DFS_SETUP_RW
> + * 3. Create debugfs file in qla2x00_dfs_setup() using QLA_DFS_CREATE_FILE
> + * or QLA_DFS_ROOT_CREATE_FILE
> + * 4. Remove debugfs file in qla2x00_dfs_remove() using QLA_DFS_REMOVE_FILE
> + * or QLA_DFS_ROOT_REMOVE_FILE
> + *
> + * Example for creating "TEST" sysfs file:
> + * 1. struct qla_hw_data { ... struct dentry *dfs_TEST; }
> + * 2. QLA_DFS_SETUP_RD(TEST, scsi_qla_host_t);
> + * 3. In qla2x00_dfs_setup():
> + * QLA_DFS_CREATE_FILE(ha, TEST, 0600, ha->dfs_dir, vha);
> + * 4. In qla2x00_dfs_remove():
> + * QLA_DFS_REMOVE_FILE(ha, TEST);
> + */
> +#define QLA_DFS_SETUP_RD(_name, _ctx_struct)				\
> +static int								\
> +qla_dfs_##_name##_open(struct inode *inode, struct file *file)		\
> +{									\
> +	_ctx_struct *__ctx = inode->i_private;				\
> +									\
> +	return single_open(file, qla_dfs_##_name##_show, __ctx);	\
> +}									\
> +									\
> +static const struct file_operations qla_dfs_##_name##_ops = {		\
> +	.open           = qla_dfs_##_name##_open,			\
> +	.read           = seq_read,					\
> +	.llseek         = seq_lseek,					\
> +	.release        = single_release,				\
> +};
> +
> +#define QLA_DFS_SETUP_RW(_name, _ctx_struct)				\
> +static int								\
> +qla_dfs_##_name##_open(struct inode *inode, struct file *file)		\
> +{									\
> +	_ctx_struct *__ctx = inode->i_private;				\
> +									\
> +	return single_open(file, qla_dfs_##_name##_show, __ctx);	\
> +}									\
> +									\
> +static const struct file_operations qla_dfs_##_name##_ops = {		\
> +	.open           = qla_dfs_##_name##_open,			\
> +	.read           = seq_read,					\
> +	.llseek         = seq_lseek,					\
> +	.release        = single_release,				\
> +	.write		= qla_dfs_##_name##_write,			\
> +};
> +
> +#define QLA_DFS_ROOT_CREATE_FILE(_name, _perm, _ctx)			\
> +	do {								\
> +		if (!qla_dfs_##_name)					\
> +			qla_dfs_##_name = debugfs_create_file(#_name,	\
> +					_perm, qla2x00_dfs_root, _ctx,	\
> +					&qla_dfs_##_name##_ops);	\
> +	} while (0)
> +
> +#define QLA_DFS_ROOT_REMOVE_FILE(_name)					\
> +	do {								\
> +		if (qla_dfs_##_name) {					\
> +			debugfs_remove(qla_dfs_##_name);		\
> +			qla_dfs_##_name = NULL;				\
> +		}							\
> +	} while (0)
> +
> +#define QLA_DFS_CREATE_FILE(_struct, _name, _perm, _parent, _ctx)	\
> +	do {								\
> +		(_struct)->dfs_##_name = debugfs_create_file(#_name,	\
> +					_perm, _parent, _ctx,		\
> +					&qla_dfs_##_name##_ops)		\
> +	} while (0)
> +
> +#define QLA_DFS_REMOVE_FILE(_struct, _name)				\
> +	do {								\
> +		if ((_struct)->dfs_##_name) {				\
> +			debugfs_remove((_struct)->dfs_##_name);		\
> +			(_struct)->dfs_##_name = NULL;			\
> +		}							\
> +	} while (0)
> +
> static int
> qla_dfs_naqp_open(struct inode *inode, struct file *file)
> {
> -- 
> 2.19.0.rc0
> 

Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>

-- 
Himanshu Madhani	Oracle Linux Engineering


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

* Re: [PATCH v2 4/7] qla2xxx: Add NVMe parameters support in Auxiliary Image Status
  2022-08-26 10:25 ` [PATCH v2 4/7] qla2xxx: Add NVMe parameters support in Auxiliary Image Status Nilesh Javali
@ 2022-08-29 16:15   ` Himanshu Madhani
  0 siblings, 0 replies; 23+ messages in thread
From: Himanshu Madhani @ 2022-08-29 16:15 UTC (permalink / raw)
  To: Nilesh Javali
  Cc: Martin Petersen, linux-scsi, GR-QLogic-Storage-Upstream,
	bhazarika, agurumurthy



> On Aug 26, 2022, at 3:25 AM, Nilesh Javali <njavali@marvell.com> wrote:
> 
> From: Anil Gurumurthy <agurumurthy@marvell.com>
> 
> Add new API to obtain the NVMe Parameters region status from the
> Auxiliary Image Status bitmap.
> 
> Signed-off-by: Anil Gurumurthy <agurumurthy@marvell.com>
> Signed-off-by: Nilesh Javali <njavali@marvell.com>
> ---
> drivers/scsi/qla2xxx/qla_bsg.c  | 8 ++++++--
> drivers/scsi/qla2xxx/qla_bsg.h  | 3 ++-
> drivers/scsi/qla2xxx/qla_def.h  | 2 ++
> drivers/scsi/qla2xxx/qla_fw.h   | 3 +++
> drivers/scsi/qla2xxx/qla_init.c | 8 ++++++--
> 5 files changed, 19 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/scsi/qla2xxx/qla_bsg.c b/drivers/scsi/qla2xxx/qla_bsg.c
> index 5db9bf69dcff..cd75b179410d 100644
> --- a/drivers/scsi/qla2xxx/qla_bsg.c
> +++ b/drivers/scsi/qla2xxx/qla_bsg.c
> @@ -2519,19 +2519,23 @@ qla2x00_get_flash_image_status(struct bsg_job *bsg_job)
> 	qla27xx_get_active_image(vha, &active_regions);
> 	regions.global_image = active_regions.global;
> 
> +	if (IS_QLA27XX(ha))
> +		regions.nvme_params = QLA27XX_PRIMARY_IMAGE;
> +
> 	if (IS_QLA28XX(ha)) {
> 		qla28xx_get_aux_images(vha, &active_regions);
> 		regions.board_config = active_regions.aux.board_config;
> 		regions.vpd_nvram = active_regions.aux.vpd_nvram;
> 		regions.npiv_config_0_1 = active_regions.aux.npiv_config_0_1;
> 		regions.npiv_config_2_3 = active_regions.aux.npiv_config_2_3;
> +		regions.nvme_params = active_regions.aux.nvme_params;
> 	}
> 
> 	ql_dbg(ql_dbg_user, vha, 0x70e1,
> -	    "%s(%lu): FW=%u BCFG=%u VPDNVR=%u NPIV01=%u NPIV02=%u\n",
> +	    "%s(%lu): FW=%u BCFG=%u VPDNVR=%u NPIV01=%u NPIV02=%u NVME_PARAMS=%u\n",
> 	    __func__, vha->host_no, regions.global_image,
> 	    regions.board_config, regions.vpd_nvram,
> -	    regions.npiv_config_0_1, regions.npiv_config_2_3);
> +	    regions.npiv_config_0_1, regions.npiv_config_2_3, regions.nvme_params);
> 
> 	sg_copy_from_buffer(bsg_job->reply_payload.sg_list,
> 	    bsg_job->reply_payload.sg_cnt, &regions, sizeof(regions));
> diff --git a/drivers/scsi/qla2xxx/qla_bsg.h b/drivers/scsi/qla2xxx/qla_bsg.h
> index bb64b9c5a74b..d38dab0a07e8 100644
> --- a/drivers/scsi/qla2xxx/qla_bsg.h
> +++ b/drivers/scsi/qla2xxx/qla_bsg.h
> @@ -314,7 +314,8 @@ struct qla_active_regions {
> 	uint8_t vpd_nvram;
> 	uint8_t npiv_config_0_1;
> 	uint8_t npiv_config_2_3;
> -	uint8_t reserved[32];
> +	uint8_t nvme_params;
> +	uint8_t reserved[31];
> } __packed;
> 
> #include "qla_edif_bsg.h"
> diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h
> index 22274b405d01..802eec6407d9 100644
> --- a/drivers/scsi/qla2xxx/qla_def.h
> +++ b/drivers/scsi/qla2xxx/qla_def.h
> @@ -4773,6 +4773,7 @@ struct active_regions {
> 		uint8_t vpd_nvram;
> 		uint8_t npiv_config_0_1;
> 		uint8_t npiv_config_2_3;
> +		uint8_t nvme_params;
> 	} aux;
> };
> 
> @@ -5057,6 +5058,7 @@ struct qla27xx_image_status {
> #define QLA28XX_AUX_IMG_VPD_NVRAM		BIT_1
> #define QLA28XX_AUX_IMG_NPIV_CONFIG_0_1		BIT_2
> #define QLA28XX_AUX_IMG_NPIV_CONFIG_2_3		BIT_3
> +#define QLA28XX_AUX_IMG_NVME_PARAMS		BIT_4
> 
> #define SET_VP_IDX	1
> #define SET_AL_PA	2
> diff --git a/drivers/scsi/qla2xxx/qla_fw.h b/drivers/scsi/qla2xxx/qla_fw.h
> index 361015b5763e..f307beed9d29 100644
> --- a/drivers/scsi/qla2xxx/qla_fw.h
> +++ b/drivers/scsi/qla2xxx/qla_fw.h
> @@ -1675,6 +1675,7 @@ struct qla_flt_location {
> #define FLT_REG_VPD_SEC_27XX_1	0x52
> #define FLT_REG_VPD_SEC_27XX_2	0xD8
> #define FLT_REG_VPD_SEC_27XX_3	0xDA
> +#define FLT_REG_NVME_PARAMS_27XX	0x21
> 
> /* 28xx */
> #define FLT_REG_AUX_IMG_PRI_28XX	0x125
> @@ -1691,6 +1692,8 @@ struct qla_flt_location {
> #define FLT_REG_MPI_SEC_28XX		0xF0
> #define FLT_REG_PEP_PRI_28XX		0xD1
> #define FLT_REG_PEP_SEC_28XX		0xF1
> +#define FLT_REG_NVME_PARAMS_PRI_28XX	0x14E
> +#define FLT_REG_NVME_PARAMS_SEC_28XX	0x179
> 
> struct qla_flt_region {
> 	__le16	code;
> diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c
> index e7fe0e52c11d..e12db95de688 100644
> --- a/drivers/scsi/qla2xxx/qla_init.c
> +++ b/drivers/scsi/qla2xxx/qla_init.c
> @@ -7933,6 +7933,9 @@ qla28xx_component_status(
> 
> 	active_regions->aux.npiv_config_2_3 =
> 	    qla28xx_component_bitmask(aux, QLA28XX_AUX_IMG_NPIV_CONFIG_2_3);
> +
> +	active_regions->aux.nvme_params =
> +	    qla28xx_component_bitmask(aux, QLA28XX_AUX_IMG_NVME_PARAMS);
> }
> 
> static int
> @@ -8041,11 +8044,12 @@ qla28xx_get_aux_images(
> 	}
> 
> 	ql_dbg(ql_dbg_init, vha, 0x018f,
> -	    "aux images active: BCFG=%u VPD/NVR=%u NPIV0/1=%u NPIV2/3=%u\n",
> +	    "aux images active: BCFG=%u VPD/NVR=%u NPIV0/1=%u NPIV2/3=%u, NVME=%u\n",
> 	    active_regions->aux.board_config,
> 	    active_regions->aux.vpd_nvram,
> 	    active_regions->aux.npiv_config_0_1,
> -	    active_regions->aux.npiv_config_2_3);
> +	    active_regions->aux.npiv_config_2_3,
> +	    active_regions->aux.nvme_params);
> }
> 
> void
> -- 
> 2.19.0.rc0
> 

Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>

-- 
Himanshu Madhani	Oracle Linux Engineering


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

* Re: [PATCH v2 5/7] qla2xxx: Enhance driver tracing with separate tunable and more
  2022-08-26 10:25 ` [PATCH v2 5/7] qla2xxx: Enhance driver tracing with separate tunable and more Nilesh Javali
@ 2022-08-29 16:24   ` Himanshu Madhani
  2022-08-29 16:59     ` Arun Easi
  2022-08-30  8:07   ` Daniel Wagner
  2022-09-19 22:01   ` Guenter Roeck
  2 siblings, 1 reply; 23+ messages in thread
From: Himanshu Madhani @ 2022-08-29 16:24 UTC (permalink / raw)
  To: Nilesh Javali
  Cc: Martin Petersen, linux-scsi, GR-QLogic-Storage-Upstream,
	bhazarika, agurumurthy

Small nits

> On Aug 26, 2022, at 3:25 AM, Nilesh Javali <njavali@marvell.com> wrote:
> 
> From: Arun Easi <aeasi@marvell.com>
> 
> Older tracing of driver messages was to:
>    - log only debug messages to kernel main trace buffer AND
>    - log only if extended logging bits corresponding to this
>      message is off
> 
> This has been modified and extended as follows:
>    - Tracing is now controlled via ql2xextended_error_logging_ktrace
>      module parameter. Bit usages same as ql2xextended_error_logging.
>    - Tracing uses "qla2xxx" trace instance, unless instance creation
>      have issues.
>    - Tracing is enabled (compile time tunable).
>    - All driver messages, include debug and log messages are now traced
>      in kernel trace buffer.
> 
> Trace messages can be viewed by looking at the qla2xxx instance at:
>    /sys/kernel/tracing/instances/qla2xxx/trace
> 
^^^^^^^^
This should be /sys/kernel/debug/tracing/instances/qla2xxx/trace

> Trace tunable that takes the same bit mask as ql2xextended_error_logging
> is:
>    ql2xextended_error_logging_ktrace (default=1)
> 
> Suggested-by: Daniel Wagner <dwagner@suse.de>
> Suggested-by: Steven Rostedt <rostedt@goodmis.org>
> Signed-off-by: Arun Easi <aeasi@marvell.com>
> Signed-off-by: Nilesh Javali <njavali@marvell.com>
> ---
> drivers/scsi/qla2xxx/qla_dbg.c | 50 ++++++++++++++++++++++++----------
> drivers/scsi/qla2xxx/qla_dbg.h | 43 +++++++++++++++++++++++++++++
> drivers/scsi/qla2xxx/qla_gbl.h |  1 +
> drivers/scsi/qla2xxx/qla_os.c  | 35 ++++++++++++++++++++++++
> 4 files changed, 115 insertions(+), 14 deletions(-)
> 
> diff --git a/drivers/scsi/qla2xxx/qla_dbg.c b/drivers/scsi/qla2xxx/qla_dbg.c
> index 7cf1f78cbaee..d7e8454304ce 100644
> --- a/drivers/scsi/qla2xxx/qla_dbg.c
> +++ b/drivers/scsi/qla2xxx/qla_dbg.c
> @@ -2455,7 +2455,7 @@ qla83xx_fw_dump(scsi_qla_host_t *vha)
> /****************************************************************************/
> 
> /* Write the debug message prefix into @pbuf. */
> -static void ql_dbg_prefix(char *pbuf, int pbuf_size,
> +static void ql_dbg_prefix(char *pbuf, int pbuf_size, struct pci_dev *pdev,
> 			  const scsi_qla_host_t *vha, uint msg_id)
> {
> 	if (vha) {
> @@ -2464,6 +2464,9 @@ static void ql_dbg_prefix(char *pbuf, int pbuf_size,
> 		/* <module-name> [<dev-name>]-<msg-id>:<host>: */
> 		snprintf(pbuf, pbuf_size, "%s [%s]-%04x:%lu: ", QL_MSGHDR,
> 			 dev_name(&(pdev->dev)), msg_id, vha->host_no);
> +	} else if (pdev) {
> +		snprintf(pbuf, pbuf_size, "%s [%s]-%04x: : ", QL_MSGHDR,
> +			 dev_name(&pdev->dev), msg_id);
> 	} else {
> 		/* <module-name> [<dev-name>]-<msg-id>: : */
> 		snprintf(pbuf, pbuf_size, "%s [%s]-%04x: : ", QL_MSGHDR,
> @@ -2491,20 +2494,20 @@ ql_dbg(uint level, scsi_qla_host_t *vha, uint id, const char *fmt, ...)
> 	struct va_format vaf;
> 	char pbuf[64];
> 
> -	if (!ql_mask_match(level) && !trace_ql_dbg_log_enabled())
> +	ql_ktrace(1, level, pbuf, NULL, vha, id, fmt);
> +
> +	if (!ql_mask_match(level))
> 		return;
> 
> +	if (!pbuf[0]) /* set by ql_ktrace */
> +		ql_dbg_prefix(pbuf, ARRAY_SIZE(pbuf), NULL, vha, id);
> +
> 	va_start(va, fmt);
> 
> 	vaf.fmt = fmt;
> 	vaf.va = &va;
> 
> -	ql_dbg_prefix(pbuf, ARRAY_SIZE(pbuf), vha, id);
> -
> -	if (!ql_mask_match(level))
> -		trace_ql_dbg_log(pbuf, &vaf);
> -	else
> -		pr_warn("%s%pV", pbuf, &vaf);
> +	pr_warn("%s%pV", pbuf, &vaf);
> 
> 	va_end(va);
> 
> @@ -2533,6 +2536,9 @@ ql_dbg_pci(uint level, struct pci_dev *pdev, uint id, const char *fmt, ...)
> 
> 	if (pdev == NULL)
> 		return;
> +
> +	ql_ktrace(1, level, pbuf, pdev, NULL, id, fmt);
> +
> 	if (!ql_mask_match(level))
> 		return;
> 
> @@ -2541,7 +2547,9 @@ ql_dbg_pci(uint level, struct pci_dev *pdev, uint id, const char *fmt, ...)
> 	vaf.fmt = fmt;
> 	vaf.va = &va;
> 
> -	ql_dbg_prefix(pbuf, ARRAY_SIZE(pbuf), NULL, id + ql_dbg_offset);
> +	if (!pbuf[0]) /* set by ql_ktrace */
> +		ql_dbg_prefix(pbuf, ARRAY_SIZE(pbuf), pdev, NULL,
> +			      id + ql_dbg_offset);
> 	pr_warn("%s%pV", pbuf, &vaf);
> 
> 	va_end(va);
> @@ -2570,7 +2578,10 @@ ql_log(uint level, scsi_qla_host_t *vha, uint id, const char *fmt, ...)
> 	if (level > ql_errlev)
> 		return;
> 
> -	ql_dbg_prefix(pbuf, ARRAY_SIZE(pbuf), vha, id);
> +	ql_ktrace(0, level, pbuf, NULL, vha, id, fmt);
> +
> +	if (!pbuf[0]) /* set by ql_ktrace */
> +		ql_dbg_prefix(pbuf, ARRAY_SIZE(pbuf), NULL, vha, id);
> 
> 	va_start(va, fmt);
> 
> @@ -2621,7 +2632,10 @@ ql_log_pci(uint level, struct pci_dev *pdev, uint id, const char *fmt, ...)
> 	if (level > ql_errlev)
> 		return;
> 
> -	ql_dbg_prefix(pbuf, ARRAY_SIZE(pbuf), NULL, id);
> +	ql_ktrace(0, level, pbuf, pdev, NULL, id, fmt);
> +
> +	if (!pbuf[0]) /* set by ql_ktrace */
> +		ql_dbg_prefix(pbuf, ARRAY_SIZE(pbuf), pdev, NULL, id);
> 
> 	va_start(va, fmt);
> 
> @@ -2716,7 +2730,11 @@ ql_log_qp(uint32_t level, struct qla_qpair *qpair, int32_t id,
> 	if (level > ql_errlev)
> 		return;
> 
> -	ql_dbg_prefix(pbuf, ARRAY_SIZE(pbuf), qpair ? qpair->vha : NULL, id);
> +	ql_ktrace(0, level, pbuf, NULL, qpair ? qpair->vha : NULL, id, fmt);
> +
> +	if (!pbuf[0]) /* set by ql_ktrace */
> +		ql_dbg_prefix(pbuf, ARRAY_SIZE(pbuf), NULL,
> +			      qpair ? qpair->vha : NULL, id);
> 
> 	va_start(va, fmt);
> 
> @@ -2762,6 +2780,8 @@ ql_dbg_qp(uint32_t level, struct qla_qpair *qpair, int32_t id,
> 	struct va_format vaf;
> 	char pbuf[128];
> 
> +	ql_ktrace(1, level, pbuf, NULL, qpair ? qpair->vha : NULL, id, fmt);
> +
> 	if (!ql_mask_match(level))
> 		return;
> 
> @@ -2770,8 +2790,10 @@ ql_dbg_qp(uint32_t level, struct qla_qpair *qpair, int32_t id,
> 	vaf.fmt = fmt;
> 	vaf.va = &va;
> 
> -	ql_dbg_prefix(pbuf, ARRAY_SIZE(pbuf), qpair ? qpair->vha : NULL,
> -		      id + ql_dbg_offset);
> +	if (!pbuf[0]) /* set by ql_ktrace */
> +		ql_dbg_prefix(pbuf, ARRAY_SIZE(pbuf), NULL,
> +			      qpair ? qpair->vha : NULL, id + ql_dbg_offset);
> +
> 	pr_warn("%s%pV", pbuf, &vaf);
> 
> 	va_end(va);
> diff --git a/drivers/scsi/qla2xxx/qla_dbg.h b/drivers/scsi/qla2xxx/qla_dbg.h
> index feeb1666227f..70482b55d240 100644
> --- a/drivers/scsi/qla2xxx/qla_dbg.h
> +++ b/drivers/scsi/qla2xxx/qla_dbg.h
> @@ -385,3 +385,46 @@ ql_mask_match(uint level)
> 
> 	return level && ((level & ql2xextended_error_logging) == level);
> }
> +
> +static inline int
> +ql_mask_match_ext(uint level, int *log_tunable)
> +{
> +	if (*log_tunable == 1)
> +		*log_tunable = QL_DBG_DEFAULT1_MASK;
> +
> +	return (level & *log_tunable) == level;
> +}
> +
> +/* Assumes local variable pbuf and pbuf_ready present. */
> +#define ql_ktrace(dbg_msg, level, pbuf, pdev, vha, id, fmt) do {	\
> +	struct va_format _vaf;						\
> +	va_list _va;							\
> +	u32 dbg_off = dbg_msg ? ql_dbg_offset : 0;			\
> +									\
> +	pbuf[0] = 0;							\
> +	if (!trace_ql_dbg_log_enabled())				\
> +		break;							\
> +									\
> +	if (dbg_msg && !ql_mask_match_ext(level,			\
> +				&ql2xextended_error_logging_ktrace))	\
> +		break;							\
> +									\
> +	ql_dbg_prefix(pbuf, ARRAY_SIZE(pbuf), pdev, vha, id + dbg_off);	\
> +									\
> +	va_start(_va, fmt);						\
> +	_vaf.fmt = fmt;							\
> +	_vaf.va = &_va;							\
> +									\
> +	trace_ql_dbg_log(pbuf, &_vaf);					\
> +									\
> +	va_end(_va);							\
> +} while (0)
> +
> +#define QLA_ENABLE_KERNEL_TRACING
> +
> +#ifdef QLA_ENABLE_KERNEL_TRACING
> +#define QLA_TRACE_ENABLE(_tr) \
> +	trace_array_set_clr_event(_tr, "qla", NULL, true)
> +#else /* QLA_ENABLE_KERNEL_TRACING */
> +#define QLA_TRACE_ENABLE(_tr)
> +#endif /* QLA_ENABLE_KERNEL_TRACING */
> diff --git a/drivers/scsi/qla2xxx/qla_gbl.h b/drivers/scsi/qla2xxx/qla_gbl.h
> index bb69fa8b956a..2fc280e61306 100644
> --- a/drivers/scsi/qla2xxx/qla_gbl.h
> +++ b/drivers/scsi/qla2xxx/qla_gbl.h
> @@ -163,6 +163,7 @@ extern int ql2xrdpenable;
> extern int ql2xsmartsan;
> extern int ql2xallocfwdump;
> extern int ql2xextended_error_logging;
> +extern int ql2xextended_error_logging_ktrace;
> extern int ql2xiidmaenable;
> extern int ql2xmqsupport;
> extern int ql2xfwloadbin;
> diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c
> index 1c7fb6484db2..4a55c1e81327 100644
> --- a/drivers/scsi/qla2xxx/qla_os.c
> +++ b/drivers/scsi/qla2xxx/qla_os.c
> @@ -15,6 +15,8 @@
> #include <linux/blk-mq-pci.h>
> #include <linux/refcount.h>
> #include <linux/crash_dump.h>
> +#include <linux/trace_events.h>
> +#include <linux/trace.h>
> 
> #include <scsi/scsi_tcq.h>
> #include <scsi/scsicam.h>
> @@ -35,6 +37,8 @@ static int apidev_major;
>  */
> struct kmem_cache *srb_cachep;
> 
> +struct trace_array *qla_trc_array;
> +
> int ql2xfulldump_on_mpifail;
> module_param(ql2xfulldump_on_mpifail, int, S_IRUGO | S_IWUSR);
> MODULE_PARM_DESC(ql2xfulldump_on_mpifail,
> @@ -117,6 +121,11 @@ MODULE_PARM_DESC(ql2xextended_error_logging,
> 		"ql2xextended_error_logging=1).\n"
> 		"\t\tDo LOGICAL OR of the value to enable more than one level");
> 
> +int ql2xextended_error_logging_ktrace = 1;
> +module_param(ql2xextended_error_logging_ktrace, int, S_IRUGO|S_IWUSR);
> +MODULE_PARM_DESC(ql2xextended_error_logging_ktrace,
> +		"Same BIT definiton as ql2xextended_error_logging, but used to control logging to kernel trace buffer (default=1).\n");
> +
> int ql2xshiftctondsd = 6;
> module_param(ql2xshiftctondsd, int, S_IRUGO);
> MODULE_PARM_DESC(ql2xshiftctondsd,
> @@ -2839,6 +2848,27 @@ static void qla2x00_iocb_work_fn(struct work_struct *work)
> 	spin_unlock_irqrestore(&vha->work_lock, flags);
> }
> 
> +static void
> +qla_trace_init(void)
> +{
> +	qla_trc_array = trace_array_get_by_name("qla2xxx");
> +	if (!qla_trc_array) {
> +		ql_log(ql_log_fatal, NULL, 0x0001,
> +		       "Unable to create qla2xxx trace instance, instance logging will be disabled.\n");
> +		return;
> +	}
> +
> +	QLA_TRACE_ENABLE(qla_trc_array);
> +}
> +
> +static void
> +qla_trace_uninit(void)
> +{
> +	if (!qla_trc_array)
> +		return;
> +	trace_array_put(qla_trc_array);
> +}
> +
> /*
>  * PCI driver interface
>  */
> @@ -8181,6 +8211,8 @@ qla2x00_module_init(void)
> 	BUILD_BUG_ON(sizeof(sw_info_t) != 32);
> 	BUILD_BUG_ON(sizeof(target_id_t) != 2);
> 
> +	qla_trace_init();
> +
> 	/* Allocate cache for SRBs. */
> 	srb_cachep = kmem_cache_create("qla2xxx_srbs", sizeof(srb_t), 0,
> 	    SLAB_HWCACHE_ALIGN, NULL);
> @@ -8259,6 +8291,8 @@ qla2x00_module_init(void)
> 
> destroy_cache:
> 	kmem_cache_destroy(srb_cachep);
> +
> +	qla_trace_uninit();
> 	return ret;
> }
> 
> @@ -8277,6 +8311,7 @@ qla2x00_module_exit(void)
> 	fc_release_transport(qla2xxx_transport_template);
> 	qlt_exit();
> 	kmem_cache_destroy(srb_cachep);
> +	qla_trace_uninit();
> }
> 
> module_init(qla2x00_module_init);
> -- 
> 2.19.0.rc0
> 

When you fix the commit message. 

Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>

-- 
Himanshu Madhani	Oracle Linux Engineering


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

* Re: [PATCH v2 6/7] qla2xxx: define static symbols
  2022-08-26 10:25 ` [PATCH v2 6/7] qla2xxx: define static symbols Nilesh Javali
@ 2022-08-29 16:25   ` Himanshu Madhani
  0 siblings, 0 replies; 23+ messages in thread
From: Himanshu Madhani @ 2022-08-29 16:25 UTC (permalink / raw)
  To: Nilesh Javali
  Cc: Martin Petersen, linux-scsi, GR-QLogic-Storage-Upstream,
	bhazarika, agurumurthy



> On Aug 26, 2022, at 3:25 AM, Nilesh Javali <njavali@marvell.com> wrote:
> 
> drivers/scsi/qla2xxx/qla_os.c:40:20: warning: symbol 'qla_trc_array'
> was not declared. Should it be static?
> drivers/scsi/qla2xxx/qla_os.c:345:5: warning: symbol
> 'ql2xdelay_before_pci_error_handling' was not declared.
> Should it be static?
> 
> Define qla_trc_array and ql2xdelay_before_pci_error_handling
> as static to fix sparse warnings.
> 
> Cc: stable@vger.kernel.org
> Reported-by: kernel test robot <lkp@intel.com>
> Signed-off-by: Nilesh Javali <njavali@marvell.com>
> ---
> drivers/scsi/qla2xxx/qla_os.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c
> index 4a55c1e81327..46c281b55c63 100644
> --- a/drivers/scsi/qla2xxx/qla_os.c
> +++ b/drivers/scsi/qla2xxx/qla_os.c
> @@ -37,7 +37,7 @@ static int apidev_major;
>  */
> struct kmem_cache *srb_cachep;
> 
> -struct trace_array *qla_trc_array;
> +static struct trace_array *qla_trc_array;
> 
> int ql2xfulldump_on_mpifail;
> module_param(ql2xfulldump_on_mpifail, int, S_IRUGO | S_IWUSR);
> @@ -342,7 +342,7 @@ MODULE_PARM_DESC(ql2xabts_wait_nvme,
> 		 "To wait for ABTS response on I/O timeouts for NVMe. (default: 1)");
> 
> 
> -u32 ql2xdelay_before_pci_error_handling = 5;
> +static u32 ql2xdelay_before_pci_error_handling = 5;
> module_param(ql2xdelay_before_pci_error_handling, uint, 0644);
> MODULE_PARM_DESC(ql2xdelay_before_pci_error_handling,
> 	"Number of seconds delayed before qla begin PCI error self-handling (default: 5).\n");
> -- 
> 2.19.0.rc0
> 

Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>

-- 
Himanshu Madhani	Oracle Linux Engineering


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

* Re: [PATCH v2 7/7] qla2xxx: Update version to 10.02.07.900-k
  2022-08-26 10:25 ` [PATCH v2 7/7] qla2xxx: Update version to 10.02.07.900-k Nilesh Javali
@ 2022-08-29 16:26   ` Himanshu Madhani
  0 siblings, 0 replies; 23+ messages in thread
From: Himanshu Madhani @ 2022-08-29 16:26 UTC (permalink / raw)
  To: Nilesh Javali
  Cc: Martin Petersen, linux-scsi, GR-QLogic-Storage-Upstream,
	bhazarika, agurumurthy



> On Aug 26, 2022, at 3:25 AM, Nilesh Javali <njavali@marvell.com> wrote:
> 
> Signed-off-by: Nilesh Javali <njavali@marvell.com>
> ---
> drivers/scsi/qla2xxx/qla_version.h | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/scsi/qla2xxx/qla_version.h b/drivers/scsi/qla2xxx/qla_version.h
> index f3257d46b6d2..03f3e2cd62b5 100644
> --- a/drivers/scsi/qla2xxx/qla_version.h
> +++ b/drivers/scsi/qla2xxx/qla_version.h
> @@ -6,9 +6,9 @@
> /*
>  * Driver version
>  */
> -#define QLA2XXX_VERSION      "10.02.07.800-k"
> +#define QLA2XXX_VERSION      "10.02.07.900-k"
> 
> #define QLA_DRIVER_MAJOR_VER	10
> #define QLA_DRIVER_MINOR_VER	2
> #define QLA_DRIVER_PATCH_VER	7
> -#define QLA_DRIVER_BETA_VER	800
> +#define QLA_DRIVER_BETA_VER	900
> -- 
> 2.19.0.rc0
> 

Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>

-- 
Himanshu Madhani	Oracle Linux Engineering


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

* Re: [PATCH v2 5/7] qla2xxx: Enhance driver tracing with separate tunable and more
  2022-08-29 16:24   ` Himanshu Madhani
@ 2022-08-29 16:59     ` Arun Easi
  2022-08-29 19:25       ` Himanshu Madhani
  0 siblings, 1 reply; 23+ messages in thread
From: Arun Easi @ 2022-08-29 16:59 UTC (permalink / raw)
  To: Himanshu Madhani
  Cc: Nilesh Javali, Martin Petersen, linux-scsi,
	GR-QLogic-Storage-Upstream, bhazarika, agurumurthy

Thanks for reviewing the code, Himanshu. Response inline..

On Mon, 29 Aug 2022, 9:24am, Himanshu Madhani wrote:

> Small nits
> 
> > On Aug 26, 2022, at 3:25 AM, Nilesh Javali <njavali@marvell.com> wrote:
> > 
> > From: Arun Easi <aeasi@marvell.com>
> > 
> > Older tracing of driver messages was to:
> >    - log only debug messages to kernel main trace buffer AND
> >    - log only if extended logging bits corresponding to this
> >      message is off
> > 
> > This has been modified and extended as follows:
> >    - Tracing is now controlled via ql2xextended_error_logging_ktrace
> >      module parameter. Bit usages same as ql2xextended_error_logging.
> >    - Tracing uses "qla2xxx" trace instance, unless instance creation
> >      have issues.
> >    - Tracing is enabled (compile time tunable).
> >    - All driver messages, include debug and log messages are now traced
> >      in kernel trace buffer.
> > 
> > Trace messages can be viewed by looking at the qla2xxx instance at:
> >    /sys/kernel/tracing/instances/qla2xxx/trace
> > 
> ^^^^^^^^
> This should be /sys/kernel/debug/tracing/instances/qla2xxx/trace
> 

With tracefs, the location is moved to:
	/sys/kernel/tracing

..with old location preserved.

Regards,
-Arun
PS: # grep -A 10 '^The File System' Documentation/trace/ftrace.rst

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

* Re: [PATCH v2 5/7] qla2xxx: Enhance driver tracing with separate tunable and more
  2022-08-29 16:59     ` Arun Easi
@ 2022-08-29 19:25       ` Himanshu Madhani
  2022-08-30  7:55         ` Daniel Wagner
  0 siblings, 1 reply; 23+ messages in thread
From: Himanshu Madhani @ 2022-08-29 19:25 UTC (permalink / raw)
  To: Arun Easi
  Cc: Nilesh Javali, Martin Petersen, linux-scsi,
	GR-QLogic-Storage-Upstream, bhazarika, agurumurthy



> On Aug 29, 2022, at 9:59 AM, Arun Easi <aeasi@marvell.com> wrote:
> 
> Thanks for reviewing the code, Himanshu. Response inline..
> 
> On Mon, 29 Aug 2022, 9:24am, Himanshu Madhani wrote:
> 
>> Small nits
>> 
>>> On Aug 26, 2022, at 3:25 AM, Nilesh Javali <njavali@marvell.com> wrote:
>>> 
>>> From: Arun Easi <aeasi@marvell.com>
>>> 
>>> Older tracing of driver messages was to:
>>>   - log only debug messages to kernel main trace buffer AND
>>>   - log only if extended logging bits corresponding to this
>>>     message is off
>>> 
>>> This has been modified and extended as follows:
>>>   - Tracing is now controlled via ql2xextended_error_logging_ktrace
>>>     module parameter. Bit usages same as ql2xextended_error_logging.
>>>   - Tracing uses "qla2xxx" trace instance, unless instance creation
>>>     have issues.
>>>   - Tracing is enabled (compile time tunable).
>>>   - All driver messages, include debug and log messages are now traced
>>>     in kernel trace buffer.
>>> 
>>> Trace messages can be viewed by looking at the qla2xxx instance at:
>>>   /sys/kernel/tracing/instances/qla2xxx/trace
>>> 
>> ^^^^^^^^
>> This should be /sys/kernel/debug/tracing/instances/qla2xxx/trace
>> 
> 
> With tracefs, the location is moved to:
> 	/sys/kernel/tracing
> 
> ..with old location preserved.
> 

Okay got it... I think I got tripped by the nuance of tracefs to be mounted to see a new tracing directory to be populated.

Here’s what I had seen on my 6.0.0-rc1+ kernel,

I could not locate it at /sys/kernel/tracing instead old location which makes sense from the Documentation

root@tatoonie~6.0.0-rc1+:/# ls -l /sys/kernel/tracing/
total 0
root@tatoonie~6.0.0-rc1+:/# ls -l /sys/kernel/debug/tracing/instances/qla2xxx/trace
-rw-r----- 1 root root 0 Aug 29 08:54 /sys/kernel/debug/tracing/instances/qla2xxx/trace

maybe you can add a comment indicating tracefs should be mounted to see traces at 
/sys/kernel/tracing.

FYI.. you can also add 

Tested-by: Himanshu Madhani <himanshu.madhani@oracle.com>


> Regards,
> -Arun
> PS: # grep -A 10 '^The File System' Documentation/trace/ftrace.rst

-- 
Himanshu Madhani	Oracle Linux Engineering


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

* Re: [PATCH v2 5/7] qla2xxx: Enhance driver tracing with separate tunable and more
  2022-08-29 19:25       ` Himanshu Madhani
@ 2022-08-30  7:55         ` Daniel Wagner
  2022-09-01 13:41           ` Steven Rostedt
  0 siblings, 1 reply; 23+ messages in thread
From: Daniel Wagner @ 2022-08-30  7:55 UTC (permalink / raw)
  To: Himanshu Madhani
  Cc: Arun Easi, Nilesh Javali, Martin Petersen, linux-scsi,
	GR-QLogic-Storage-Upstream, bhazarika, agurumurthy,
	Steven Rostedt

On Mon, Aug 29, 2022 at 07:25:34PM +0000, Himanshu Madhani wrote:
> root@tatoonie~6.0.0-rc1+:/# ls -l /sys/kernel/tracing/
> total 0
> root@tatoonie~6.0.0-rc1+:/# ls -l /sys/kernel/debug/tracing/instances/qla2xxx/trace
> -rw-r----- 1 root root 0 Aug 29 08:54 /sys/kernel/debug/tracing/instances/qla2xxx/trace

IIRC, Steven's goal was to get all distros to move the mount point
from /sys/kernel/debug/tracing to /sys/kernel/tracing. Not sure where we
stand here.

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

* Re: [PATCH v2 5/7] qla2xxx: Enhance driver tracing with separate tunable and more
  2022-08-26 10:25 ` [PATCH v2 5/7] qla2xxx: Enhance driver tracing with separate tunable and more Nilesh Javali
  2022-08-29 16:24   ` Himanshu Madhani
@ 2022-08-30  8:07   ` Daniel Wagner
  2022-09-19 22:01   ` Guenter Roeck
  2 siblings, 0 replies; 23+ messages in thread
From: Daniel Wagner @ 2022-08-30  8:07 UTC (permalink / raw)
  To: Nilesh Javali
  Cc: martin.petersen, linux-scsi, GR-QLogic-Storage-Upstream,
	bhazarika, agurumurthy

On Fri, Aug 26, 2022 at 03:25:57AM -0700, Nilesh Javali wrote:
> From: Arun Easi <aeasi@marvell.com>
> 
> Older tracing of driver messages was to:
>     - log only debug messages to kernel main trace buffer AND
>     - log only if extended logging bits corresponding to this
>       message is off
> 
> This has been modified and extended as follows:
>     - Tracing is now controlled via ql2xextended_error_logging_ktrace
>       module parameter. Bit usages same as ql2xextended_error_logging.
>     - Tracing uses "qla2xxx" trace instance, unless instance creation
>       have issues.
>     - Tracing is enabled (compile time tunable).
>     - All driver messages, include debug and log messages are now traced
>       in kernel trace buffer.
> 
> Trace messages can be viewed by looking at the qla2xxx instance at:
>     /sys/kernel/tracing/instances/qla2xxx/trace

Nice! Thanks for getting this working.

> Trace tunable that takes the same bit mask as ql2xextended_error_logging
> is:
>     ql2xextended_error_logging_ktrace (default=1)
> 
> Suggested-by: Daniel Wagner <dwagner@suse.de>
> Suggested-by: Steven Rostedt <rostedt@goodmis.org>
> Signed-off-by: Arun Easi <aeasi@marvell.com>
> Signed-off-by: Nilesh Javali <njavali@marvell.com>

Reviewed-by: Daniel Wagner <dwagner@suse.de>


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

* Re: [PATCH v2 0/7] qla2xxx driver features
  2022-08-26 10:25 [PATCH v2 0/7] qla2xxx driver features Nilesh Javali
                   ` (6 preceding siblings ...)
  2022-08-26 10:25 ` [PATCH v2 7/7] qla2xxx: Update version to 10.02.07.900-k Nilesh Javali
@ 2022-09-01  4:31 ` Martin K. Petersen
  7 siblings, 0 replies; 23+ messages in thread
From: Martin K. Petersen @ 2022-09-01  4:31 UTC (permalink / raw)
  To: Nilesh Javali
  Cc: martin.petersen, linux-scsi, GR-QLogic-Storage-Upstream,
	bhazarika, agurumurthy


Nilesh,

> Please apply the qla2xxx driver features to the scsi tree at your
> earliest convenience.

Applied to 6.1/scsi-staging, thanks!

-- 
Martin K. Petersen	Oracle Linux Engineering

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

* Re: [PATCH v2 5/7] qla2xxx: Enhance driver tracing with separate tunable and more
  2022-08-30  7:55         ` Daniel Wagner
@ 2022-09-01 13:41           ` Steven Rostedt
  0 siblings, 0 replies; 23+ messages in thread
From: Steven Rostedt @ 2022-09-01 13:41 UTC (permalink / raw)
  To: Daniel Wagner
  Cc: Himanshu Madhani, Arun Easi, Nilesh Javali, Martin Petersen,
	linux-scsi, GR-QLogic-Storage-Upstream, bhazarika, agurumurthy

On Tue, 30 Aug 2022 09:55:54 +0200
Daniel Wagner <dwagner@suse.de> wrote:

> On Mon, Aug 29, 2022 at 07:25:34PM +0000, Himanshu Madhani wrote:
> > root@tatoonie~6.0.0-rc1+:/# ls -l /sys/kernel/tracing/
> > total 0
> > root@tatoonie~6.0.0-rc1+:/# ls -l /sys/kernel/debug/tracing/instances/qla2xxx/trace
> > -rw-r----- 1 root root 0 Aug 29 08:54 /sys/kernel/debug/tracing/instances/qla2xxx/trace  
> 
> IIRC, Steven's goal was to get all distros to move the mount point
> from /sys/kernel/debug/tracing to /sys/kernel/tracing. Not sure where we
> stand here.

I believe Fedora and Debian both have added it there.

Note, when mounting the debugfs file system to /sys/kernel/debug, tracefs
is automatically mounted at /sys/kernel/debug/tracing for backward
compatibility.

But the correct place to mount tracefs, is at /sys/kernel/tracing. Perhaps
I will remove the autmatic mounting of tracefs on debugfs when that becomes
the norm.

-- Steve

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

* Re: [PATCH v2 5/7] qla2xxx: Enhance driver tracing with separate tunable and more
  2022-08-26 10:25 ` [PATCH v2 5/7] qla2xxx: Enhance driver tracing with separate tunable and more Nilesh Javali
  2022-08-29 16:24   ` Himanshu Madhani
  2022-08-30  8:07   ` Daniel Wagner
@ 2022-09-19 22:01   ` Guenter Roeck
  2022-09-19 23:15     ` Arun Easi
  2 siblings, 1 reply; 23+ messages in thread
From: Guenter Roeck @ 2022-09-19 22:01 UTC (permalink / raw)
  To: Nilesh Javali
  Cc: martin.petersen, linux-scsi, GR-QLogic-Storage-Upstream,
	bhazarika, agurumurthy

On Fri, Aug 26, 2022 at 03:25:57AM -0700, Nilesh Javali wrote:
> From: Arun Easi <aeasi@marvell.com>
> 
> Older tracing of driver messages was to:
>     - log only debug messages to kernel main trace buffer AND
>     - log only if extended logging bits corresponding to this
>       message is off
> 
> This has been modified and extended as follows:
>     - Tracing is now controlled via ql2xextended_error_logging_ktrace
>       module parameter. Bit usages same as ql2xextended_error_logging.
>     - Tracing uses "qla2xxx" trace instance, unless instance creation
>       have issues.
>     - Tracing is enabled (compile time tunable).
>     - All driver messages, include debug and log messages are now traced
>       in kernel trace buffer.
> 
> Trace messages can be viewed by looking at the qla2xxx instance at:
>     /sys/kernel/tracing/instances/qla2xxx/trace
> 
> Trace tunable that takes the same bit mask as ql2xextended_error_logging
> is:
>     ql2xextended_error_logging_ktrace (default=1)
> 
> Suggested-by: Daniel Wagner <dwagner@suse.de>
> Suggested-by: Steven Rostedt <rostedt@goodmis.org>
> Signed-off-by: Arun Easi <aeasi@marvell.com>
> Signed-off-by: Nilesh Javali <njavali@marvell.com>

I understand this has already been reported early September, but then
the problem disapppeared in next-20220912 and reappeared in next-20220919.

This patch results in various test build failures. Example:

Building powerpc:skiroot_defconfig ... failed
--------------
Error log:
drivers/scsi/qla2xxx/qla_os.c: In function 'qla_trace_init':
drivers/scsi/qla2xxx/qla_os.c:2854:25: error:
	implicit declaration of function 'trace_array_get_by_name'; did you mean 'trace_array_set_clr_event'?

Guenter

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

* Re: [PATCH v2 5/7] qla2xxx: Enhance driver tracing with separate tunable and more
  2022-09-19 22:01   ` Guenter Roeck
@ 2022-09-19 23:15     ` Arun Easi
  0 siblings, 0 replies; 23+ messages in thread
From: Arun Easi @ 2022-09-19 23:15 UTC (permalink / raw)
  To: Guenter Roeck
  Cc: Nilesh Javali, martin.petersen, linux-scsi,
	GR-QLogic-Storage-Upstream, Bikash Hazarika, Anil Gurumurthy

Hi Guenter,

On Mon, 19 Sep 2022, 3:01pm, Guenter Roeck wrote:

> On Fri, Aug 26, 2022 at 03:25:57AM -0700, Nilesh Javali wrote:
> > From: Arun Easi <aeasi@marvell.com>
> > 
> > Older tracing of driver messages was to:
> >     - log only debug messages to kernel main trace buffer AND
> >     - log only if extended logging bits corresponding to this
> >       message is off
> > 
> > This has been modified and extended as follows:
> >     - Tracing is now controlled via ql2xextended_error_logging_ktrace
> >       module parameter. Bit usages same as ql2xextended_error_logging.
> >     - Tracing uses "qla2xxx" trace instance, unless instance creation
> >       have issues.
> >     - Tracing is enabled (compile time tunable).
> >     - All driver messages, include debug and log messages are now traced
> >       in kernel trace buffer.
> > 
> > Trace messages can be viewed by looking at the qla2xxx instance at:
> >     /sys/kernel/tracing/instances/qla2xxx/trace
> > 
> > Trace tunable that takes the same bit mask as ql2xextended_error_logging
> > is:
> >     ql2xextended_error_logging_ktrace (default=1)
> > 
> > Suggested-by: Daniel Wagner <dwagner@suse.de>
> > Suggested-by: Steven Rostedt <rostedt@goodmis.org>
> > Signed-off-by: Arun Easi <aeasi@marvell.com>
> > Signed-off-by: Nilesh Javali <njavali@marvell.com>
> 
> I understand this has already been reported early September, but then
> the problem disapppeared in next-20220912 and reappeared in next-20220919.
> 
> This patch results in various test build failures. Example:
> 
> Building powerpc:skiroot_defconfig ... failed
> --------------
> Error log:
> drivers/scsi/qla2xxx/qla_os.c: In function 'qla_trace_init':
> drivers/scsi/qla2xxx/qla_os.c:2854:25: error:
> 	implicit declaration of function 'trace_array_get_by_name'; did you mean 'trace_array_set_clr_event'?
> 
> Guenter
> 

Apologies for the troubles this patch has caused.

A fix for this is already posted (in trace.h), but is awaiting a final 
approval from the maintainer:

https://lore.kernel.org/linux-scsi/20220907233308.4153-2-aeasi@marvell.com/

Martin,

In the interest of time, and with more people running into the build 
failures, if you want to pick up "Ren Zhijie"'s fix posted earlier today 
with the fix all contained within the qla2xxx driver, feel free to go 
ahead (I will NAK my NAK in that case :o )

Regards,
-Arun

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

end of thread, other threads:[~2022-09-19 23:15 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-26 10:25 [PATCH v2 0/7] qla2xxx driver features Nilesh Javali
2022-08-26 10:25 ` [PATCH v2 1/7] Revert "scsi: qla2xxx: Fix response queue handler reading stale packets" Nilesh Javali
2022-08-29 16:09   ` Himanshu Madhani
2022-08-26 10:25 ` [PATCH v2 2/7] qla2xxx: Fix response queue handler reading stale packets Nilesh Javali
2022-08-29 16:10   ` Himanshu Madhani
2022-08-26 10:25 ` [PATCH v2 3/7] qla2xxx: Add debugfs create/delete helpers Nilesh Javali
2022-08-29 16:10   ` Himanshu Madhani
2022-08-26 10:25 ` [PATCH v2 4/7] qla2xxx: Add NVMe parameters support in Auxiliary Image Status Nilesh Javali
2022-08-29 16:15   ` Himanshu Madhani
2022-08-26 10:25 ` [PATCH v2 5/7] qla2xxx: Enhance driver tracing with separate tunable and more Nilesh Javali
2022-08-29 16:24   ` Himanshu Madhani
2022-08-29 16:59     ` Arun Easi
2022-08-29 19:25       ` Himanshu Madhani
2022-08-30  7:55         ` Daniel Wagner
2022-09-01 13:41           ` Steven Rostedt
2022-08-30  8:07   ` Daniel Wagner
2022-09-19 22:01   ` Guenter Roeck
2022-09-19 23:15     ` Arun Easi
2022-08-26 10:25 ` [PATCH v2 6/7] qla2xxx: define static symbols Nilesh Javali
2022-08-29 16:25   ` Himanshu Madhani
2022-08-26 10:25 ` [PATCH v2 7/7] qla2xxx: Update version to 10.02.07.900-k Nilesh Javali
2022-08-29 16:26   ` Himanshu Madhani
2022-09-01  4:31 ` [PATCH v2 0/7] qla2xxx driver features 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;
as well as URLs for NNTP newsgroup(s).