James Smart | 858c9f6 | 2007-06-17 19:56:39 -0500 | [diff] [blame] | 1 | /******************************************************************* |
| 2 | * This file is part of the Emulex Linux Device Driver for * |
| 3 | * Fibre Channel Host Bus Adapters. * |
James Smart | 0d04121 | 2019-01-28 11:14:41 -0800 | [diff] [blame] | 4 | * Copyright (C) 2017-2019 Broadcom. All Rights Reserved. The term * |
James Smart | 4ae2ebd | 2018-06-26 08:24:31 -0700 | [diff] [blame] | 5 | * “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. * |
James Smart | 2a622bf | 2011-02-16 12:40:06 -0500 | [diff] [blame] | 6 | * Copyright (C) 2007-2011 Emulex. All rights reserved. * |
James Smart | 858c9f6 | 2007-06-17 19:56:39 -0500 | [diff] [blame] | 7 | * EMULEX and SLI are trademarks of Emulex. * |
James Smart | d080abe | 2017-02-12 13:52:39 -0800 | [diff] [blame] | 8 | * www.broadcom.com * |
James Smart | 858c9f6 | 2007-06-17 19:56:39 -0500 | [diff] [blame] | 9 | * * |
| 10 | * This program is free software; you can redistribute it and/or * |
| 11 | * modify it under the terms of version 2 of the GNU General * |
| 12 | * Public License as published by the Free Software Foundation. * |
| 13 | * This program is distributed in the hope that it will be useful. * |
| 14 | * ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND * |
| 15 | * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, * |
| 16 | * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT, ARE * |
| 17 | * DISCLAIMED, EXCEPT TO THE EXTENT THAT SUCH DISCLAIMERS ARE HELD * |
| 18 | * TO BE LEGALLY INVALID. See the GNU General Public License for * |
| 19 | * more details, a copy of which can be found in the file COPYING * |
| 20 | * included with this package. * |
| 21 | *******************************************************************/ |
| 22 | |
| 23 | #ifndef _H_LPFC_DEBUG_FS |
| 24 | #define _H_LPFC_DEBUG_FS |
| 25 | |
James Smart | 923e4b6 | 2008-12-04 22:40:07 -0500 | [diff] [blame] | 26 | #ifdef CONFIG_SCSI_LPFC_DEBUG_FS |
James Smart | 2a622bf | 2011-02-16 12:40:06 -0500 | [diff] [blame] | 27 | |
| 28 | /* size of output line, for discovery_trace and slow_ring_trace */ |
| 29 | #define LPFC_DEBUG_TRC_ENTRY_SIZE 100 |
| 30 | |
| 31 | /* nodelist output buffer size */ |
| 32 | #define LPFC_NODELIST_SIZE 8192 |
| 33 | #define LPFC_NODELIST_ENTRY_SIZE 120 |
| 34 | |
| 35 | /* dumpHBASlim output buffer size */ |
| 36 | #define LPFC_DUMPHBASLIM_SIZE 4096 |
| 37 | |
| 38 | /* dumpHostSlim output buffer size */ |
| 39 | #define LPFC_DUMPHOSTSLIM_SIZE 4096 |
| 40 | |
James Smart | b84daac | 2012-08-03 12:35:13 -0400 | [diff] [blame] | 41 | /* dumpSLIqinfo output buffer size */ |
| 42 | #define LPFC_DUMPSLIQINFO_SIZE 4096 |
| 43 | |
James Smart | 2a622bf | 2011-02-16 12:40:06 -0500 | [diff] [blame] | 44 | /* hbqinfo output buffer size */ |
| 45 | #define LPFC_HBQINFO_SIZE 8192 |
| 46 | |
James Smart | bd2cdd5 | 2017-02-12 13:52:33 -0800 | [diff] [blame] | 47 | /* nvmestat output buffer size */ |
| 48 | #define LPFC_NVMESTAT_SIZE 8192 |
James Smart | 2fcbc56 | 2020-03-22 11:13:02 -0700 | [diff] [blame] | 49 | #define LPFC_IOKTIME_SIZE 8192 |
James Smart | bd2cdd5 | 2017-02-12 13:52:33 -0800 | [diff] [blame] | 50 | #define LPFC_NVMEIO_TRC_SIZE 8192 |
| 51 | |
James Smart | 4c47efc | 2019-01-28 11:14:25 -0800 | [diff] [blame] | 52 | /* scsistat output buffer size */ |
| 53 | #define LPFC_SCSISTAT_SIZE 8192 |
| 54 | |
James Smart | bd2cdd5 | 2017-02-12 13:52:33 -0800 | [diff] [blame] | 55 | #define LPFC_DEBUG_OUT_LINE_SZ 80 |
| 56 | |
James Smart | b76f2dc | 2011-07-22 18:37:42 -0400 | [diff] [blame] | 57 | /* |
| 58 | * For SLI4 iDiag debugfs diagnostics tool |
| 59 | */ |
| 60 | |
James Smart | 86a8084 | 2011-04-16 11:03:04 -0400 | [diff] [blame] | 61 | /* pciConf */ |
| 62 | #define LPFC_PCI_CFG_BROWSE 0xffff |
| 63 | #define LPFC_PCI_CFG_RD_CMD_ARG 2 |
| 64 | #define LPFC_PCI_CFG_WR_CMD_ARG 3 |
James Smart | 2a622bf | 2011-02-16 12:40:06 -0500 | [diff] [blame] | 65 | #define LPFC_PCI_CFG_SIZE 4096 |
James Smart | 2a622bf | 2011-02-16 12:40:06 -0500 | [diff] [blame] | 66 | #define LPFC_PCI_CFG_RD_SIZE (LPFC_PCI_CFG_SIZE/4) |
| 67 | |
James Smart | b76f2dc | 2011-07-22 18:37:42 -0400 | [diff] [blame] | 68 | #define IDIAG_PCICFG_WHERE_INDX 0 |
| 69 | #define IDIAG_PCICFG_COUNT_INDX 1 |
| 70 | #define IDIAG_PCICFG_VALUE_INDX 2 |
| 71 | |
| 72 | /* barAcc */ |
| 73 | #define LPFC_PCI_BAR_BROWSE 0xffff |
| 74 | #define LPFC_PCI_BAR_RD_CMD_ARG 3 |
| 75 | #define LPFC_PCI_BAR_WR_CMD_ARG 3 |
| 76 | |
| 77 | #define LPFC_PCI_IF0_BAR0_SIZE (1024 * 16) |
| 78 | #define LPFC_PCI_IF0_BAR1_SIZE (1024 * 128) |
| 79 | #define LPFC_PCI_IF0_BAR2_SIZE (1024 * 128) |
| 80 | #define LPFC_PCI_IF2_BAR0_SIZE (1024 * 32) |
| 81 | |
| 82 | #define LPFC_PCI_BAR_RD_BUF_SIZE 4096 |
| 83 | #define LPFC_PCI_BAR_RD_SIZE (LPFC_PCI_BAR_RD_BUF_SIZE/4) |
| 84 | |
| 85 | #define LPFC_PCI_IF0_BAR0_RD_SIZE (LPFC_PCI_IF0_BAR0_SIZE/4) |
| 86 | #define LPFC_PCI_IF0_BAR1_RD_SIZE (LPFC_PCI_IF0_BAR1_SIZE/4) |
| 87 | #define LPFC_PCI_IF0_BAR2_RD_SIZE (LPFC_PCI_IF0_BAR2_SIZE/4) |
| 88 | #define LPFC_PCI_IF2_BAR0_RD_SIZE (LPFC_PCI_IF2_BAR0_SIZE/4) |
| 89 | |
| 90 | #define IDIAG_BARACC_BAR_NUM_INDX 0 |
| 91 | #define IDIAG_BARACC_OFF_SET_INDX 1 |
| 92 | #define IDIAG_BARACC_ACC_MOD_INDX 2 |
| 93 | #define IDIAG_BARACC_REG_VAL_INDX 2 |
| 94 | #define IDIAG_BARACC_BAR_SZE_INDX 3 |
| 95 | |
| 96 | #define IDIAG_BARACC_BAR_0 0 |
| 97 | #define IDIAG_BARACC_BAR_1 1 |
| 98 | #define IDIAG_BARACC_BAR_2 2 |
| 99 | |
| 100 | #define SINGLE_WORD 1 |
| 101 | |
James Smart | 86a8084 | 2011-04-16 11:03:04 -0400 | [diff] [blame] | 102 | /* queue info */ |
| 103 | #define LPFC_QUE_INFO_GET_BUF_SIZE 4096 |
| 104 | |
| 105 | /* queue acc */ |
| 106 | #define LPFC_QUE_ACC_BROWSE 0xffff |
| 107 | #define LPFC_QUE_ACC_RD_CMD_ARG 4 |
| 108 | #define LPFC_QUE_ACC_WR_CMD_ARG 6 |
| 109 | #define LPFC_QUE_ACC_BUF_SIZE 4096 |
| 110 | #define LPFC_QUE_ACC_SIZE (LPFC_QUE_ACC_BUF_SIZE/2) |
| 111 | |
| 112 | #define LPFC_IDIAG_EQ 1 |
| 113 | #define LPFC_IDIAG_CQ 2 |
| 114 | #define LPFC_IDIAG_MQ 3 |
| 115 | #define LPFC_IDIAG_WQ 4 |
| 116 | #define LPFC_IDIAG_RQ 5 |
| 117 | |
James Smart | b76f2dc | 2011-07-22 18:37:42 -0400 | [diff] [blame] | 118 | #define IDIAG_QUEACC_QUETP_INDX 0 |
| 119 | #define IDIAG_QUEACC_QUEID_INDX 1 |
| 120 | #define IDIAG_QUEACC_INDEX_INDX 2 |
| 121 | #define IDIAG_QUEACC_COUNT_INDX 3 |
| 122 | #define IDIAG_QUEACC_OFFST_INDX 4 |
| 123 | #define IDIAG_QUEACC_VALUE_INDX 5 |
| 124 | |
| 125 | /* doorbell register acc */ |
James Smart | 86a8084 | 2011-04-16 11:03:04 -0400 | [diff] [blame] | 126 | #define LPFC_DRB_ACC_ALL 0xffff |
| 127 | #define LPFC_DRB_ACC_RD_CMD_ARG 1 |
| 128 | #define LPFC_DRB_ACC_WR_CMD_ARG 2 |
| 129 | #define LPFC_DRB_ACC_BUF_SIZE 256 |
| 130 | |
James Smart | 9dd3542 | 2018-02-22 08:18:41 -0800 | [diff] [blame] | 131 | #define LPFC_DRB_EQ 1 |
| 132 | #define LPFC_DRB_CQ 2 |
| 133 | #define LPFC_DRB_MQ 3 |
| 134 | #define LPFC_DRB_WQ 4 |
| 135 | #define LPFC_DRB_RQ 5 |
James Smart | 86a8084 | 2011-04-16 11:03:04 -0400 | [diff] [blame] | 136 | |
James Smart | 9dd3542 | 2018-02-22 08:18:41 -0800 | [diff] [blame] | 137 | #define LPFC_DRB_MAX 5 |
James Smart | 2a622bf | 2011-02-16 12:40:06 -0500 | [diff] [blame] | 138 | |
James Smart | b76f2dc | 2011-07-22 18:37:42 -0400 | [diff] [blame] | 139 | #define IDIAG_DRBACC_REGID_INDX 0 |
| 140 | #define IDIAG_DRBACC_VALUE_INDX 1 |
| 141 | |
| 142 | /* control register acc */ |
| 143 | #define LPFC_CTL_ACC_ALL 0xffff |
| 144 | #define LPFC_CTL_ACC_RD_CMD_ARG 1 |
| 145 | #define LPFC_CTL_ACC_WR_CMD_ARG 2 |
| 146 | #define LPFC_CTL_ACC_BUF_SIZE 256 |
| 147 | |
| 148 | #define LPFC_CTL_PORT_SEM 1 |
| 149 | #define LPFC_CTL_PORT_STA 2 |
| 150 | #define LPFC_CTL_PORT_CTL 3 |
| 151 | #define LPFC_CTL_PORT_ER1 4 |
| 152 | #define LPFC_CTL_PORT_ER2 5 |
| 153 | #define LPFC_CTL_PDEV_CTL 6 |
| 154 | |
| 155 | #define LPFC_CTL_MAX 6 |
| 156 | |
| 157 | #define IDIAG_CTLACC_REGID_INDX 0 |
| 158 | #define IDIAG_CTLACC_VALUE_INDX 1 |
| 159 | |
| 160 | /* mailbox access */ |
| 161 | #define LPFC_MBX_DMP_ARG 4 |
| 162 | |
| 163 | #define LPFC_MBX_ACC_BUF_SIZE 512 |
| 164 | #define LPFC_MBX_ACC_LBUF_SZ 128 |
| 165 | |
| 166 | #define LPFC_MBX_DMP_MBX_WORD 0x00000001 |
| 167 | #define LPFC_MBX_DMP_MBX_BYTE 0x00000002 |
| 168 | #define LPFC_MBX_DMP_MBX_ALL (LPFC_MBX_DMP_MBX_WORD | LPFC_MBX_DMP_MBX_BYTE) |
| 169 | |
| 170 | #define LPFC_BSG_DMP_MBX_RD_MBX 0x00000001 |
| 171 | #define LPFC_BSG_DMP_MBX_RD_BUF 0x00000002 |
| 172 | #define LPFC_BSG_DMP_MBX_WR_MBX 0x00000004 |
| 173 | #define LPFC_BSG_DMP_MBX_WR_BUF 0x00000008 |
| 174 | #define LPFC_BSG_DMP_MBX_ALL (LPFC_BSG_DMP_MBX_RD_MBX | \ |
| 175 | LPFC_BSG_DMP_MBX_RD_BUF | \ |
| 176 | LPFC_BSG_DMP_MBX_WR_MBX | \ |
| 177 | LPFC_BSG_DMP_MBX_WR_BUF) |
| 178 | |
| 179 | #define LPFC_MBX_DMP_ALL 0xffff |
| 180 | #define LPFC_MBX_ALL_CMD 0xff |
| 181 | |
| 182 | #define IDIAG_MBXACC_MBCMD_INDX 0 |
| 183 | #define IDIAG_MBXACC_DPMAP_INDX 1 |
| 184 | #define IDIAG_MBXACC_DPCNT_INDX 2 |
| 185 | #define IDIAG_MBXACC_WDCNT_INDX 3 |
| 186 | |
| 187 | /* extents access */ |
| 188 | #define LPFC_EXT_ACC_CMD_ARG 1 |
| 189 | #define LPFC_EXT_ACC_BUF_SIZE 4096 |
| 190 | |
| 191 | #define LPFC_EXT_ACC_AVAIL 0x1 |
| 192 | #define LPFC_EXT_ACC_ALLOC 0x2 |
| 193 | #define LPFC_EXT_ACC_DRIVR 0x4 |
| 194 | #define LPFC_EXT_ACC_ALL (LPFC_EXT_ACC_DRIVR | \ |
| 195 | LPFC_EXT_ACC_AVAIL | \ |
| 196 | LPFC_EXT_ACC_ALLOC) |
| 197 | |
| 198 | #define IDIAG_EXTACC_EXMAP_INDX 0 |
| 199 | |
James Smart | 2a622bf | 2011-02-16 12:40:06 -0500 | [diff] [blame] | 200 | #define SIZE_U8 sizeof(uint8_t) |
| 201 | #define SIZE_U16 sizeof(uint16_t) |
| 202 | #define SIZE_U32 sizeof(uint32_t) |
| 203 | |
James Smart | bd2cdd5 | 2017-02-12 13:52:33 -0800 | [diff] [blame] | 204 | #define lpfc_nvmeio_data(phba, fmt, arg...) \ |
| 205 | { \ |
| 206 | if (phba->nvmeio_trc_on) \ |
| 207 | lpfc_debugfs_nvme_trc(phba, fmt, ##arg); \ |
| 208 | } |
| 209 | |
James Smart | 2a622bf | 2011-02-16 12:40:06 -0500 | [diff] [blame] | 210 | struct lpfc_debug { |
| 211 | char *i_private; |
| 212 | char op; |
| 213 | #define LPFC_IDIAG_OP_RD 1 |
| 214 | #define LPFC_IDIAG_OP_WR 2 |
| 215 | char *buffer; |
| 216 | int len; |
| 217 | }; |
| 218 | |
James Smart | a58cbd5 | 2007-08-02 11:09:43 -0400 | [diff] [blame] | 219 | struct lpfc_debugfs_trc { |
James Smart | 858c9f6 | 2007-06-17 19:56:39 -0500 | [diff] [blame] | 220 | char *fmt; |
| 221 | uint32_t data1; |
| 222 | uint32_t data2; |
| 223 | uint32_t data3; |
| 224 | uint32_t seq_cnt; |
| 225 | unsigned long jif; |
| 226 | }; |
James Smart | 2a622bf | 2011-02-16 12:40:06 -0500 | [diff] [blame] | 227 | |
James Smart | bd2cdd5 | 2017-02-12 13:52:33 -0800 | [diff] [blame] | 228 | struct lpfc_debugfs_nvmeio_trc { |
| 229 | char *fmt; |
| 230 | uint16_t data1; |
| 231 | uint16_t data2; |
| 232 | uint32_t data3; |
| 233 | }; |
| 234 | |
James Smart | 2a622bf | 2011-02-16 12:40:06 -0500 | [diff] [blame] | 235 | struct lpfc_idiag_offset { |
| 236 | uint32_t last_rd; |
| 237 | }; |
| 238 | |
James Smart | 86a8084 | 2011-04-16 11:03:04 -0400 | [diff] [blame] | 239 | #define LPFC_IDIAG_CMD_DATA_SIZE 8 |
James Smart | 2a622bf | 2011-02-16 12:40:06 -0500 | [diff] [blame] | 240 | struct lpfc_idiag_cmd { |
| 241 | uint32_t opcode; |
| 242 | #define LPFC_IDIAG_CMD_PCICFG_RD 0x00000001 |
| 243 | #define LPFC_IDIAG_CMD_PCICFG_WR 0x00000002 |
| 244 | #define LPFC_IDIAG_CMD_PCICFG_ST 0x00000003 |
| 245 | #define LPFC_IDIAG_CMD_PCICFG_CL 0x00000004 |
James Smart | 86a8084 | 2011-04-16 11:03:04 -0400 | [diff] [blame] | 246 | |
James Smart | b76f2dc | 2011-07-22 18:37:42 -0400 | [diff] [blame] | 247 | #define LPFC_IDIAG_CMD_BARACC_RD 0x00000008 |
| 248 | #define LPFC_IDIAG_CMD_BARACC_WR 0x00000009 |
| 249 | #define LPFC_IDIAG_CMD_BARACC_ST 0x0000000a |
| 250 | #define LPFC_IDIAG_CMD_BARACC_CL 0x0000000b |
| 251 | |
James Smart | 86a8084 | 2011-04-16 11:03:04 -0400 | [diff] [blame] | 252 | #define LPFC_IDIAG_CMD_QUEACC_RD 0x00000011 |
| 253 | #define LPFC_IDIAG_CMD_QUEACC_WR 0x00000012 |
| 254 | #define LPFC_IDIAG_CMD_QUEACC_ST 0x00000013 |
| 255 | #define LPFC_IDIAG_CMD_QUEACC_CL 0x00000014 |
| 256 | |
| 257 | #define LPFC_IDIAG_CMD_DRBACC_RD 0x00000021 |
| 258 | #define LPFC_IDIAG_CMD_DRBACC_WR 0x00000022 |
| 259 | #define LPFC_IDIAG_CMD_DRBACC_ST 0x00000023 |
| 260 | #define LPFC_IDIAG_CMD_DRBACC_CL 0x00000024 |
James Smart | b76f2dc | 2011-07-22 18:37:42 -0400 | [diff] [blame] | 261 | |
| 262 | #define LPFC_IDIAG_CMD_CTLACC_RD 0x00000031 |
| 263 | #define LPFC_IDIAG_CMD_CTLACC_WR 0x00000032 |
| 264 | #define LPFC_IDIAG_CMD_CTLACC_ST 0x00000033 |
| 265 | #define LPFC_IDIAG_CMD_CTLACC_CL 0x00000034 |
| 266 | |
| 267 | #define LPFC_IDIAG_CMD_MBXACC_DP 0x00000041 |
| 268 | #define LPFC_IDIAG_BSG_MBXACC_DP 0x00000042 |
| 269 | |
| 270 | #define LPFC_IDIAG_CMD_EXTACC_RD 0x00000051 |
| 271 | |
James Smart | 2a622bf | 2011-02-16 12:40:06 -0500 | [diff] [blame] | 272 | uint32_t data[LPFC_IDIAG_CMD_DATA_SIZE]; |
| 273 | }; |
| 274 | |
| 275 | struct lpfc_idiag { |
| 276 | uint32_t active; |
| 277 | struct lpfc_idiag_cmd cmd; |
| 278 | struct lpfc_idiag_offset offset; |
James Smart | 86a8084 | 2011-04-16 11:03:04 -0400 | [diff] [blame] | 279 | void *ptr_private; |
James Smart | 2a622bf | 2011-02-16 12:40:06 -0500 | [diff] [blame] | 280 | }; |
Arnd Bergmann | 223b78e | 2017-03-23 15:53:45 +0100 | [diff] [blame] | 281 | |
| 282 | #else |
| 283 | |
| 284 | #define lpfc_nvmeio_data(phba, fmt, arg...) \ |
| 285 | no_printk(fmt, ##arg) |
| 286 | |
James Smart | 858c9f6 | 2007-06-17 19:56:39 -0500 | [diff] [blame] | 287 | #endif |
| 288 | |
James Smart | c490850 | 2019-01-28 11:14:28 -0800 | [diff] [blame] | 289 | /* multixripool output buffer size */ |
| 290 | #define LPFC_DUMP_MULTIXRIPOOL_SIZE 8192 |
| 291 | |
Arnd Bergmann | 223b78e | 2017-03-23 15:53:45 +0100 | [diff] [blame] | 292 | enum { |
James Smart | c00f62e | 2019-08-14 16:57:11 -0700 | [diff] [blame] | 293 | DUMP_IO, |
Arnd Bergmann | 223b78e | 2017-03-23 15:53:45 +0100 | [diff] [blame] | 294 | DUMP_MBX, |
| 295 | DUMP_ELS, |
| 296 | DUMP_NVMELS, |
| 297 | }; |
| 298 | |
James Smart | 858c9f6 | 2007-06-17 19:56:39 -0500 | [diff] [blame] | 299 | /* Mask for discovery_trace */ |
| 300 | #define LPFC_DISC_TRC_ELS_CMD 0x1 /* Trace ELS commands */ |
| 301 | #define LPFC_DISC_TRC_ELS_RSP 0x2 /* Trace ELS response */ |
| 302 | #define LPFC_DISC_TRC_ELS_UNSOL 0x4 /* Trace ELS rcv'ed */ |
| 303 | #define LPFC_DISC_TRC_ELS_ALL 0x7 /* Trace ELS */ |
| 304 | #define LPFC_DISC_TRC_MBOX_VPORT 0x8 /* Trace vport MBOXs */ |
| 305 | #define LPFC_DISC_TRC_MBOX 0x10 /* Trace other MBOXs */ |
| 306 | #define LPFC_DISC_TRC_MBOX_ALL 0x18 /* Trace all MBOXs */ |
| 307 | #define LPFC_DISC_TRC_CT 0x20 /* Trace disc CT requests */ |
| 308 | #define LPFC_DISC_TRC_DSM 0x40 /* Trace DSM events */ |
| 309 | #define LPFC_DISC_TRC_RPORT 0x80 /* Trace rport events */ |
| 310 | #define LPFC_DISC_TRC_NODE 0x100 /* Trace ndlp state changes */ |
| 311 | |
| 312 | #define LPFC_DISC_TRC_DISCOVERY 0xef /* common mask for general |
| 313 | * discovery */ |
| 314 | #endif /* H_LPFC_DEBUG_FS */ |
James Smart | 809c753 | 2012-05-09 21:19:25 -0400 | [diff] [blame] | 315 | |
| 316 | |
| 317 | /* |
| 318 | * Driver debug utility routines outside of debugfs. The debug utility |
| 319 | * routines implemented here is intended to be used in the instrumented |
| 320 | * debug driver for debugging host or port issues. |
| 321 | */ |
| 322 | |
| 323 | /** |
| 324 | * lpfc_debug_dump_qe - dump an specific entry from a queue |
| 325 | * @q: Pointer to the queue descriptor. |
| 326 | * @idx: Index to the entry on the queue. |
| 327 | * |
| 328 | * This function dumps an entry indexed by @idx from a queue specified by the |
| 329 | * queue descriptor @q. |
| 330 | **/ |
Arnd Bergmann | 057959c | 2019-06-28 14:37:47 +0200 | [diff] [blame] | 331 | static void |
James Smart | 809c753 | 2012-05-09 21:19:25 -0400 | [diff] [blame] | 332 | lpfc_debug_dump_qe(struct lpfc_queue *q, uint32_t idx) |
| 333 | { |
| 334 | char line_buf[LPFC_LBUF_SZ]; |
| 335 | int i, esize, qe_word_cnt, len; |
| 336 | uint32_t *pword; |
| 337 | |
| 338 | /* sanity checks */ |
| 339 | if (!q) |
| 340 | return; |
| 341 | if (idx >= q->entry_count) |
| 342 | return; |
| 343 | |
| 344 | esize = q->entry_size; |
| 345 | qe_word_cnt = esize / sizeof(uint32_t); |
James Smart | 9afbee3 | 2019-03-12 16:30:28 -0700 | [diff] [blame] | 346 | pword = lpfc_sli4_qe(q, idx); |
James Smart | 809c753 | 2012-05-09 21:19:25 -0400 | [diff] [blame] | 347 | |
| 348 | len = 0; |
Silvio Cesare | e7f7b6f | 2019-03-21 09:44:32 -0700 | [diff] [blame] | 349 | len += scnprintf(line_buf+len, LPFC_LBUF_SZ-len, "QE[%04d]: ", idx); |
James Smart | 809c753 | 2012-05-09 21:19:25 -0400 | [diff] [blame] | 350 | if (qe_word_cnt > 8) |
| 351 | printk(KERN_ERR "%s\n", line_buf); |
| 352 | |
| 353 | for (i = 0; i < qe_word_cnt; i++) { |
| 354 | if (!(i % 8)) { |
| 355 | if (i != 0) |
| 356 | printk(KERN_ERR "%s\n", line_buf); |
| 357 | if (qe_word_cnt > 8) { |
| 358 | len = 0; |
| 359 | memset(line_buf, 0, LPFC_LBUF_SZ); |
Silvio Cesare | e7f7b6f | 2019-03-21 09:44:32 -0700 | [diff] [blame] | 360 | len += scnprintf(line_buf+len, LPFC_LBUF_SZ-len, |
James Smart | 809c753 | 2012-05-09 21:19:25 -0400 | [diff] [blame] | 361 | "%03d: ", i); |
| 362 | } |
| 363 | } |
Silvio Cesare | e7f7b6f | 2019-03-21 09:44:32 -0700 | [diff] [blame] | 364 | len += scnprintf(line_buf+len, LPFC_LBUF_SZ-len, "%08x ", |
James Smart | 809c753 | 2012-05-09 21:19:25 -0400 | [diff] [blame] | 365 | ((uint32_t)*pword) & 0xffffffff); |
| 366 | pword++; |
| 367 | } |
| 368 | if (qe_word_cnt <= 8 || (i - 1) % 8) |
| 369 | printk(KERN_ERR "%s\n", line_buf); |
| 370 | } |
| 371 | |
| 372 | /** |
| 373 | * lpfc_debug_dump_q - dump all entries from an specific queue |
| 374 | * @q: Pointer to the queue descriptor. |
| 375 | * |
| 376 | * This function dumps all entries from a queue specified by the queue |
| 377 | * descriptor @q. |
| 378 | **/ |
| 379 | static inline void |
| 380 | lpfc_debug_dump_q(struct lpfc_queue *q) |
| 381 | { |
| 382 | int idx, entry_count; |
| 383 | |
| 384 | /* sanity check */ |
| 385 | if (!q) |
| 386 | return; |
| 387 | |
| 388 | dev_printk(KERN_ERR, &(((q->phba))->pcidev)->dev, |
| 389 | "%d: [qid:%d, type:%d, subtype:%d, " |
| 390 | "qe_size:%d, qe_count:%d, " |
| 391 | "host_index:%d, port_index:%d]\n", |
| 392 | (q->phba)->brd_no, |
| 393 | q->queue_id, q->type, q->subtype, |
| 394 | q->entry_size, q->entry_count, |
| 395 | q->host_index, q->hba_index); |
| 396 | entry_count = q->entry_count; |
| 397 | for (idx = 0; idx < entry_count; idx++) |
| 398 | lpfc_debug_dump_qe(q, idx); |
| 399 | printk(KERN_ERR "\n"); |
| 400 | } |
| 401 | |
| 402 | /** |
James Smart | 895427b | 2017-02-12 13:52:30 -0800 | [diff] [blame] | 403 | * lpfc_debug_dump_wq - dump all entries from the fcp or nvme work queue |
James Smart | 809c753 | 2012-05-09 21:19:25 -0400 | [diff] [blame] | 404 | * @phba: Pointer to HBA context object. |
James Smart | 895427b | 2017-02-12 13:52:30 -0800 | [diff] [blame] | 405 | * @wqidx: Index to a FCP or NVME work queue. |
James Smart | 809c753 | 2012-05-09 21:19:25 -0400 | [diff] [blame] | 406 | * |
James Smart | 895427b | 2017-02-12 13:52:30 -0800 | [diff] [blame] | 407 | * This function dumps all entries from a FCP or NVME work queue specified |
James Smart | 1d9d5a9 | 2017-02-12 13:52:29 -0800 | [diff] [blame] | 408 | * by the wqidx. |
James Smart | 809c753 | 2012-05-09 21:19:25 -0400 | [diff] [blame] | 409 | **/ |
| 410 | static inline void |
James Smart | 1d9d5a9 | 2017-02-12 13:52:29 -0800 | [diff] [blame] | 411 | lpfc_debug_dump_wq(struct lpfc_hba *phba, int qtype, int wqidx) |
James Smart | 809c753 | 2012-05-09 21:19:25 -0400 | [diff] [blame] | 412 | { |
James Smart | 1d9d5a9 | 2017-02-12 13:52:29 -0800 | [diff] [blame] | 413 | struct lpfc_queue *wq; |
| 414 | char *qtypestr; |
| 415 | |
James Smart | c00f62e | 2019-08-14 16:57:11 -0700 | [diff] [blame] | 416 | if (qtype == DUMP_IO) { |
| 417 | wq = phba->sli4_hba.hdwq[wqidx].io_wq; |
| 418 | qtypestr = "IO"; |
James Smart | 1d9d5a9 | 2017-02-12 13:52:29 -0800 | [diff] [blame] | 419 | } else if (qtype == DUMP_MBX) { |
| 420 | wq = phba->sli4_hba.mbx_wq; |
| 421 | qtypestr = "MBX"; |
| 422 | } else if (qtype == DUMP_ELS) { |
| 423 | wq = phba->sli4_hba.els_wq; |
| 424 | qtypestr = "ELS"; |
James Smart | 895427b | 2017-02-12 13:52:30 -0800 | [diff] [blame] | 425 | } else if (qtype == DUMP_NVMELS) { |
| 426 | wq = phba->sli4_hba.nvmels_wq; |
| 427 | qtypestr = "NVMELS"; |
James Smart | 1d9d5a9 | 2017-02-12 13:52:29 -0800 | [diff] [blame] | 428 | } else |
James Smart | 809c753 | 2012-05-09 21:19:25 -0400 | [diff] [blame] | 429 | return; |
| 430 | |
James Smart | c00f62e | 2019-08-14 16:57:11 -0700 | [diff] [blame] | 431 | if (qtype == DUMP_IO) |
James Smart | 1d9d5a9 | 2017-02-12 13:52:29 -0800 | [diff] [blame] | 432 | pr_err("%s WQ: WQ[Idx:%d|Qid:%d]\n", |
| 433 | qtypestr, wqidx, wq->queue_id); |
| 434 | else |
| 435 | pr_err("%s WQ: WQ[Qid:%d]\n", |
| 436 | qtypestr, wq->queue_id); |
| 437 | |
| 438 | lpfc_debug_dump_q(wq); |
James Smart | 809c753 | 2012-05-09 21:19:25 -0400 | [diff] [blame] | 439 | } |
| 440 | |
| 441 | /** |
James Smart | 895427b | 2017-02-12 13:52:30 -0800 | [diff] [blame] | 442 | * lpfc_debug_dump_cq - dump all entries from a fcp or nvme work queue's |
James Smart | 1d9d5a9 | 2017-02-12 13:52:29 -0800 | [diff] [blame] | 443 | * cmpl queue |
James Smart | 809c753 | 2012-05-09 21:19:25 -0400 | [diff] [blame] | 444 | * @phba: Pointer to HBA context object. |
James Smart | 1d9d5a9 | 2017-02-12 13:52:29 -0800 | [diff] [blame] | 445 | * @wqidx: Index to a FCP work queue. |
James Smart | 809c753 | 2012-05-09 21:19:25 -0400 | [diff] [blame] | 446 | * |
James Smart | 895427b | 2017-02-12 13:52:30 -0800 | [diff] [blame] | 447 | * This function dumps all entries from a FCP or NVME completion queue |
James Smart | 1d9d5a9 | 2017-02-12 13:52:29 -0800 | [diff] [blame] | 448 | * which is associated to the work queue specified by the @wqidx. |
James Smart | 809c753 | 2012-05-09 21:19:25 -0400 | [diff] [blame] | 449 | **/ |
| 450 | static inline void |
James Smart | 1d9d5a9 | 2017-02-12 13:52:29 -0800 | [diff] [blame] | 451 | lpfc_debug_dump_cq(struct lpfc_hba *phba, int qtype, int wqidx) |
James Smart | 809c753 | 2012-05-09 21:19:25 -0400 | [diff] [blame] | 452 | { |
James Smart | 1d9d5a9 | 2017-02-12 13:52:29 -0800 | [diff] [blame] | 453 | struct lpfc_queue *wq, *cq, *eq; |
| 454 | char *qtypestr; |
| 455 | int eqidx; |
James Smart | 809c753 | 2012-05-09 21:19:25 -0400 | [diff] [blame] | 456 | |
James Smart | c00f62e | 2019-08-14 16:57:11 -0700 | [diff] [blame] | 457 | /* io wq and cq are 1:1, thus same indexes */ |
James Smart | cdb42be | 2019-01-28 11:14:21 -0800 | [diff] [blame] | 458 | eq = NULL; |
James Smart | 1d9d5a9 | 2017-02-12 13:52:29 -0800 | [diff] [blame] | 459 | |
James Smart | c00f62e | 2019-08-14 16:57:11 -0700 | [diff] [blame] | 460 | if (qtype == DUMP_IO) { |
| 461 | wq = phba->sli4_hba.hdwq[wqidx].io_wq; |
| 462 | cq = phba->sli4_hba.hdwq[wqidx].io_cq; |
| 463 | qtypestr = "IO"; |
James Smart | 1d9d5a9 | 2017-02-12 13:52:29 -0800 | [diff] [blame] | 464 | } else if (qtype == DUMP_MBX) { |
| 465 | wq = phba->sli4_hba.mbx_wq; |
| 466 | cq = phba->sli4_hba.mbx_cq; |
| 467 | qtypestr = "MBX"; |
| 468 | } else if (qtype == DUMP_ELS) { |
| 469 | wq = phba->sli4_hba.els_wq; |
| 470 | cq = phba->sli4_hba.els_cq; |
| 471 | qtypestr = "ELS"; |
James Smart | 895427b | 2017-02-12 13:52:30 -0800 | [diff] [blame] | 472 | } else if (qtype == DUMP_NVMELS) { |
| 473 | wq = phba->sli4_hba.nvmels_wq; |
| 474 | cq = phba->sli4_hba.nvmels_cq; |
| 475 | qtypestr = "NVMELS"; |
James Smart | 1d9d5a9 | 2017-02-12 13:52:29 -0800 | [diff] [blame] | 476 | } else |
James Smart | 809c753 | 2012-05-09 21:19:25 -0400 | [diff] [blame] | 477 | return; |
| 478 | |
James Smart | cdb42be | 2019-01-28 11:14:21 -0800 | [diff] [blame] | 479 | for (eqidx = 0; eqidx < phba->cfg_hdw_queue; eqidx++) { |
| 480 | eq = phba->sli4_hba.hdwq[eqidx].hba_eq; |
| 481 | if (cq->assoc_qid == eq->queue_id) |
James Smart | 809c753 | 2012-05-09 21:19:25 -0400 | [diff] [blame] | 482 | break; |
James Smart | 1d9d5a9 | 2017-02-12 13:52:29 -0800 | [diff] [blame] | 483 | } |
James Smart | cdb42be | 2019-01-28 11:14:21 -0800 | [diff] [blame] | 484 | if (eqidx == phba->cfg_hdw_queue) { |
James Smart | 1d9d5a9 | 2017-02-12 13:52:29 -0800 | [diff] [blame] | 485 | pr_err("Couldn't find EQ for CQ. Using EQ[0]\n"); |
| 486 | eqidx = 0; |
James Smart | cdb42be | 2019-01-28 11:14:21 -0800 | [diff] [blame] | 487 | eq = phba->sli4_hba.hdwq[0].hba_eq; |
James Smart | 3b3da6a | 2012-06-12 13:54:20 -0400 | [diff] [blame] | 488 | } |
James Smart | 809c753 | 2012-05-09 21:19:25 -0400 | [diff] [blame] | 489 | |
James Smart | c00f62e | 2019-08-14 16:57:11 -0700 | [diff] [blame] | 490 | if (qtype == DUMP_IO) |
James Smart | 1d9d5a9 | 2017-02-12 13:52:29 -0800 | [diff] [blame] | 491 | pr_err("%s CQ: WQ[Idx:%d|Qid%d]->CQ[Idx%d|Qid%d]" |
| 492 | "->EQ[Idx:%d|Qid:%d]:\n", |
| 493 | qtypestr, wqidx, wq->queue_id, wqidx, cq->queue_id, |
| 494 | eqidx, eq->queue_id); |
| 495 | else |
| 496 | pr_err("%s CQ: WQ[Qid:%d]->CQ[Qid:%d]" |
| 497 | "->EQ[Idx:%d|Qid:%d]:\n", |
| 498 | qtypestr, wq->queue_id, cq->queue_id, |
| 499 | eqidx, eq->queue_id); |
| 500 | |
| 501 | lpfc_debug_dump_q(cq); |
James Smart | 809c753 | 2012-05-09 21:19:25 -0400 | [diff] [blame] | 502 | } |
| 503 | |
| 504 | /** |
James Smart | 67d1273 | 2012-08-03 12:36:13 -0400 | [diff] [blame] | 505 | * lpfc_debug_dump_hba_eq - dump all entries from a fcp work queue's evt queue |
James Smart | 809c753 | 2012-05-09 21:19:25 -0400 | [diff] [blame] | 506 | * @phba: Pointer to HBA context object. |
| 507 | * @fcp_wqidx: Index to a FCP work queue. |
| 508 | * |
| 509 | * This function dumps all entries from a FCP event queue which is |
| 510 | * associated to the FCP work queue specified by the @fcp_wqidx. |
| 511 | **/ |
| 512 | static inline void |
James Smart | 1d9d5a9 | 2017-02-12 13:52:29 -0800 | [diff] [blame] | 513 | lpfc_debug_dump_hba_eq(struct lpfc_hba *phba, int qidx) |
James Smart | 809c753 | 2012-05-09 21:19:25 -0400 | [diff] [blame] | 514 | { |
James Smart | 1d9d5a9 | 2017-02-12 13:52:29 -0800 | [diff] [blame] | 515 | struct lpfc_queue *qp; |
James Smart | 809c753 | 2012-05-09 21:19:25 -0400 | [diff] [blame] | 516 | |
James Smart | cdb42be | 2019-01-28 11:14:21 -0800 | [diff] [blame] | 517 | qp = phba->sli4_hba.hdwq[qidx].hba_eq; |
James Smart | 809c753 | 2012-05-09 21:19:25 -0400 | [diff] [blame] | 518 | |
James Smart | 1d9d5a9 | 2017-02-12 13:52:29 -0800 | [diff] [blame] | 519 | pr_err("EQ[Idx:%d|Qid:%d]\n", qidx, qp->queue_id); |
James Smart | 809c753 | 2012-05-09 21:19:25 -0400 | [diff] [blame] | 520 | |
James Smart | 1d9d5a9 | 2017-02-12 13:52:29 -0800 | [diff] [blame] | 521 | lpfc_debug_dump_q(qp); |
James Smart | 809c753 | 2012-05-09 21:19:25 -0400 | [diff] [blame] | 522 | } |
| 523 | |
| 524 | /** |
| 525 | * lpfc_debug_dump_dat_rq - dump all entries from the receive data queue |
| 526 | * @phba: Pointer to HBA context object. |
| 527 | * |
| 528 | * This function dumps all entries from the receive data queue. |
| 529 | **/ |
| 530 | static inline void |
| 531 | lpfc_debug_dump_dat_rq(struct lpfc_hba *phba) |
| 532 | { |
| 533 | printk(KERN_ERR "DAT RQ: RQ[Qid:%d]\n", |
| 534 | phba->sli4_hba.dat_rq->queue_id); |
| 535 | lpfc_debug_dump_q(phba->sli4_hba.dat_rq); |
| 536 | } |
| 537 | |
| 538 | /** |
| 539 | * lpfc_debug_dump_hdr_rq - dump all entries from the receive header queue |
| 540 | * @phba: Pointer to HBA context object. |
| 541 | * |
| 542 | * This function dumps all entries from the receive header queue. |
| 543 | **/ |
| 544 | static inline void |
| 545 | lpfc_debug_dump_hdr_rq(struct lpfc_hba *phba) |
| 546 | { |
| 547 | printk(KERN_ERR "HDR RQ: RQ[Qid:%d]\n", |
| 548 | phba->sli4_hba.hdr_rq->queue_id); |
| 549 | lpfc_debug_dump_q(phba->sli4_hba.hdr_rq); |
| 550 | } |
| 551 | |
| 552 | /** |
James Smart | 809c753 | 2012-05-09 21:19:25 -0400 | [diff] [blame] | 553 | * lpfc_debug_dump_wq_by_id - dump all entries from a work queue by queue id |
| 554 | * @phba: Pointer to HBA context object. |
| 555 | * @qid: Work queue identifier. |
| 556 | * |
| 557 | * This function dumps all entries from a work queue identified by the queue |
| 558 | * identifier. |
| 559 | **/ |
| 560 | static inline void |
| 561 | lpfc_debug_dump_wq_by_id(struct lpfc_hba *phba, int qid) |
| 562 | { |
| 563 | int wq_idx; |
| 564 | |
James Smart | cdb42be | 2019-01-28 11:14:21 -0800 | [diff] [blame] | 565 | for (wq_idx = 0; wq_idx < phba->cfg_hdw_queue; wq_idx++) |
James Smart | c00f62e | 2019-08-14 16:57:11 -0700 | [diff] [blame] | 566 | if (phba->sli4_hba.hdwq[wq_idx].io_wq->queue_id == qid) |
James Smart | 809c753 | 2012-05-09 21:19:25 -0400 | [diff] [blame] | 567 | break; |
James Smart | cdb42be | 2019-01-28 11:14:21 -0800 | [diff] [blame] | 568 | if (wq_idx < phba->cfg_hdw_queue) { |
James Smart | c00f62e | 2019-08-14 16:57:11 -0700 | [diff] [blame] | 569 | pr_err("IO WQ[Idx:%d|Qid:%d]\n", wq_idx, qid); |
| 570 | lpfc_debug_dump_q(phba->sli4_hba.hdwq[wq_idx].io_wq); |
James Smart | 895427b | 2017-02-12 13:52:30 -0800 | [diff] [blame] | 571 | return; |
| 572 | } |
| 573 | |
James Smart | 809c753 | 2012-05-09 21:19:25 -0400 | [diff] [blame] | 574 | if (phba->sli4_hba.els_wq->queue_id == qid) { |
James Smart | 1d9d5a9 | 2017-02-12 13:52:29 -0800 | [diff] [blame] | 575 | pr_err("ELS WQ[Qid:%d]\n", qid); |
James Smart | 809c753 | 2012-05-09 21:19:25 -0400 | [diff] [blame] | 576 | lpfc_debug_dump_q(phba->sli4_hba.els_wq); |
James Smart | 1d9d5a9 | 2017-02-12 13:52:29 -0800 | [diff] [blame] | 577 | return; |
James Smart | 809c753 | 2012-05-09 21:19:25 -0400 | [diff] [blame] | 578 | } |
James Smart | 895427b | 2017-02-12 13:52:30 -0800 | [diff] [blame] | 579 | |
| 580 | if (phba->sli4_hba.nvmels_wq->queue_id == qid) { |
| 581 | pr_err("NVME LS WQ[Qid:%d]\n", qid); |
| 582 | lpfc_debug_dump_q(phba->sli4_hba.nvmels_wq); |
| 583 | } |
James Smart | 809c753 | 2012-05-09 21:19:25 -0400 | [diff] [blame] | 584 | } |
| 585 | |
| 586 | /** |
| 587 | * lpfc_debug_dump_mq_by_id - dump all entries from a mbox queue by queue id |
| 588 | * @phba: Pointer to HBA context object. |
| 589 | * @qid: Mbox work queue identifier. |
| 590 | * |
| 591 | * This function dumps all entries from a mbox work queue identified by the |
| 592 | * queue identifier. |
| 593 | **/ |
| 594 | static inline void |
| 595 | lpfc_debug_dump_mq_by_id(struct lpfc_hba *phba, int qid) |
| 596 | { |
| 597 | if (phba->sli4_hba.mbx_wq->queue_id == qid) { |
| 598 | printk(KERN_ERR "MBX WQ[Qid:%d]\n", qid); |
| 599 | lpfc_debug_dump_q(phba->sli4_hba.mbx_wq); |
| 600 | } |
| 601 | } |
| 602 | |
| 603 | /** |
| 604 | * lpfc_debug_dump_rq_by_id - dump all entries from a receive queue by queue id |
| 605 | * @phba: Pointer to HBA context object. |
| 606 | * @qid: Receive queue identifier. |
| 607 | * |
| 608 | * This function dumps all entries from a receive queue identified by the |
| 609 | * queue identifier. |
| 610 | **/ |
| 611 | static inline void |
| 612 | lpfc_debug_dump_rq_by_id(struct lpfc_hba *phba, int qid) |
| 613 | { |
| 614 | if (phba->sli4_hba.hdr_rq->queue_id == qid) { |
| 615 | printk(KERN_ERR "HDR RQ[Qid:%d]\n", qid); |
| 616 | lpfc_debug_dump_q(phba->sli4_hba.hdr_rq); |
| 617 | return; |
| 618 | } |
| 619 | if (phba->sli4_hba.dat_rq->queue_id == qid) { |
| 620 | printk(KERN_ERR "DAT RQ[Qid:%d]\n", qid); |
| 621 | lpfc_debug_dump_q(phba->sli4_hba.dat_rq); |
| 622 | } |
| 623 | } |
| 624 | |
| 625 | /** |
| 626 | * lpfc_debug_dump_cq_by_id - dump all entries from a cmpl queue by queue id |
| 627 | * @phba: Pointer to HBA context object. |
| 628 | * @qid: Complete queue identifier. |
| 629 | * |
| 630 | * This function dumps all entries from a complete queue identified by the |
| 631 | * queue identifier. |
| 632 | **/ |
| 633 | static inline void |
| 634 | lpfc_debug_dump_cq_by_id(struct lpfc_hba *phba, int qid) |
| 635 | { |
James Smart | 1d9d5a9 | 2017-02-12 13:52:29 -0800 | [diff] [blame] | 636 | int cq_idx; |
James Smart | 809c753 | 2012-05-09 21:19:25 -0400 | [diff] [blame] | 637 | |
James Smart | cdb42be | 2019-01-28 11:14:21 -0800 | [diff] [blame] | 638 | for (cq_idx = 0; cq_idx < phba->cfg_hdw_queue; cq_idx++) |
James Smart | c00f62e | 2019-08-14 16:57:11 -0700 | [diff] [blame] | 639 | if (phba->sli4_hba.hdwq[cq_idx].io_cq->queue_id == qid) |
James Smart | 809c753 | 2012-05-09 21:19:25 -0400 | [diff] [blame] | 640 | break; |
James Smart | 809c753 | 2012-05-09 21:19:25 -0400 | [diff] [blame] | 641 | |
James Smart | cdb42be | 2019-01-28 11:14:21 -0800 | [diff] [blame] | 642 | if (cq_idx < phba->cfg_hdw_queue) { |
James Smart | c00f62e | 2019-08-14 16:57:11 -0700 | [diff] [blame] | 643 | pr_err("IO CQ[Idx:%d|Qid:%d]\n", cq_idx, qid); |
| 644 | lpfc_debug_dump_q(phba->sli4_hba.hdwq[cq_idx].io_cq); |
James Smart | 895427b | 2017-02-12 13:52:30 -0800 | [diff] [blame] | 645 | return; |
| 646 | } |
| 647 | |
James Smart | 809c753 | 2012-05-09 21:19:25 -0400 | [diff] [blame] | 648 | if (phba->sli4_hba.els_cq->queue_id == qid) { |
James Smart | 1d9d5a9 | 2017-02-12 13:52:29 -0800 | [diff] [blame] | 649 | pr_err("ELS CQ[Qid:%d]\n", qid); |
James Smart | 809c753 | 2012-05-09 21:19:25 -0400 | [diff] [blame] | 650 | lpfc_debug_dump_q(phba->sli4_hba.els_cq); |
| 651 | return; |
| 652 | } |
| 653 | |
James Smart | 895427b | 2017-02-12 13:52:30 -0800 | [diff] [blame] | 654 | if (phba->sli4_hba.nvmels_cq->queue_id == qid) { |
| 655 | pr_err("NVME LS CQ[Qid:%d]\n", qid); |
| 656 | lpfc_debug_dump_q(phba->sli4_hba.nvmels_cq); |
| 657 | return; |
| 658 | } |
| 659 | |
James Smart | 809c753 | 2012-05-09 21:19:25 -0400 | [diff] [blame] | 660 | if (phba->sli4_hba.mbx_cq->queue_id == qid) { |
James Smart | 1d9d5a9 | 2017-02-12 13:52:29 -0800 | [diff] [blame] | 661 | pr_err("MBX CQ[Qid:%d]\n", qid); |
James Smart | 809c753 | 2012-05-09 21:19:25 -0400 | [diff] [blame] | 662 | lpfc_debug_dump_q(phba->sli4_hba.mbx_cq); |
| 663 | } |
| 664 | } |
| 665 | |
| 666 | /** |
| 667 | * lpfc_debug_dump_eq_by_id - dump all entries from an event queue by queue id |
| 668 | * @phba: Pointer to HBA context object. |
| 669 | * @qid: Complete queue identifier. |
| 670 | * |
| 671 | * This function dumps all entries from an event queue identified by the |
| 672 | * queue identifier. |
| 673 | **/ |
| 674 | static inline void |
| 675 | lpfc_debug_dump_eq_by_id(struct lpfc_hba *phba, int qid) |
| 676 | { |
| 677 | int eq_idx; |
| 678 | |
James Smart | cdb42be | 2019-01-28 11:14:21 -0800 | [diff] [blame] | 679 | for (eq_idx = 0; eq_idx < phba->cfg_hdw_queue; eq_idx++) |
| 680 | if (phba->sli4_hba.hdwq[eq_idx].hba_eq->queue_id == qid) |
James Smart | 809c753 | 2012-05-09 21:19:25 -0400 | [diff] [blame] | 681 | break; |
James Smart | 809c753 | 2012-05-09 21:19:25 -0400 | [diff] [blame] | 682 | |
James Smart | cdb42be | 2019-01-28 11:14:21 -0800 | [diff] [blame] | 683 | if (eq_idx < phba->cfg_hdw_queue) { |
James Smart | 809c753 | 2012-05-09 21:19:25 -0400 | [diff] [blame] | 684 | printk(KERN_ERR "FCP EQ[Idx:%d|Qid:%d]\n", eq_idx, qid); |
James Smart | cdb42be | 2019-01-28 11:14:21 -0800 | [diff] [blame] | 685 | lpfc_debug_dump_q(phba->sli4_hba.hdwq[eq_idx].hba_eq); |
James Smart | 809c753 | 2012-05-09 21:19:25 -0400 | [diff] [blame] | 686 | return; |
| 687 | } |
James Smart | 809c753 | 2012-05-09 21:19:25 -0400 | [diff] [blame] | 688 | } |
| 689 | |
| 690 | void lpfc_debug_dump_all_queues(struct lpfc_hba *); |