Emulex Logo
OneCoreā„¢ Storage SDK Release 11.2
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
ocs_ddump.c
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2011-2015, Emulex
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions are met:
7  *
8  * 1. Redistributions of source code must retain the above copyright notice,
9  * this list of conditions and the following disclaimer.
10  *
11  * 2. Redistributions in binary form must reproduce the above copyright notice,
12  * this list of conditions and the following disclaimer in the documentation
13  * and/or other materials provided with the distribution.
14  *
15  * 3. Neither the name of the copyright holder nor the names of its contributors
16  * may be used to endorse or promote products derived from this software
17  * without specific prior written permission.
18  *
19  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
23  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29  * POSSIBILITY OF SUCH DAMAGE.
30  *
31  */
32 
33 /**
34  * @file
35  * Generate iSCSI diagnostics dump.
36  *
37  */
38 
39 #include "ocs.h"
40 #include "ocs_ddump.h"
41 #include "ocs_session.h"
42 
43 #define DEFAULT_SAVED_DUMP_SIZE (4*1024*1024)
44 
45 /**
46  * @brief Generate sli4 queue ddump.
47  *
48  * @par Description
49  * Generates sli4 queue ddump data.
50  *
51  * @param textbuf Pointer to text buffer.
52  * @param hal Pointer to HAL context.
53  * @param name Name of SLI4 queue.
54  * @param q Pointer to SLI4 queues array.
55  * @param q_count Count of SLI4 queues.
56  * @param qentries Count of SLI4 queue entries.
57  *
58  * @return None.
59  */
60 
61 static void
62 ocs_ddump_sli4_queue(ocs_textbuf_t *textbuf, ocs_hal_t *hal, const char *name, sli4_queue_t *q, uint32_t q_count, uint32_t qentries)
63 {
64  ocs_hal_rq_list_t *rq_list;
65  uint32_t i;
66  uint32_t rq_busy_list_cnt;
67 
68  for (i = 0; i < q_count; i ++, q ++) {
69  ocs_ddump_section(textbuf, name, i);
70  ocs_ddump_value(textbuf, "index", "%d", q->index);
71  ocs_ddump_value(textbuf, "size", "%d", q->size);
72  ocs_ddump_value(textbuf, "length", "%d", q->length);
73  ocs_ddump_value(textbuf, "n_posted", "%d", q->n_posted);
74  ocs_ddump_value(textbuf, "id", "%d", q->id);
75  ocs_ddump_value(textbuf, "type", "%d", q->type);
76  ocs_ddump_value(textbuf, "ulp", "%d", q->ulp);
77  ocs_ddump_value(textbuf, "doorbell_rset", "%d", q->doorbell_rset);
78  ocs_ddump_value(textbuf, "doorbell_offset", "%d", q->doorbell_offset);
79  ocs_ddump_value(textbuf, "db_ring_cnt", "%d", q->db_ring_cnt);
80  ocs_ddump_value(textbuf, "proc_limit", "%d", q->proc_limit);
81  ocs_ddump_value(textbuf, "posted_limit", "%d", q->posted_limit);
82  ocs_ddump_value(textbuf, "virt_addr", "%p", q->dma.virt);
83  ocs_ddump_value(textbuf, "phys_addr", "%lx", q->dma.phys);
84 
85  switch(q->type) {
86  case SLI_QTYPE_EQ:
87  break;
88  case SLI_QTYPE_CQ:
89  ocs_ddump_value(textbuf, "is_mq", "%d", q->u.flag.is_mq);
90  ocs_ddump_value(textbuf, "is_ini_cq", "%d", q->u.flag.is_ini_cq);
91  break;
92  case SLI_QTYPE_MQ:
93  ocs_ddump_value(textbuf, "r_idx", "%d", q->u.r_idx);
94  break;
95  case SLI_QTYPE_RQ:
96  ocs_ddump_value(textbuf, "is_hdr", "%d", q->u.flag.is_hdr);
97  ocs_ddump_value(textbuf, "rq_batch", "%d", q->u.flag.rq_batch);
98 
99  rq_busy_list_cnt = 0;
100  ocs_lock(&q->lock);
101  ocs_list_foreach(&hal->rq_list_busy[i], rq_list) {
102  rq_busy_list_cnt++;
103  }
104  ocs_unlock(&q->lock);
105  ocs_ddump_value(textbuf, "rq_list_busy_cnt", "%d", rq_busy_list_cnt);
106  break;
107  case SLI_QTYPE_WQ:
108  ocs_ddump_value(textbuf, "wqe_free_cnt", "%d", q->u.wq.wqe_free_cnt);
109  break;
110  default:
111  break;
112  }
113 
114  ocs_ddump_value(textbuf, "phs_addr", "0x%x 0x%08x",
115  ocs_addr32_hi(q->dma.phys),
116  ocs_addr32_lo(q->dma.phys));
117  ocs_ddump_queue_entries(textbuf, q->dma.virt, q->size, q->length,
118  ((q->type == SLI_QTYPE_MQ) ? q->u.r_idx : q->index),
119  qentries);
120  ocs_ddump_endsection(textbuf, name, i);
121  }
122 }
123 
124 /**
125  * @brief Dump iSCSI WQs.
126  *
127  * @par Description
128  * Dumps iSCSI work queues. Only dumps queues that have been used.
129  *
130  * @param textbuf Pointer to text buffer.
131  * @param hal Pointer to HAL context.
132  * @param qentries Number of queue entries to dump.
133  *
134  * @return None.
135  */
136 
137 static void
138 ocs_ddump_wq(ocs_textbuf_t *textbuf, ocs_hal_t *hal, uint32_t qentries)
139 {
140  uint32_t wq_index;
141  char wq_name[16];
142 
143  /*
144  * In order to debug, dump any WQ that has been used.
145  */
146  for (wq_index = 0; wq_index < hal->config.n_wq; wq_index++) {
147  if (hal->wq[wq_index].index > 0) {
148  snprintf(wq_name, sizeof(wq_name), "wq-%d", wq_index);
149  ocs_ddump_sli4_queue(textbuf, hal, wq_name, &hal->wq[wq_index], 1, qentries);
150  }
151  }
152 }
153 
154 /**
155  * @brief Dump iSCSI CQs.
156  *
157  * @par Description
158  * Dumps iSCSI completion queues. Only dumps queues that have been used.
159  *
160  * @param textbuf Pointer to text buffer.
161  * @param hal Pointer to HAL context.
162  * @param qentries Number of queue entries to dump.
163  *
164  * @return None.
165  */
166 
167 static void
168 ocs_ddump_cq(ocs_textbuf_t *textbuf, ocs_hal_t *hal, uint32_t qentries)
169 {
170  uint32_t cq_index;
171  char cq_name[16];
172 
173  /*
174  * In order to debug, dump any CQ that has been used.
175  */
176  for (cq_index = 0; cq_index < hal->config.n_cq; cq_index++) {
177  if (hal->cq[cq_index].index > 0) {
178  snprintf(cq_name, sizeof(cq_name), "cq-%d", cq_index);
179  ocs_ddump_sli4_queue(textbuf, hal, cq_name, &hal->cq[cq_index], 1, qentries);
180  }
181  }
182 }
183 
184 /**
185  * @brief Generate SLI4 ddump.
186  *
187  * @par Description
188  * Generates SLI4 ddump.
189  *
190  * @param textbuf Pointer to text buffer.
191  * @param sli4 Pointer to SLI context.
192  * @param qtype Type of queue.
193  *
194  * @return None.
195  */
196 
197 static void
199 {
200  char * q_desc;
201 
202  switch(qtype) {
203  case SLI_QTYPE_EQ: q_desc = "EQ"; break;
204  case SLI_QTYPE_CQ: q_desc = "CQ"; break;
205  case SLI_QTYPE_MQ: q_desc = "MQ"; break;
206  case SLI_QTYPE_WQ: q_desc = "WQ"; break;
207  case SLI_QTYPE_RQ: q_desc = "RQ"; break;
208  default: q_desc = "unknown"; break;
209  }
210 
211  ocs_ddump_section(textbuf, q_desc, qtype);
212 
213  ocs_ddump_value(textbuf, "max_qcount", "%d", sli4->config.max_qcount[qtype]);
214  ocs_ddump_value(textbuf, "max_qentries", "%d", sli4->config.max_qentries[qtype]);
215  ocs_ddump_endsection(textbuf, q_desc, qtype);
216 }
217 
218 
219 /**
220  * @brief Generate SLI4 ddump.
221  *
222  * @par Description
223  * Generates SLI4 ddump.
224  *
225  * @param textbuf Pointer to text buffer.
226  * @param sli4 Pointer to SLI context.
227  *
228  * @return None.
229  */
230 
231 static void
233 {
234  const char *p;
235 
236  ocs_ddump_section(textbuf, "sli4", 0);
237 
238  ocs_ddump_value(textbuf, "if_type", "%d", sli4->if_type);
239  ocs_ddump_value(textbuf, "sli_family", "%d", sli4->sli_family);
240  ocs_ddump_value(textbuf, "if_type", "%d", sli4->if_type);
241 
242  switch(sli4->asic_type) {
243  case SLI4_ASIC_TYPE_BE3: p = "BE3"; break;
244  case SLI4_ASIC_TYPE_SKYHAWK: p = "Skyhawk"; break;
245  case SLI4_ASIC_TYPE_LANCER: p = "Lancer"; break;
246  case SLI4_ASIC_TYPE_CORSAIR: p = "Corsair"; break;
247  default: p = "<unknown>"; break;
248  }
249  ocs_ddump_value(textbuf, "asic_type", "%s", p);
250 
251  switch(sli4->asic_rev) {
252  case SLI4_ASIC_REV_FPGA: p = "fpga"; break;
253  case SLI4_ASIC_REV_A0: p = "A0"; break;
254  case SLI4_ASIC_REV_A1: p = "A1"; break;
255  case SLI4_ASIC_REV_A2: p = "A2"; break;
256  case SLI4_ASIC_REV_A3: p = "A3"; break;
257  case SLI4_ASIC_REV_B0: p = "B0"; break;
258  case SLI4_ASIC_REV_C0: p = "C0"; break;
259  case SLI4_ASIC_REV_D0: p = "D0"; break;
260  default: p = "<unknown>"; break;
261  }
262  ocs_ddump_value(textbuf, "asic_rev", "%s", p);
263  ocs_ddump_value(textbuf, "iface_default", "%d", sli4->iface_default);
264  ocs_ddump_value(textbuf, "t10_dif_capable", "%d", sli4->features.t10_dif_capable);
265  ocs_ddump_value(textbuf, "sgl_chaining_capable", "%d", sli4->features.sgl_chaining_capable);
266  ocs_ddump_value(textbuf, "dual_ulp_capable", "%d", sli4->features.dual_ulp_capable);
267  ocs_ddump_value(textbuf, "is_ulp0_iscsi", "%d", sli4->features.is_ulp_iscsi[0]);
268  ocs_ddump_value(textbuf, "is_ulp1_iscsi", "%d", sli4->features.is_ulp_iscsi[1]);
269  ocs_ddump_value(textbuf, "is_skyhawk", "%d", sli4->is_skyhawk);
270  ocs_ddump_value(textbuf, "pf_num", "%d", sli4->pf_num);
271  ocs_ddump_value(textbuf, "mac", "%02x%02x%02x%02x%02x%02x",
272  sli4->mac_addr[0],
273  sli4->mac_addr[1],
274  sli4->mac_addr[2],
275  sli4->mac_addr[3],
276  sli4->mac_addr[4],
277  sli4->mac_addr[5]);
278 
279  ocs_ddump_value(textbuf, "icd_base", "%d", sli4->icd_base);
280  ocs_ddump_value(textbuf, "icd_count", "%d", sli4->icd_count);
281  ocs_ddump_value(textbuf, "icd_chain_base", "%d", sli4->icd_chain_base);
282  ocs_ddump_value(textbuf, "icd_chain_count", "%d", sli4->icd_chain_count);
283  ocs_ddump_value(textbuf, "icd_num_per_page", "%d", sli4->icd_num_per_page);
284  ocs_ddump_value(textbuf, "frg_num_field_offset", "0x%x", sli4->frg_num_field_offset);
285  ocs_ddump_value(textbuf, "frg_num_field_mask", "0x%x", sli4->frg_num_field_mask);
286  ocs_ddump_value(textbuf, "sgl_idx_field_offset", "0x%x", sli4->sgl_idx_field_offset);
287  ocs_ddump_value(textbuf, "sgl_idx_field_mask", "0x%x", sli4->sgl_idx_field_mask);
288  ocs_ddump_value(textbuf, "chain_sge_init_0", "0x%x", sli4->chain_sge_init_0);
289  ocs_ddump_value(textbuf, "chain_sge_init_1", "0x%x", sli4->chain_sge_init_1);
290  ocs_ddump_value(textbuf, "num_sges_per_icd", "%d", sli4->config.num_sges_per_icd);
291  ocs_ddump_value(textbuf, "post_sgl_ver", "%d", sli4->config.post_sgl_ver);
292  ocs_ddump_value(textbuf, "fw_version", "%s", (char*)sli4->config.fw_version);
293  ocs_ddump_value(textbuf, "fw_version_flash", "%s", (char*)sli4->config.fw_on_flash_version);
294  ocs_ddump_value(textbuf, "max_ios", "%d", sli4->config.max_ios);
295  ocs_ddump_value(textbuf, "sge_supported_length", "%d", sli4->config.sge_supported_length);
296  ocs_ddump_value(textbuf, "num_sgl_pages", "%d", sli4->num_sgl_pages);
297 
298  ocs_ddump_sli_q_fields(textbuf, sli4, SLI_QTYPE_EQ);
299  ocs_ddump_sli_q_fields(textbuf, sli4, SLI_QTYPE_CQ);
300  ocs_ddump_sli_q_fields(textbuf, sli4, SLI_QTYPE_MQ);
301  ocs_ddump_sli_q_fields(textbuf, sli4, SLI_QTYPE_WQ);
302  ocs_ddump_sli_q_fields(textbuf, sli4, SLI_QTYPE_RQ);
303 
304  ocs_ddump_endsection(textbuf, "sli4", 0);
305 }
306 
307 #if defined(OCS_DEBUG_QUEUE_HISTORY)
308 /**
309  * @brief Generate queue history ddump.
310  *
311  * @param textbuf Pointer to text buffer.
312  * @param q_hist Pointer to queue history object.
313  */
314 static void
315 ocs_ddump_queue_history(ocs_textbuf_t *textbuf, ocs_hal_q_hist_t *q_hist)
316 {
317  uint32_t x;
318 
319  ocs_ddump_section(textbuf, "q_hist", 0);
320  ocs_ddump_value(textbuf, "count", "%ld", OCS_Q_HIST_SIZE);
321  ocs_ddump_value(textbuf, "index", "%d", q_hist->q_hist_index);
322 
323  if (q_hist->q_hist == NULL) {
324  ocs_ddump_section(textbuf, "history", 0);
325  ocs_textbuf_printf(textbuf, "No history available\n");
326  ocs_ddump_endsection(textbuf, "history", 0);
327  ocs_ddump_endsection(textbuf, "q_hist", 0);
328  return;
329  }
330 
331  /* start from last entry and go backwards */
332  ocs_textbuf_printf(textbuf, "<history>\n");
333  ocs_textbuf_printf(textbuf, "(newest first):\n");
334 
335  ocs_lock(&q_hist->q_hist_lock);
336  x = ocs_queue_history_prev_index(q_hist->q_hist_index);
337  do {
338  int i;
339  ocs_q_hist_ftr_t ftr;
340  uint32_t mask;
341 
342 
343  /* footer's mask indicates what words were captured */
344  ftr.word = q_hist->q_hist[x];
345  mask = ftr.s.mask;
346  i = 0;
347 
348  /* if we've encountered a mask of 0, must be done */
349  if (mask == 0) {
350  break;
351  }
352 
353  /* display entry type */
354  ocs_textbuf_printf(textbuf, "%s:\n",
355  ocs_queue_history_type_name(ftr.s.type));
356 
357  if (ocs_queue_history_timestamp_enabled()) {
358  uint64_t tsc_value;
359  x = ocs_queue_history_prev_index(x);
360  tsc_value = ((q_hist->q_hist[x]) & 0x00000000FFFFFFFFull);
361  x = ocs_queue_history_prev_index(x);
362  tsc_value |= (((uint64_t)q_hist->q_hist[x] << 32) & 0xFFFFFFFF00000000ull);
363  ocs_textbuf_printf(textbuf, " t: %" PRIu64 "\n", tsc_value);
364  }
365 
366  if (ocs_queue_history_q_info_enabled()) {
367  if (ftr.s.type == OCS_Q_HIST_TYPE_CQE_RQ ||
368  ftr.s.type == OCS_Q_HIST_TYPE_CQE_RQ ||
369  ftr.s.type == OCS_Q_HIST_TYPE_CQE_TCP_ACK ||
370  ftr.s.type == OCS_Q_HIST_TYPE_CQE_INI_IO ||
371  ftr.s.type == OCS_Q_HIST_TYPE_CQE_TGT_IO ||
372  ftr.s.type == OCS_Q_HIST_TYPE_CQE_CMDINV ||
373  ftr.s.type == OCS_Q_HIST_TYPE_CQE_ASYNC ||
374  ftr.s.type == OCS_Q_HIST_TYPE_CQE_MQ ||
375  ftr.s.type == OCS_Q_HIST_TYPE_CQE_CNXINV ||
376  ftr.s.type == OCS_Q_HIST_TYPE_CQE_T_DDIGEST ||
377  ftr.s.type == OCS_Q_HIST_TYPE_CQE_TX_DIF ||
378  ftr.s.type == OCS_Q_HIST_TYPE_WQE) {
379  x = ocs_queue_history_prev_index(x);
380  ocs_textbuf_printf(textbuf, " qid=0x%x idx=0x%x\n",
381  ((q_hist->q_hist[x] >> 16) & 0xFFFF),
382  ((q_hist->q_hist[x] >> 0) & 0xFFFF));
383  }
384  }
385 
386  while (mask) {
387  if ((mask & 1) && (x != q_hist->q_hist_index)){
388  /* get next word */
389  x = ocs_queue_history_prev_index(x);
390  ocs_textbuf_printf(textbuf, " [%d]=%x\n",
391  i, q_hist->q_hist[x]);
392  }
393  mask = (mask >> 1UL);
394  i++;
395  }
396 
397  /* go backwards to next element */
398  x = ocs_queue_history_prev_index(x);
399  } while (x != ocs_queue_history_prev_index(q_hist->q_hist_index));
400  ocs_unlock(&q_hist->q_hist_lock);
401 
402  ocs_textbuf_printf(textbuf, "</history>\n");
403  ocs_ddump_endsection(textbuf, "q_hist", 0);
404 }
405 #endif
406 
407 /**
408  * @brief Generate HAL ddump.
409  *
410  * @par Description
411  * Generates HAL ddump.
412  *
413  * @param textbuf Pointer to text buffer.
414  * @param hal Pointer to HAL context.
415  * @param ddump_flags The ddump flags.
416  * @param qentries Number of queue entries to dump.
417  *
418  * @return None.
419  */
420 
421 static void
422 ocs_ddump_hal(ocs_textbuf_t *textbuf, ocs_hal_t *hal, uint32_t ddump_flags, uint32_t qentries)
423 {
424  ocs_t *ocs = hal->os;
425  uint32_t cmd_busy_cnt = 0;
426  uint32_t cmd_pending_cnt = 0;
427  uint32_t cmd_async_cnt = 0;
428  uint32_t io_free_cnt = 0;
429  uint32_t io_tgt_write_quarantine_cnt;
430  uint32_t io_ini_read_quarantine_cnt;
431  ocs_command_ctx_t *ctx;
432  ocs_hal_io_t *io;
433 
434  ocs_assert(ocs);
435 
436  ocs_ddump_section(textbuf, "hal", ocs->instance_index);
437  ocs_ddump_value(textbuf, "uerr_mask_hi", "%08x",
439  ocs_ddump_value(textbuf, "uerr_mask_lo", "%08x",
441  ocs_ddump_value(textbuf, "uerr_status_hi", "%08x",
443  ocs_ddump_value(textbuf, "uerr_status_lo", "%08x",
445  ocs_ddump_value(textbuf, "io_alloc_failed_count", "%d", ocs_atomic_read(&hal->io_alloc_failed_count));
446  ocs_ddump_value(textbuf, "is_jumbo_set", "%d", hal->is_jumbo_set);
447  ocs_ddump_value(textbuf, "is_hal_initialized", "%d", hal->is_hal_initialized);
448  ocs_ddump_value(textbuf, "use_v1_multi_protocol", "%d", hal->use_v1_multi_protocol);
449  ocs_ddump_value(textbuf, "ulp_start", "%d", hal->ulp_start);
450  ocs_ddump_value(textbuf, "ulp_max", "%d", hal->ulp_max);
451 
452  ocs_ddump_value(textbuf, "n_eq", "%d", hal->config.n_eq);
453  ocs_ddump_value(textbuf, "n_cq", "%d", hal->config.n_cq);
454  ocs_ddump_value(textbuf, "n_mq", "%d", hal->config.n_mq);
455  ocs_ddump_value(textbuf, "n_rq", "%d", hal->config.n_rq);
456  ocs_ddump_value(textbuf, "n_wq", "%d", hal->config.n_wq);
457  ocs_ddump_value(textbuf, "n_io", "%d", hal->config.n_io);
458  ocs_ddump_value(textbuf, "rq_pl_size", "%d", hal->config.rq_pl_size);
459  ocs_ddump_value(textbuf, "enable_sgl_chaining", "%d", hal->config.enable_sgl_chaining);
460  ocs_ddump_value(textbuf, "cq_index_wq_tgt", "%d", hal->cq_index_wq_tgt);
461  ocs_ddump_value(textbuf, "cq_index_wq_ini", "%d", hal->cq_index_wq_ini);
462  ocs_ddump_value(textbuf, "cq_index_mq", "%d", hal->cq_index_mq);
463  ocs_ddump_value(textbuf, "num_wq_per_cq", "%d", hal->num_wq_per_cq);
464 
465  /* Count the command contexts */
466  ocs_lock(&hal->cmd_lock);
467  ocs_list_foreach(&hal->cmd_head, ctx) {
468  cmd_busy_cnt++;
469  }
470 
471  ocs_list_foreach(&hal->cmd_pending, ctx) {
472  cmd_pending_cnt++;
473  }
474 
475  ocs_list_foreach(&hal->cmd_async, ctx) {
476  cmd_async_cnt++;
477  }
478  ocs_unlock(&hal->cmd_lock);
479 
480  ocs_ddump_value(textbuf, "MBOX_cmd_busy_cnt", "%d", cmd_busy_cnt);
481  ocs_ddump_value(textbuf, "MBOX_cmd_pending_cnt", "%d", cmd_pending_cnt);
482  ocs_ddump_value(textbuf, "MBOX_cmd_async_cnt", "%d", cmd_async_cnt);
483 
484  /* Grab the locks and get the free IO count */
485  ocs_lock(&hal->io_lock);
486  io = ocs_list_get_head(&hal->io_free);
487  while (NULL != io) {
488  io_free_cnt++;
489 
490  io = ocs_list_next(&hal->io_free, io);
491  }
492  io_tgt_write_quarantine_cnt = hal->io_tgt_write_quarantine_cnt;
493  io_ini_read_quarantine_cnt = hal->io_ini_read_quarantine_cnt;
494  ocs_unlock(&hal->io_lock);
495 
496  ocs_ddump_value(textbuf, "io_free_cnt", "%d", io_free_cnt);
497  ocs_ddump_value(textbuf, "io_tgt_write_quarantine_cnt", "%d", io_tgt_write_quarantine_cnt);
498  ocs_ddump_value(textbuf, "io_ini_read_quarantine_cnt", "%d", io_ini_read_quarantine_cnt);
499 
500  ocs_ddump_sli(textbuf, &hal->sli);
501 
502  ocs_ddump_wq(textbuf, hal, ((ddump_flags & OCS_DDUMP_FLAGS_WQES) ? qentries : 0));
503  ocs_ddump_cq(textbuf, hal, ((ddump_flags & OCS_DDUMP_FLAGS_CQES) ? qentries : 0));
504  ocs_ddump_sli4_queue(textbuf, hal, "rq", hal->rq, hal->config.n_rq,
505  ((ddump_flags & OCS_DDUMP_FLAGS_RQES) ? qentries : 0));
506  ocs_ddump_sli4_queue(textbuf, hal, "mq", hal->mq, hal->config.n_mq,
507  ((ddump_flags & OCS_DDUMP_FLAGS_MQES) ? qentries : 0));
508 
509  ocs_ddump_sli4_queue(textbuf, hal, "eq", hal->eq, hal->config.n_eq,
510  ((ddump_flags & OCS_DDUMP_FLAGS_EQES) ? qentries : 0));
511 
512  ocs_ddump_section(textbuf, "workaround", ocs->instance_index);
513  ocs_ddump_value(textbuf, "fwrev", "%08x", hal->workaround.fwrev);
514  ocs_ddump_endsection(textbuf, "workaround", ocs->instance_index);
515 
516  ocs_ddump_endsection(textbuf, "hal", ocs->instance_index);
517 }
518 
519 
520 /**
521  * @brief Generate node ddump data.
522  *
523  * @par Description
524  * Generates the node ddump data.
525  *
526  * @param textbuf Pointer to text buffer.
527  * @param cxn Pointer to connection object.
528  *
529  * @return None.
530  */
531 static void
532 ocs_ddump_cxn(ocs_textbuf_t *textbuf, ocs_cxn_t *cxn)
533 {
534  ocs_io_t *io;
535  uint32_t active_io_cnt = 0;
536  uint32_t aborted_io_cnt = 0;
537 
538  ocs_ddump_section(textbuf, "cxn", cxn->instance_index);
539  ocs_ddump_value(textbuf, "display_name", "%s", cxn->display_name);
540 
541  ocs_lock(&cxn->active_ios_lock);
542  ocs_list_foreach(&cxn->active_ios, io) {
543  active_io_cnt++;
544  }
545  ocs_list_foreach(&cxn->aborted_ios, io) {
546  aborted_io_cnt++;
547  }
548  ocs_unlock(&cxn->active_ios_lock);
549  ocs_ddump_value(textbuf, "conn_hdl", "0x%x", cxn->conn_hdl);
550  ocs_ddump_value(textbuf, "wq_index", "%d", cxn->wq_index);
551  ocs_ddump_value(textbuf, "cq_index", "%d", cxn->cq_index);
552  ocs_ddump_value(textbuf, "rq_index", "%d", cxn->rqindex);
553  ocs_ddump_value(textbuf, "max_wr_xfer_size", "%d", cxn->max_wr_xfer_size);
554  ocs_ddump_value(textbuf, "hdr_digest", "%d", cxn->hdr_digest);
555  ocs_ddump_value(textbuf, "data_digest", "%d", cxn->data_digest);
556  ocs_ddump_value(textbuf, "max_rcv_dsl", "%d", cxn->max_rcv_dsl);
557  ocs_ddump_value(textbuf, "max_xmit_dsl", "%d", cxn->max_xmit_dsl);
558  ocs_ddump_value(textbuf, "tcp_mss", "%d", cxn->tcp_mss);
559  ocs_ddump_value(textbuf, "tcp_wscale", "%d", cxn->tcp_wscale);
560  if (cxn->session) {
561  ocs_ddump_value(textbuf, "session_instance", "%d", cxn->session->instance_index);
562  }
563  ocs_ddump_value(textbuf, "is_ini_cxn", "%d", cxn->is_ini_cxn);
564  ocs_ddump_value(textbuf, "cxn_state", "%d", cxn->cxn_state);
565  ocs_ddump_value(textbuf, "stat_sn", "%d", cxn->stat_sn);
566  ocs_ddump_value(textbuf, "nop_abort_counter", "%d", ocs_atomic_read(&cxn->nop_abort_counter));
567  ocs_ddump_value(textbuf, "active_io_cnt", "%d", active_io_cnt);
568  ocs_ddump_value(textbuf, "aborted_io_cnt", "%d", aborted_io_cnt);
569  ocs_ddump_endsection(textbuf, "cxn", cxn->instance_index);
570 }
571 
572 /**
573  * @brief Generate node ddump data.
574  *
575  * @par Description
576  * Generates the node ddump data.
577  *
578  * @param textbuf Pointer to text buffer.
579  * @param iscsi Pointer to the iSCSI structure that represents this device.
580  *
581  * @return None.
582  */
583 static void
585 {
586  ocs_domain_t *domain;
587  ocs_sport_t *sport;
588  ocs_node_t *node;
589 
590  ocs_ddump_section(textbuf, "active_cxns", 0);
591 
592  if (iscsi->hal != NULL &&
593  iscsi->hal->domain != NULL) {
594  domain = iscsi->hal->domain;
595 
596  // Iterate over the sports in the domain
597  ocs_domain_lock(domain);
598  ocs_list_foreach(&domain->sport_list, sport) {
599  // Iterate over the nodes (connections) in the sports
600  ocs_sport_lock(sport);
601  ocs_list_foreach(&sport->node_list, node) {
602  ocs_ddump_cxn(textbuf, node);
603  }
604  ocs_sport_unlock(sport);
605  }
606  ocs_domain_unlock(domain);
607  }
608 
609  ocs_ddump_endsection(textbuf, "active_cxns", 0);
610 }
611 
612 /**
613  * @brief Initiate ddump.
614  *
615  * @par Description
616  * Traverses the ocs/domain/port/node/io data structures to generate a driver
617  * dump.
618  *
619  * @param ocs Pointer to device context
620  * @param textbuf Pointer to text buffer
621  * @param flags The ddump flags.
622  * @param qentries Number of queue entries to dump.
623  *
624  * @return Returns 0 on success, or a negative value on failure.
625  */
626 
627 int
628 ocs_ddump(ocs_t *ocs, ocs_textbuf_t *textbuf, uint32_t flags, uint32_t qentries) {
629  int retval = 0;
630 
631  ocs_ddump_startfile(textbuf);
632 
633  ocs_ddump_section(textbuf, "ocs", ocs->instance_index);
634  ocs_ddump_value(textbuf, "numa_node", "%d", ocs->ocs_os.numa_node);
635 
636  ocs_ddump_value(textbuf, "display_name", "%s", ocs->display_name);
637  ocs_ddump_value(textbuf, "desc", "%s", ocs->desc);
638  ocs_ddump_value(textbuf, "enable_ini", "%d", ocs->enable_ini);
639  ocs_ddump_value(textbuf, "enable_tgt", "%d", ocs->enable_tgt);
640  ocs_ddump_value(textbuf, "ctrlmask", "0x%x", ocs->ctrlmask);
641  ocs_ddump_value(textbuf, "enable_sgl_chaining", "%d", ocs->enable_sgl_chaining);
642  ocs_ddump_value(textbuf, "enable_immediate_data", "%d", ocs->enable_immediate_data);
643  ocs_ddump_value(textbuf, "enable_hdr_digest", "%d", ocs->enable_hdr_digest);
644  ocs_ddump_value(textbuf, "enable_data_digest", "%d", ocs->enable_data_digest);
645  ocs_ddump_value(textbuf, "enable_jumbo_frame", "%d", ocs->enable_jumbo_frame);
646  ocs_ddump_value(textbuf, "max_sge_size", "%d", ocs->max_sge_size);
647  ocs_ddump_value(textbuf, "post_sgl_config", "%d", ocs->post_sgl_config);
648  ocs_ddump_value(textbuf, "num_tgts", "%d", ocs->num_tgts);
649  ocs_ddump_value(textbuf, "num_scsi_ios", "%d", ocs->num_scsi_ios);
650  ocs_ddump_value(textbuf, "local_ip", "%s", ocs->local_ip);
651  ocs_ddump_value(textbuf, "local_subnet", "%s", ocs->local_subnet);
652  ocs_ddump_value(textbuf, "gateway", "%s", ocs->gateway);
653  ocs_ddump_value(textbuf, "tcp_window_size", "%d", ocs->tcp_window_size);
654  ocs_ddump_value(textbuf, "tcp_window_scale", "%d", ocs->tcp_window_scale);
655  ocs_ddump_value(textbuf, "iqn_prefix", "%s", ocs->iqn_prefix);
656  ocs_ddump_value(textbuf, "iqn_suffix", "%s", ocs->iqn_suffix);
657  ocs_ddump_value(textbuf, "io_alloc_failed_count", "%d", ocs_atomic_read(&ocs->io_alloc_failed_count));
658  ocs_ddump_value(textbuf, "io_active_count", "%d", ocs_atomic_read(&ocs->io_active_count));
659  ocs_ddump_value(textbuf, "io_pending_count", "%d", ocs_atomic_read(&ocs->io_pending_count));
660  ocs_ddump_value(textbuf, "io_total_alloc", "%d", ocs_atomic_read(&ocs->io_total_alloc));
661  ocs_ddump_value(textbuf, "io_total_free", "%d", ocs_atomic_read(&ocs->io_total_free));
662  ocs_ddump_value(textbuf, "io_total_pending", "%d", ocs_atomic_read(&ocs->io_total_pending));
663  ocs_ddump_value(textbuf, "io_pending_recursing", "%d", ocs_atomic_read(&ocs->io_pending_recursing));
664 
665 #if defined(ENABLE_LOCK_DEBUG)
666  /* Dump the lock list */
667  ocs_ddump_section(textbuf, "locks", 0);
668  ocs_lock(&ocs->ocs_os.locklist_lock); {
669  ocs_lock_t *l;
670  uint32_t idx = 0;
671  ocs_list_foreach(&ocs->ocs_os.locklist, l) {
672  ocs_ddump_section(textbuf, "lock", idx);
673  ocs_ddump_value(textbuf, "name", "%s", l->name);
674  ocs_ddump_value(textbuf, "inuse", "%d", l->inuse);
675  ocs_ddump_value(textbuf, "caller", "%p", l->caller[0]);
676  ocs_ddump_value(textbuf, "pid", "%08x", l->pid.l);
677  ocs_ddump_endsection(textbuf, "lock", idx);
678  idx++;
679  }
680  } ocs_unlock(&ocs->ocs_os.locklist_lock);
681  ocs_ddump_endsection(textbuf, "locks", 0);
682 #endif
683 
684  /* Dump target and initiator private data */
687 
688  ocs_ddump_hal(textbuf, &ocs->hal, flags, qentries);
689 
690  retval = ocs_ddump_domain(textbuf, ocs->domain);
691 
692  ocs_ddump_sessions(textbuf, &ocs->iscsi);
693 
694  ocs_ddump_cxns(textbuf, &ocs->iscsi);
695 
696  ocs_ddump_ramlog(textbuf, ocs->ramlog);
697 
698 #if !defined(OCS_DEBUG_QUEUE_HISTORY)
699  ocs_ddump_section(textbuf, "q_hist", ocs->instance_index);
700  ocs_textbuf_printf(textbuf, "<history>\n");
701  ocs_textbuf_printf(textbuf, "No history available\n");
702  ocs_textbuf_printf(textbuf, "</history>\n");
703  ocs_ddump_endsection(textbuf, "q_hist", ocs->instance_index);
704 #else
705  ocs_ddump_queue_history(textbuf, &ocs->hal.q_hist);
706 #endif
707 
708  ocs_ddump_endsection(textbuf, "ocs", ocs->instance_index);
709 
710  ocs_ddump_endfile(textbuf);
711 
712  return retval;
713 }
714 
715 /**
716  * @brief Capture and save ddump.
717  *
718  * @par Description
719  * Captures and saves a ddump to the ocs_t structure to save the
720  * current state. The goal of this function is to save a ddump
721  * as soon as an issue is encountered. The saved ddump will be
722  * kept until the user reads it.
723  *
724  * @param ocs Pointer to device context.
725  * @param flags The ddump flags.
726  * @param qentries Number of queue entries to dump.
727  *
728  * @return Returns 0 if ddump was saved; > 0 if one already exists; < 0
729  * on error.
730  */
731 
732 int32_t
733 ocs_save_ddump(ocs_t *ocs, uint32_t flags, uint32_t qentries)
734 {
735  if (ocs_textbuf_get_written(&ocs->ddump_saved)) {
736  ocs_log_test(ocs, "Saved ddump already exists\n");
737  return 1;
738  }
739 
740  if (ocs_textbuf_get_length(&ocs->ddump_saved) == 0) {
741  ocs_log_err(ocs, "Saved ddump not allocated\n");
742  return -1;
743  }
744 
745  ocs_log_debug(ocs, "Saving ddump\n");
746  ocs_ddump(ocs, &ocs->ddump_saved, flags, qentries);
747  return 0;
748 }
749 
750 /**
751  * @brief Capture and save ddump for all OCS instances.
752  *
753  * @par Description
754  * Calls ocs_save_ddump() for each OCS instance.
755  *
756  * @param flags The ddump flags.
757  * @param qentries Number of queue entries to dump.
758  * @param alloc_flag Allocate dump buffer if not already allocated.
759  *
760  * @return Returns 0 if ddump was saved; > 0 if one already exists; < 0
761  * on error.
762  */
763 
764 int32_t
765 ocs_save_ddump_all(uint32_t flags, uint32_t qentries, uint32_t alloc_flag)
766 {
767  ocs_t *ocs;
768  uint32_t i;
769  int32_t rc = 0;
770 
771  for (i = 0; (ocs = ocs_get_instance(i)) != NULL; i++) {
772  if (alloc_flag && (!ocs_textbuf_initialized(&ocs->ddump_saved))) {
773  rc = ocs_textbuf_alloc(ocs, &ocs->ddump_saved, DEFAULT_SAVED_DUMP_SIZE);
774  if (rc) {
775  break;
776  }
777  }
778 
779  rc = ocs_save_ddump(ocs, flags, qentries);
780  if (rc < 0) {
781  break;
782  }
783  }
784  return rc;
785 }
786 
787 /**
788  * @brief Get saved ddump.
789  *
790  * @par Description
791  * Copies saved ddump to given textbuf.
792  *
793  * @param ocs Pointer to device context.
794  * @param textbuf The textbuf to write the saved ddump to.
795  *
796  * @return Returns 0 if ddump was saved; > 0 if no saved ddump found.
797  */
798 
799 int32_t
800 ocs_get_saved_ddump(ocs_t *ocs, ocs_textbuf_t *textbuf)
801 {
802  uint32_t len;
803 
804  /* if there's a saved ddump, copy to newly allocated textbuf */
805  if (ocs_textbuf_get_written(&ocs->ddump_saved)) {
806  len = MIN(ocs_textbuf_get_written(&ocs->ddump_saved), ocs_textbuf_get_length(textbuf));
807  ocs_textbuf_buffer(textbuf, ocs_textbuf_get_buffer(&ocs->ddump_saved), len);
808  return 0;
809  } else {
810  ocs_log_test(ocs, "no saved ddump found\n");
811  return 1;
812  }
813 }
814 
815 /**
816  * @brief Clear saved ddump.
817  *
818  * @par Description
819  * Clears saved ddump to make room for next one.
820  *
821  * @param ocs Pointer to device context.
822  *
823  * @return Returns 0 if ddump was cleared; > 0 if no saved ddump found.
824  */
825 
826 int32_t
828 {
829  /* if there's a saved ddump, copy to newly allocated textbuf */
830  if (ocs_textbuf_get_written(&ocs->ddump_saved)) {
831  ocs_log_debug(ocs, "saved ddump cleared\n");
832  ocs_textbuf_reset(&ocs->ddump_saved);
833  return 0;
834  } else {
835  ocs_log_test(ocs, "no saved ddump found\n");
836  return 1;
837  }
838 }
839 
840 
841 #if !defined(OCS_EXPORT)
842 #define OCS_EXPORT(...)
843 #endif
844 
846 
uint8_t is_skyhawk
Definition: sli4.h:2208
int ocs_ddump(ocs_t *ocs, ocs_textbuf_t *textbuf, uint32_t flags, uint32_t qentries)
Initiate ddump.
Definition: ocs_ddump.c:628
uint32_t cq_index_mq
Definition: ocs_hal.h:758
static void ocs_sport_unlock(ocs_sport_t *sport)
Definition: ocs_common.h:136
uint16_t frg_num_field_mask
Definition: sli4.h:2220
ocs_lock_t io_lock
Definition: ocs_hal.h:805
Structure to track RQ buffers submitted to the chip.
Definition: ocs_hal.h:710
ocs_os_handle_t os
Definition: ocs_hal.h:725
int32_t ocs_textbuf_get_length(ocs_textbuf_t *textbuf)
Definition: ocs_textbuf.c:48
#define OCS_DDUMP_FLAGS_WQES
Definition: ocs_ddump.h:38
static void ocs_ddump_cxn(ocs_textbuf_t *textbuf, ocs_cxn_t *cxn)
Generate node ddump data.
Definition: ocs_ddump.c:532
sli4_qtype_e
Definition: sli4.h:1857
uint16_t frg_num_field_offset
Definition: sli4.h:2219
ocs_t * ocs_get_instance(uint32_t index)
Returns a pointer to the ocs structure given the instance index.
Definition: ocs_driver.c:141
uint32_t icd_chain_count
Definition: sli4.h:2217
ocs_list_t io_free
Definition: ocs_hal.h:806
static void ocs_ddump_sli(ocs_textbuf_t *textbuf, sli4_t *sli4)
Generate SLI4 ddump.
Definition: ocs_ddump.c:232
uint32_t num_sgl_pages
Definition: sli4.h:2267
uint8_t is_jumbo_set
Definition: ocs_hal.h:728
uint16_t size
Definition: sli4.h:2051
void ocs_ddump_queue_entries(ocs_textbuf_t *textbuf, void *q_addr, uint32_t size, uint32_t length, int32_t index, uint32_t qentries)
Generate driver dump for queue.
Definition: ocs_ddumplib.c:196
uint32_t sli_family
Definition: sli4.h:2226
ocs_hal_t * hal
Definition: ocs_iscsi.h:295
uint32_t max_qentries[SLI_QTYPE_MAX]
Definition: sli4.h:2240
uint32_t n_cq
Definition: ocs_hal.h:738
uint32_t chain_sge_init_0
Definition: sli4.h:2223
static void ocs_sport_lock(ocs_sport_t *sport)
Definition: ocs_common.h:131
struct sli4_queue_t::@33::@35 wq
uint32_t rq_pl_size
Definition: ocs_hal.h:743
uint8_t dual_ulp_capable
Definition: sli4.h:2234
void ocs_ddump_endfile(ocs_textbuf_t *textbuf)
Generate driver dump end of file information.
Definition: ocs_ddumplib.c:73
uint32_t posted_limit
Definition: sli4.h:2064
static void * ocs_list_get_head(ocs_list_t *list)
Return the first item in the list.
Definition: ocs_list.h:292
ocs_lock_t cmd_lock
Definition: ocs_hal.h:765
struct sli4_queue_t::@33::@34 flag
uint8_t fw_on_flash_version[32]
Definition: sli4.h:2244
uint32_t index
Definition: sli4.h:2050
sli4_t sli
Definition: ocs_hal.h:726
int32_t ocs_textbuf_get_written(ocs_textbuf_t *textbuf)
Definition: ocs_textbuf.c:54
uint32_t max_ios
Definition: sli4.h:2247
ocs_domain_t * domain
Definition: ocs_hal.h:727
uint8_t * ocs_textbuf_get_buffer(ocs_textbuf_t *textbuf)
Definition: ocs_textbuf.c:42
int ocs_ddump_domain(ocs_textbuf_t *textbuf, ocs_domain_t *domain)
Generate domain ddump.
Definition: ocs_domain.c:205
const char * name
Definition: ocs_ddump.h:54
bool enable_sgl_chaining
Definition: ocs_hal.h:744
HAL object.
Definition: ocs_hal.h:724
struct sli4_t::@37 features
uint32_t sge_supported_length
Definition: sli4.h:2248
ocs_list_t cmd_pending
Definition: ocs_hal.h:767
#define OCS_DDUMP_FLAGS_RQES
Definition: ocs_ddump.h:41
int32_t ocs_ddump_ramlog(ocs_textbuf_t *textbuf, ocs_ramlog_t *ramlog)
Perform ramlog buffer driver dump.
Definition: ocs_ramlog.c:266
sli4_queue_t mq[1]
Definition: ocs_hal.h:751
void ocs_ddump_section(ocs_textbuf_t *textbuf, const char *name, uint32_t instance)
Generate driver dump section start data.
Definition: ocs_ddumplib.c:90
int32_t ocs_save_ddump(ocs_t *ocs, uint32_t flags, uint32_t qentries)
Capture and save ddump.
Definition: ocs_ddump.c:733
uint32_t icd_count
Definition: sli4.h:2215
HAL command context.
Definition: ocs_hal.h:360
uint32_t n_mq
Definition: ocs_hal.h:739
union sli4_queue_t::@33 u
uint32_t io_tgt_write_quarantine_cnt
Definition: ocs_hal.h:814
uint32_t sli_reg_read(sli4_t *sli, sli4_regname_e reg)
Read the given SLI register.
Definition: sli4.c:210
uint16_t ulp
Definition: sli4.h:2055
uint32_t doorbell_offset
Definition: sli4.h:2057
#define OCS_DDUMP_FLAGS_EQES
Definition: ocs_ddump.h:42
ocs_list_t rq_list_busy[OCS_HAL_MAX_NUM_RQ]
Definition: ocs_hal.h:774
Definition: sli4.h:2201
ocs_lock_t lock
Definition: sli4.h:2049
int32_t ocs_clear_saved_ddump(ocs_t *ocs)
Clear saved ddump.
Definition: ocs_ddump.c:827
uint16_t ulp_max
Definition: ocs_hal.h:733
sli4_queue_t rq[OCS_HAL_MAX_NUM_RQ]
Definition: ocs_hal.h:750
sli4_queue_t eq[OCS_HAL_MAX_NUM_EQ]
Definition: ocs_hal.h:753
uint8_t post_sgl_ver
Definition: sli4.h:2242
void ocs_ddump_sessions(ocs_textbuf_t *textbuf, ocs_iscsi_t *iscsi)
Generate node ddump data.
Definition: ocs_session.c:1095
uint16_t sgl_idx_field_mask
Definition: sli4.h:2222
uint32_t proc_limit
Definition: sli4.h:2063
void ocs_scsi_ini_ddump(ocs_textbuf_t *textbuf, ocs_scsi_ddump_type_e type, void *obj)
Generate driver dump data for debugging.
uint8_t type
Definition: sli4.h:2059
int32_t ocs_save_ddump_all(uint32_t flags, uint32_t qentries, uint32_t alloc_flag)
Capture and save ddump for all OCS instances.
Definition: ocs_ddump.c:765
uint16_t sgl_idx_field_offset
Definition: sli4.h:2221
uint8_t fw_version[32]
Definition: sli4.h:2243
uint16_t ulp_start
Definition: ocs_hal.h:732
iSCSI object
Definition: ocs_iscsi.h:293
sli4_asic_type_e asic_type
Definition: sli4.h:2273
uint32_t n_wq
Definition: ocs_hal.h:741
uint8_t use_v1_multi_protocol
Definition: ocs_hal.h:730
static void ocs_ddump_hal(ocs_textbuf_t *textbuf, ocs_hal_t *hal, uint32_t ddump_flags, uint32_t qentries)
Generate HAL ddump.
Definition: ocs_ddump.c:422
HAL IO object.
Definition: ocs_hal.h:471
#define OCS_EXPORT(...)
Definition: ocs_ddump.c:842
static void ocs_ddump_cq(ocs_textbuf_t *textbuf, ocs_hal_t *hal, uint32_t qentries)
Dump iSCSI CQs.
Definition: ocs_ddump.c:168
uint16_t length
Definition: sli4.h:2052
uint32_t if_type
Definition: sli4.h:2206
uint16_t id
Definition: sli4.h:2054
#define DEFAULT_SAVED_DUMP_SIZE
Definition: ocs_ddump.c:43
static void ocs_ddump_cxns(ocs_textbuf_t *textbuf, ocs_iscsi_t *iscsi)
Generate node ddump data.
Definition: ocs_ddump.c:584
int32_t ocs_get_saved_ddump(ocs_t *ocs, ocs_textbuf_t *textbuf)
Get saved ddump.
Definition: ocs_ddump.c:800
void ocs_ddump_endsection(ocs_textbuf_t *textbuf, const char *name, uint32_t instance)
Generate driver dump section end data.
Definition: ocs_ddumplib.c:108
uint16_t n_posted
Definition: sli4.h:2053
uint32_t cq_index_wq_ini
Definition: ocs_hal.h:757
struct sli4_t::@38 config
uint16_t doorbell_rset
Definition: sli4.h:2058
uint8_t is_hal_initialized
Definition: ocs_hal.h:729
static void ocs_ddump_sli_q_fields(ocs_textbuf_t *textbuf, sli4_t *sli4, sli4_qtype_e qtype)
Generate SLI4 ddump.
Definition: ocs_ddump.c:198
void ocs_ddump_startfile(ocs_textbuf_t *textbuf)
Generate driver dump start of file information.
Definition: ocs_ddumplib.c:53
static void ocs_ddump_wq(ocs_textbuf_t *textbuf, ocs_hal_t *hal, uint32_t qentries)
Dump iSCSI WQs.
Definition: ocs_ddump.c:138
static void ocs_ddump_sli4_queue(ocs_textbuf_t *textbuf, ocs_hal_t *hal, const char *name, sli4_queue_t *q, uint32_t q_count, uint32_t qentries)
Generate sli4 queue ddump.
Definition: ocs_ddump.c:62
This structure is used to track the SLI4 queues.
Definition: sli4.h:2046
sli4_queue_t * cq
Definition: ocs_hal.h:752
uint32_t r_idx
Definition: sli4.h:2069
void ocs_scsi_tgt_ddump(ocs_textbuf_t *textbuf, ocs_scsi_ddump_type_e type, void *obj)
Definition: ocs_ramd.c:6580
uint32_t num_wq_per_cq
Definition: ocs_hal.h:759
uint8_t t10_dif_capable
Definition: sli4.h:2230
ocs_hal_workaround_t workaround
Definition: ocs_hal.h:828
static void * ocs_list_next(ocs_list_t *list, void *item)
Get the next item on the list.
Definition: ocs_list.h:339
ocs_list_t cmd_async
Definition: ocs_hal.h:768
void ocs_textbuf_printf(ocs_textbuf_t *textbuf, const char *fmt,...)
Helper function to dump message.
Definition: ocs_textbuf.c:238
uint8_t mac_addr[6]
Definition: sli4.h:2210
uint32_t n_eq
Definition: ocs_hal.h:737
uint8_t pf_num
Definition: sli4.h:2209
uint32_t n_rq
Definition: ocs_hal.h:740
static void ocs_domain_lock(ocs_domain_t *domain)
Definition: ocs_common.h:186
void ocs_textbuf_buffer(ocs_textbuf_t *textbuf, uint8_t *buffer, uint32_t buffer_length)
Definition: ocs_textbuf.c:335
sli4_queue_t * wq
Definition: ocs_hal.h:749
void ocs_textbuf_reset(ocs_textbuf_t *textbuf)
Definition: ocs_textbuf.c:406
uint32_t icd_chain_base
Definition: sli4.h:2216
#define ocs_assert(cond,...)
Definition: ocs_debug.h:163
uint16_t num_sges_per_icd
Definition: sli4.h:2241
struct ocs_hal_t::@19 config
uint32_t icd_base
Definition: sli4.h:2214
uint16_t max_qcount[SLI_QTYPE_MAX]
Definition: sli4.h:2239
uint32_t cq_index_wq_tgt
Definition: ocs_hal.h:756
uint32_t db_ring_cnt
Definition: sli4.h:2062
int32_t ocs_textbuf_alloc(ocs_t *ocs, ocs_textbuf_t *textbuf, uint32_t length)
Definition: ocs_textbuf.c:105
ocs_list_t cmd_head
Definition: ocs_hal.h:766
uint32_t ocs_textbuf_initialized(ocs_textbuf_t *textbuf)
Definition: ocs_textbuf.c:94
uint32_t icd_num_per_page
Definition: sli4.h:2218
#define ocs_list_foreach(list, item)
Iterate a linked list.
Definition: ocs_list.h:428
uint32_t chain_sge_init_1
Definition: sli4.h:2224
uint32_t io_ini_read_quarantine_cnt
Definition: ocs_hal.h:816
#define OCS_DDUMP_FLAGS_CQES
Definition: ocs_ddump.h:39
uint8_t sgl_chaining_capable
Definition: sli4.h:2233
ocs_atomic_t io_alloc_failed_count
Definition: ocs_hal.h:830
uint8_t is_ulp_iscsi[2]
Definition: sli4.h:2235
sli4_asic_rev_e asic_rev
Definition: sli4.h:2274
void ocs_ddump_value(ocs_textbuf_t *textbuf, const char *name, const char *fmt,...)
Generate driver dump data for a given value.
Definition: ocs_ddumplib.c:126
uint32_t n_io
Definition: ocs_hal.h:742
static void ocs_domain_unlock(ocs_domain_t *domain)
Definition: ocs_common.h:191
ocs_dma_t dma
Definition: sli4.h:2048
uint32_t iface_default
Definition: sli4.h:2205
#define OCS_DDUMP_FLAGS_MQES
Definition: ocs_ddump.h:40