qla2xxx driver features
Subsystems (2)
Nilesh Javali
maintainerv2 cover qla2xxx driver features
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
Signature · 1 line
2.19.0.rc0
Nilesh Javali
maintainerPATCH v2 1/7 Revert "scsi: qla2xxx: Fix response queue handler reading stale packets"
From: Arun Easi <[email protected]>
Reverting this patch so that a fixed up patch, without adding new module parameters, could be submitted.
Link: https://lore.kernel.org/stable/[email protected]/
This reverts commit b1f707146923335849fb70237eec27d4d1ae7d62.
--- 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(-)
drivers/scsi/qla2xxx/qla_gbl.h +0 -2
@@ -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 );
drivers/scsi/qla2xxx/qla_isr.c +2 -23
@@ -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,
drivers/scsi/qla2xxx/qla_os.c +0 -10
@@ -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);
Signature · 1 line
2.19.0.rc0
Re: [PATCH v2 1/7] Revert "scsi: qla2xxx: Fix response queue handler reading stale packets"
Quoted 109 lines · Nilesh Javali
From: Arun Easi <[email protected]>
Reverting this patch so that a fixed up patch, without adding new module parameters, could be submitted.
Link: https://lore.kernel.org/stable/[email protected]/This reverts commit
b1f707146923335849fb70237eec27d4d1ae7d62.Signed-off-by Arun Easi <[email protected]>Signed-off-by Nilesh Javali <[email protected]>---
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(-)drivers/scsi/qla2xxx/qla_gbl.h +0
-2@@ -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 );drivers/scsi/qla2xxx/qla_isr.c +2
-23@@ -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,drivers/scsi/qla2xxx/qla_os.c +0
-10@@ -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);Signature · 1 line
2.19.0.rc0
Signature · 1 line
Himanshu Madhani Oracle Linux Engineering
Nilesh Javali
maintainerPATCH v2 2/7 qla2xxx: Fix response queue handler reading stale packets
In reply to Nilesh JavaliFrom: Arun Easi <[email protected]>
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.
--- drivers/scsi/qla2xxx/qla_isr.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-)
drivers/scsi/qla2xxx/qla_isr.c +15 -2
@@ -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,
Signature · 1 line
2.19.0.rc0
Re: [PATCH v2 2/7] qla2xxx: Fix response queue handler reading stale packets
Quoted 63 lines · Nilesh Javali
From: Arun Easi <[email protected]>
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.
Signed-off-by Arun Easi <[email protected]>Signed-off-by Nilesh Javali <[email protected]>---
drivers/scsi/qla2xxx/qla_isr.c| 17 +++++++++++++++--1 file changed, 15 insertions(+), 2 deletions(-)drivers/scsi/qla2xxx/qla_isr.c +15
-2@@ -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,Signature · 1 line
2.19.0.rc0
Signature · 1 line
Himanshu Madhani Oracle Linux Engineering
Nilesh Javali
maintainerPATCH v2 3/7 qla2xxx: Add debugfs create/delete helpers
In reply to Nilesh JavaliFrom: Arun Easi <[email protected]>
Define a few helpful macros for creating debugfs files.
--- drivers/scsi/qla2xxx/qla_def.h | 5 ++ drivers/scsi/qla2xxx/qla_dfs.c | 93 ++++++++++++++++++++++++++++++++++ 2 files changed, 98 insertions(+)
drivers/scsi/qla2xxx/qla_def.h +5 -0
@@ -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;
drivers/scsi/qla2xxx/qla_dfs.c +93 -0
99 lines not on this page · raw message
Signature · 1 line
2.19.0.rc0
Re: [PATCH v2 3/7] qla2xxx: Add debugfs create/delete helpers
Quoted 132 lines · Nilesh Javali
From: Arun Easi <[email protected]>
Define a few helpful macros for creating debugfs files.
Signed-off-by Arun Easi <[email protected]>Signed-off-by Nilesh Javali <[email protected]>---
drivers/scsi/qla2xxx/qla_def.h| 5 ++drivers/scsi/qla2xxx/qla_dfs.c| 93 ++++++++++++++++++++++++++++++++++2 files changed, 98 insertions(+)drivers/scsi/qla2xxx/qla_def.h +5
-0@@ -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;drivers/scsi/qla2xxx/qla_dfs.c +93
-0@@ -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) +
Quoted 6 lines
static int
qla_dfs_naqp_open(struct inode *inode, struct file *file){Signature · 1 line
2.19.0.rc0
Signature · 1 line
Himanshu Madhani Oracle Linux Engineering
Nilesh Javali
maintainerPATCH v2 4/7 qla2xxx: Add NVMe parameters support in Auxiliary Image Status
In reply to Nilesh JavaliFrom: Anil Gurumurthy <[email protected]>
Add new API to obtain the NVMe Parameters region status from the Auxiliary Image Status bitmap.
--- 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(-)
drivers/scsi/qla2xxx/qla_bsg.c +6 -2
@@ -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, ®ions,sizeof (regions));
drivers/scsi/qla2xxx/qla_bsg.h +2 -1
@@ -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"
drivers/scsi/qla2xxx/qla_def.h +2 -0
@@ -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
drivers/scsi/qla2xxx/qla_fw.h +3 -0
@@ -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 0x179struct qla_flt_region {__le16 code;
drivers/scsi/qla2xxx/qla_init.c +6 -2
@@ -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
Signature · 1 line
2.19.0.rc0
Re: [PATCH v2 4/7] qla2xxx: Add NVMe parameters support in Auxiliary Image Status
Quoted 132 lines · Nilesh Javali
From: Anil Gurumurthy <[email protected]>
Add new API to obtain the NVMe Parameters region status from the Auxiliary Image Status bitmap.
Signed-off-by Anil Gurumurthy <[email protected]>Signed-off-by Nilesh Javali <[email protected]>---
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(-)drivers/scsi/qla2xxx/qla_bsg.c +6
-2@@ -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, ®ions,sizeof (regions));drivers/scsi/qla2xxx/qla_bsg.h +2
-1@@ -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" drivers/scsi/qla2xxx/qla_def.h +2
-0@@ -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 2drivers/scsi/qla2xxx/qla_fw.h +3
-0@@ -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 0x179struct qla_flt_region {__le16 code;drivers/scsi/qla2xxx/qla_init.c +3
-0@@ -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
drivers/scsi/qla2xxx/qla_init.c +3
-2@@ -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); }
Quoted 4 lines
void
Signature · 1 line
2.19.0.rc0
Signature · 1 line
Himanshu Madhani Oracle Linux Engineering
Nilesh Javali
maintainerPATCH v2 5/7 qla2xxx: Enhance driver tracing with separate tunable and more
In reply to Nilesh JavaliFrom: Arun Easi <[email protected]>
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)
--- 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(-)
drivers/scsi/qla2xxx/qla_dbg.c +36 -14
@@ -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);
drivers/scsi/qla2xxx/qla_dbg.h +43 -0
46 lines not on this page · raw message
drivers/scsi/qla2xxx/qla_gbl.h +1 -0
@@ -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;
drivers/scsi/qla2xxx/qla_os.c +35 -0
@@ -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);
Signature · 1 line
2.19.0.rc0
Re: [PATCH v2 5/7] qla2xxx: Enhance driver tracing with separate tunable and more
Small nits
Quoted 18 lines · Nilesh Javali
From: Arun Easi <[email protected]>
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 offThis has been modified and extended as follows:
- Tracing is now controlled viaql2xextended_error_logging_ktracemodule parameter. Bit usages same asql2xextended_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.
Quoted 3 lines
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
Quoted 300 lines
Trace tunable that takes the same bit mask as
ql2xextended_error_loggingis:
ql2xextended_error_logging_ktrace(default=1)Suggested-by Daniel Wagner <[email protected]>Suggested-by Steven Rostedt <[email protected]>Signed-off-by Arun Easi <[email protected]>Signed-off-by Nilesh Javali <[email protected]>---
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(-)drivers/scsi/qla2xxx/qla_dbg.c +36
-14@@ -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);drivers/scsi/qla2xxx/qla_dbg.h +43
-0@@ -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 */ drivers/scsi/qla2xxx/qla_gbl.h +1
-0@@ -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;drivers/scsi/qla2xxx/qla_os.c +32
-0@@ -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);drivers/scsi/qla2xxx/qla_os.c +2
-0+ +qla_trace_uninit ();return ret; }drivers/scsi/qla2xxx/qla_os.c +1
-0@@ -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);Signature · 1 line
2.19.0.rc0
When you fix the commit message.
Signature · 1 line
Himanshu Madhani Oracle Linux Engineering
Re: [PATCH v2 5/7] qla2xxx: Enhance driver tracing with separate tunable and more
Thanks for reviewing the code, Himanshu. Response inline..
Quoted 20 lines · Himanshu Madhani
Small nits
Quoted 18 lines · Nilesh Javali
From: Arun Easi <[email protected]>
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 offThis has been modified and extended as follows:
- Tracing is now controlled viaql2xextended_error_logging_ktracemodule parameter. Bit usages same asql2xextended_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.
Quoted 6 lines
Quoted 3 lines
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
Himanshu Madhani
Tested-byRe: [PATCH v2 5/7] qla2xxx: Enhance driver tracing with separate tunable and more
Quoted 31 lines · Arun Easi
Thanks for reviewing the code, Himanshu. Response inline..
Quoted 23 lines · Himanshu Madhani
Small nits
Quoted 21 lines · Nilesh Javali
From: Arun Easi <[email protected]>
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 offThis has been modified and extended as follows:
- Tracing is now controlled viaql2xextended_error_logging_ktracemodule parameter. Bit usages same asql2xextended_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
Quoted 9 lines
Quoted 3 lines
^^^^^^^^
This should be/sys/kernel/debug/tracing/instances/qla2xxx/traceWith 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
Quoted 3 lines
Regards,
-Arun
PS: # grep -A 10 '^The File System'Documentation/trace/ftrace.rst
Signature · 1 line
Himanshu Madhani Oracle Linux Engineering
Re: [PATCH v2 5/7] qla2xxx: Enhance driver tracing with separate tunable and more
Quoted 4 lines · Himanshu Madhani
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.
Re: [PATCH v2 5/7] qla2xxx: Enhance driver tracing with separate tunable and more
Quoted 9 lines · On Tue, 30 Aug 2022 09:55:54 +0200 Daniel Wagner <[email protected]> wrote:
Quoted 4 lines · Himanshu Madhani
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/traceIIRC, Steven's goal was to get all distros to move the mount point from
/sys/kernel/debug/tracingto/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
Re: [PATCH v2 5/7] qla2xxx: Enhance driver tracing with separate tunable and more
In reply to Nilesh JavaliQuoted 16 lines · Nilesh Javali
From: Arun Easi <[email protected]>
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 offThis has been modified and extended as follows:
- Tracing is now controlled viaql2xextended_error_logging_ktracemodule parameter. Bit usages same asql2xextended_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.
Quoted 2 lines
Trace messages can be viewed by looking at the qla2xxx instance at:
/sys/kernel/tracing/instances/qla2xxx/trace
Nice! Thanks for getting this working.
Quoted 8 lines
Trace tunable that takes the same bit mask as
ql2xextended_error_loggingis:
ql2xextended_error_logging_ktrace(default=1)Suggested-by Daniel Wagner <[email protected]>Suggested-by Steven Rostedt <[email protected]>Signed-off-by Arun Easi <[email protected]>Signed-off-by Nilesh Javali <[email protected]>
Re: [PATCH v2 5/7] qla2xxx: Enhance driver tracing with separate tunable and more
In reply to Nilesh JavaliQuoted 19 lines · Nilesh Javali
From: Arun Easi <[email protected]>
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 offThis has been modified and extended as follows:
- Tracing is now controlled viaql2xextended_error_logging_ktracemodule parameter. Bit usages same asql2xextended_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
Quoted 8 lines
Trace tunable that takes the same bit mask as
ql2xextended_error_loggingis:
ql2xextended_error_logging_ktrace(default=1)Suggested-by Daniel Wagner <[email protected]>Suggested-by Steven Rostedt <[email protected]>Signed-off-by Arun Easi <[email protected]>Signed-off-by Nilesh Javali <[email protected]>
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
Re: [PATCH v2 5/7] qla2xxx: Enhance driver tracing with separate tunable and more
Hi Guenter,
Quoted 34 lines · Guenter Roeck
Quoted 19 lines · Nilesh Javali
From: Arun Easi <[email protected]>
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 offThis has been modified and extended as follows:
- Tracing is now controlled viaql2xextended_error_logging_ktracemodule parameter. Bit usages same asql2xextended_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/traceQuoted 8 lines
Trace tunable that takes the same bit mask as
ql2xextended_error_loggingis:
ql2xextended_error_logging_ktrace(default=1)Suggested-by Daniel Wagner <[email protected]>Suggested-by Steven Rostedt <[email protected]>Signed-off-by Arun Easi <[email protected]>Signed-off-by Nilesh Javali <[email protected]>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:
Quoted 9 lines
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/[email protected]/
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
Nilesh Javali
maintainerPATCH v2 6/7 qla2xxx: define static symbols
In reply to Nilesh Javalidrivers/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.
--- drivers/scsi/qla2xxx/qla_os.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/scsi/qla2xxx/qla_os.c +2 -2
@@ -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" );
Signature · 1 line
2.19.0.rc0
Re: [PATCH v2 6/7] qla2xxx: define static symbols
Quoted 45 lines · Nilesh Javali
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_arrayandql2xdelay_before_pci_error_handlingas static to fix sparse warnings.Reported-by kernel test robot <[email protected]>Signed-off-by Nilesh Javali <[email protected]>---
drivers/scsi/qla2xxx/qla_os.c| 4 ++--1 file changed, 2 insertions(+), 2 deletions(-)drivers/scsi/qla2xxx/qla_os.c +2
-2@@ -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" );Signature · 1 line
2.19.0.rc0
Signature · 1 line
Himanshu Madhani Oracle Linux Engineering
Nilesh Javali
maintainerPATCH v2 7/7 qla2xxx: Update version to 10.02.07.900-k
In reply to Nilesh Javali--- drivers/scsi/qla2xxx/qla_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/scsi/qla2xxx/qla_version.h +2 -2
@@ -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
Signature · 1 line
2.19.0.rc0
Re: [PATCH v2 7/7] qla2xxx: Update version to 10.02.07.900-k
Quoted 28 lines · Nilesh Javali
Signed-off-by Nilesh Javali <[email protected]>---
drivers/scsi/qla2xxx/qla_version.h| 4 ++--1 file changed, 2 insertions(+), 2 deletions(-)drivers/scsi/qla2xxx/qla_version.h +2
-2@@ -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 900Signature · 1 line
2.19.0.rc0
Signature · 1 line
Himanshu Madhani Oracle Linux Engineering
Martin K. Petersen
AppliedNilesh,
Quoted 2 lines
Please apply the qla2xxx driver features to the scsi tree at your earliest convenience.
Applied to 6.1/scsi-staging, thanks!
Signature · 1 line
Martin K. Petersen Oracle Linux Engineering