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 FC ddump
36  *
37  */
38 
39 #include "ocs.h"
40 #include "ocs_ddump.h"
41 
42 #define DEFAULT_SAVED_DUMP_SIZE (4*1024*1024)
43 
44 void hal_queue_ddump(ocs_textbuf_t *textbuf, ocs_hal_t *hal);
45 
46 /**
47  * @brief Generate sli4 queue ddump
48  *
49  * Generates sli4 queue ddump data
50  *
51  * @param textbuf pointer to text buffer
52  * @param name name of SLI4 queue
53  * @param hal pointer HAL context
54  * @param q pointer to SLI4 queues array
55  * @param q_count count of SLI4 queues
56  * @param qentries number of SLI4 queue entries to dump
57  *
58  * @return none
59  */
60 
61 static void
62 ocs_ddump_sli4_queue(ocs_textbuf_t *textbuf, const char *name, ocs_hal_t *hal,
63  sli4_queue_t **queue, uint32_t q_count, uint32_t qentries)
64 {
65  uint32_t i;
66 
67  for (i = 0; i < q_count; i++) {
68  sli4_queue_t *q = queue[i];
69 
70  ocs_assert(q);
71  ocs_ddump_section(textbuf, name, i);
72  ocs_ddump_value(textbuf, "index", "%d", q->index);
73  ocs_ddump_value(textbuf, "size", "%d", q->size);
74  ocs_ddump_value(textbuf, "length", "%d", q->length);
75  ocs_ddump_value(textbuf, "n_posted", "%d", q->n_posted);
76  ocs_ddump_value(textbuf, "id", "%d", q->id);
77  ocs_ddump_value(textbuf, "type", "%d", q->type);
78  ocs_ddump_value(textbuf, "posted_limit", "%d", q->posted_limit);
79  ocs_ddump_value(textbuf, "max_num_processed", "%d", q->max_num_processed);
80  ocs_ddump_value(textbuf, "max_process_time_ms", "%" PRIx64, q->max_process_time_ms);
81  ocs_ddump_value(textbuf, "virt_addr", "%p", q->dma.virt);
82  ocs_ddump_value(textbuf, "phys_addr", "%lx", q->dma.phys);
83 
84  /* queue-specific information */
85  switch (q->type) {
86  case SLI_QTYPE_MQ:
87  ocs_ddump_value(textbuf, "r_idx", "%d", q->u.r_idx);
88  break;
89  case SLI_QTYPE_CQ:
90  ocs_ddump_value(textbuf, "is_mq", "%d", q->u.flag.is_mq);
91  ocs_ddump_value(textbuf, "cq_last_processed_time", "%u",
93  break;
94  case SLI_QTYPE_WQ:
95  break;
96  case SLI_QTYPE_EQ:
97  ocs_ddump_value(textbuf, "eq_last_processed_time", "%u",
99  break;
100  case SLI_QTYPE_RQ: {
101  uint32_t i;
102  uint32_t j;
103  uint32_t rqe_count = 0;
104  hal_rq_t *rq;
105 
106  ocs_ddump_value(textbuf, "is_hdr", "%d", q->u.flag.is_hdr);
107  ocs_ddump_value(textbuf, "rq_batch", "%d", q->u.flag.rq_batch);
108 
109  /* loop through RQ tracker to see how many RQEs were produced */
110  for (i = 0; i < hal->hal_rq_count; i++) {
111  rq = hal->hal_rq[i];
112  for (j = 0; j < rq->entry_count; j++) {
113  if (rq->rq_tracker[j] != NULL) {
114  rqe_count++;
115  }
116  }
117  }
118  ocs_ddump_value(textbuf, "rqes_produced", "%d", rqe_count);
119  break;
120  }
121  }
122  ocs_ddump_queue_entries(textbuf, q->dma.virt, q->size, q->length,
123  ((q->type == SLI_QTYPE_MQ) ? q->u.r_idx : q->index),
124  qentries);
125  ocs_ddump_endsection(textbuf, name, i);
126  }
127 }
128 
129 
130 /**
131  * @brief Generate SLI4 ddump
132  *
133  * Generates sli4 ddump
134  *
135  * @param textbuf pointer to text buffer
136  * @param sli4 pointer SLI context
137  * @param qtype SLI4 queue type
138  *
139  * @return none
140  */
141 
142 static void
144 {
145  char * q_desc;
146 
147  switch(qtype) {
148  case SLI_QTYPE_EQ: q_desc = "EQ"; break;
149  case SLI_QTYPE_CQ: q_desc = "CQ"; break;
150  case SLI_QTYPE_MQ: q_desc = "MQ"; break;
151  case SLI_QTYPE_WQ: q_desc = "WQ"; break;
152  case SLI_QTYPE_RQ: q_desc = "RQ"; break;
153  default: q_desc = "unknown"; break;
154  }
155 
156  ocs_ddump_section(textbuf, q_desc, qtype);
157 
158  ocs_ddump_value(textbuf, "max_qcount", "%d", sli4->config.max_qcount[qtype]);
159  ocs_ddump_value(textbuf, "max_qentries", "%d", sli4->config.max_qentries[qtype]);
160  ocs_ddump_value(textbuf, "qpage_count", "%d", sli4->config.qpage_count[qtype]);
161  ocs_ddump_endsection(textbuf, q_desc, qtype);
162 }
163 
164 
165 /**
166  * @brief Generate SLI4 ddump
167  *
168  * Generates sli4 ddump
169  *
170  * @param textbuf pointer to text buffer
171  * @param sli4 pointer SLI context
172  *
173  * @return none
174  */
175 
176 static void
178 {
180  const char *p;
181 
182  ocs_ddump_section(textbuf, "sli4", 0);
183 
184  ocs_ddump_value(textbuf, "sli_rev", "%d", sli4->sli_rev);
185  ocs_ddump_value(textbuf, "sli_family", "%d", sli4->sli_family);
186  ocs_ddump_value(textbuf, "if_type", "%d", sli4->if_type);
187 
188  switch(sli4->asic_type) {
189  case SLI4_ASIC_TYPE_BE3: p = "BE3"; break;
190  case SLI4_ASIC_TYPE_SKYHAWK: p = "Skyhawk"; break;
191  case SLI4_ASIC_TYPE_LANCER: p = "Lancer"; break;
192  case SLI4_ASIC_TYPE_LANCERG6: p = "LancerG6"; break;
193  default: p = "unknown"; break;
194  }
195  ocs_ddump_value(textbuf, "asic_type", "%s", p);
196 
197  switch(sli4->asic_rev) {
198  case SLI4_ASIC_REV_FPGA: p = "fpga"; break;
199  case SLI4_ASIC_REV_A0: p = "A0"; break;
200  case SLI4_ASIC_REV_A1: p = "A1"; break;
201  case SLI4_ASIC_REV_A2: p = "A2"; break;
202  case SLI4_ASIC_REV_A3: p = "A3"; break;
203  case SLI4_ASIC_REV_B0: p = "B0"; break;
204  case SLI4_ASIC_REV_C0: p = "C0"; break;
205  case SLI4_ASIC_REV_D0: p = "D0"; break;
206  default: p = "unknown"; break;
207  }
208  ocs_ddump_value(textbuf, "asic_rev", "%s", p);
209 
210  ocs_ddump_value(textbuf, "e_d_tov", "%d", sli4->config.e_d_tov);
211  ocs_ddump_value(textbuf, "r_a_tov", "%d", sli4->config.r_a_tov);
212  ocs_ddump_value(textbuf, "link_module_type", "%d", sli4->config.link_module_type);
213  ocs_ddump_value(textbuf, "rq_batch", "%d", sli4->config.rq_batch);
214  ocs_ddump_value(textbuf, "topology", "%d", sli4->config.topology);
215  ocs_ddump_value(textbuf, "wwpn", "%02x%02x%02x%02x%02x%02x%02x%02x",
216  sli4->config.wwpn[0],
217  sli4->config.wwpn[1],
218  sli4->config.wwpn[2],
219  sli4->config.wwpn[3],
220  sli4->config.wwpn[4],
221  sli4->config.wwpn[5],
222  sli4->config.wwpn[6],
223  sli4->config.wwpn[7]);
224  ocs_ddump_value(textbuf, "wwnn", "%02x%02x%02x%02x%02x%02x%02x%02x",
225  sli4->config.wwnn[0],
226  sli4->config.wwnn[1],
227  sli4->config.wwnn[2],
228  sli4->config.wwnn[3],
229  sli4->config.wwnn[4],
230  sli4->config.wwnn[5],
231  sli4->config.wwnn[6],
232  sli4->config.wwnn[7]);
233  ocs_ddump_value(textbuf, "fw_rev0", "%d", sli4->config.fw_rev[0]);
234  ocs_ddump_value(textbuf, "fw_rev1", "%d", sli4->config.fw_rev[1]);
235  ocs_ddump_value(textbuf, "fw_name0", "%s", (char*)sli4->config.fw_name[0]);
236  ocs_ddump_value(textbuf, "fw_name1", "%s", (char*)sli4->config.fw_name[1]);
237  ocs_ddump_value(textbuf, "hw_rev0", "%x", sli4->config.hw_rev[0]);
238  ocs_ddump_value(textbuf, "hw_rev1", "%x", sli4->config.hw_rev[1]);
239  ocs_ddump_value(textbuf, "hw_rev2", "%x", sli4->config.hw_rev[2]);
240  ocs_ddump_value(textbuf, "sge_supported_length", "%x", sli4->config.sge_supported_length);
241  ocs_ddump_value(textbuf, "sgl_page_sizes", "%x", sli4->config.sgl_page_sizes);
242  ocs_ddump_value(textbuf, "max_sgl_pages", "%x", sli4->config.max_sgl_pages);
243  ocs_ddump_value(textbuf, "high_login_mode", "%x", sli4->config.high_login_mode);
244  ocs_ddump_value(textbuf, "sgl_pre_registered", "%x", sli4->config.sgl_pre_registered);
245  ocs_ddump_value(textbuf, "sgl_pre_registration_required", "%x", sli4->config.sgl_pre_registration_required);
246 
247  ocs_ddump_value(textbuf, "sgl_chaining_capable", "%x", cparams->chaining_capable);
248  ocs_ddump_value(textbuf, "frag_num_field_offset", "%x", cparams->frag_num_field_offset);
249  ocs_ddump_value(textbuf, "frag_num_field_mask", "%016" PRIx64 "", cparams->frag_num_field_mask);
250  ocs_ddump_value(textbuf, "sgl_index_field_offset", "%x", cparams->sgl_index_field_offset);
251  ocs_ddump_value(textbuf, "sgl_index_field_mask", "%016" PRIx64 "", cparams->sgl_index_field_mask);
252  ocs_ddump_value(textbuf, "chain_sge_initial_value_lo", "%x", cparams->chain_sge_initial_value_lo);
253  ocs_ddump_value(textbuf, "chain_sge_initial_value_hi", "%x", cparams->chain_sge_initial_value_hi);
254 
255  ocs_ddump_value(textbuf, "max_vfi", "%d", sli_get_max_rsrc(sli4, SLI_RSRC_FCOE_VFI));
256  ocs_ddump_value(textbuf, "max_vpi", "%d", sli_get_max_rsrc(sli4, SLI_RSRC_FCOE_VPI));
257  ocs_ddump_value(textbuf, "max_rpi", "%d", sli_get_max_rsrc(sli4, SLI_RSRC_FCOE_RPI));
258  ocs_ddump_value(textbuf, "max_xri", "%d", sli_get_max_rsrc(sli4, SLI_RSRC_FCOE_XRI));
259  ocs_ddump_value(textbuf, "max_fcfi", "%d", sli_get_max_rsrc(sli4, SLI_RSRC_FCOE_FCFI));
260 
261  ocs_ddump_sli_q_fields(textbuf, sli4, SLI_QTYPE_EQ);
262  ocs_ddump_sli_q_fields(textbuf, sli4, SLI_QTYPE_CQ);
263  ocs_ddump_sli_q_fields(textbuf, sli4, SLI_QTYPE_MQ);
264  ocs_ddump_sli_q_fields(textbuf, sli4, SLI_QTYPE_WQ);
265  ocs_ddump_sli_q_fields(textbuf, sli4, SLI_QTYPE_RQ);
266 
267  ocs_ddump_endsection(textbuf, "sli4", 0);
268 }
269 
270 
271 /**
272  * @brief Dump HAL IO
273  *
274  * Dump HAL IO
275  *
276  * @param textbuf pointer to text buffer
277  * @param io pointer to HAL IO object
278  *
279  * @return none
280  */
281 
282 static void
283 ocs_ddump_hal_io(ocs_textbuf_t *textbuf, ocs_hal_io_t *io)
284 {
285  ocs_assert(io);
286 
287  ocs_ddump_section(textbuf, "hal_io", io->indicator);
288 
289  ocs_ddump_value(textbuf, "state", "%d", io->state);
290  ocs_ddump_value(textbuf, "xri", "0x%x", io->indicator);
291  ocs_ddump_value(textbuf, "tag", "0x%x", io->reqtag);
292  ocs_ddump_value(textbuf, "abort_reqtag", "0x%x", io->abort_reqtag);
293  ocs_ddump_value(textbuf, "ref_count", "%d", ocs_ref_read_count(&io->ref));
294 
295  /* just to make it obvious, display abort bit from tag */
296  ocs_ddump_value(textbuf, "abort", "0x%x", io->abort_in_progress);
297  ocs_ddump_value(textbuf, "wq_index", "%d", (io->wq == NULL ? 0xffff : io->wq->instance));
298  ocs_ddump_value(textbuf, "type", "%d", io->type);
299  ocs_ddump_value(textbuf, "xbusy", "%d", io->xbusy);
300  ocs_ddump_value(textbuf, "active_wqe_link", "%d", ocs_list_on_list(&io->wqe_link));
301  ocs_ddump_value(textbuf, "def_sgl_count", "%d", io->def_sgl_count);
302  ocs_ddump_value(textbuf, "n_sge", "%d", io->n_sge);
303  ocs_ddump_value(textbuf, "has_ovfl_sgl", "%s", (io->ovfl_sgl != NULL ? "TRUE" : "FALSE"));
304  ocs_ddump_value(textbuf, "has_ovfl_io", "%s", (io->ovfl_io != NULL ? "TRUE" : "FALSE"));
305 
306  ocs_ddump_endsection(textbuf, "hal_io", io->indicator);
307 }
308 
309 #if defined(OCS_DEBUG_QUEUE_HISTORY)
310 
311 /**
312  * @brief Generate queue history ddump
313  *
314  * @param textbuf pointer to text buffer
315  * @param q_hist Pointer to queue history object.
316  */
317 static void
318 ocs_ddump_queue_history(ocs_textbuf_t *textbuf, ocs_hal_q_hist_t *q_hist)
319 {
320  uint32_t x;
321 
322  if (!textbuf)
323  return;
324 
325  ocs_ddump_section(textbuf, "q_hist", 0);
326  ocs_ddump_value(textbuf, "count", "%ld", OCS_Q_HIST_SIZE);
327  ocs_ddump_value(textbuf, "index", "%d", q_hist->q_hist_index);
328 
329  if (q_hist->q_hist == NULL) {
330  ocs_ddump_section(textbuf, "history", 0);
331  ocs_textbuf_printf(textbuf, "No history available\n");
332  ocs_ddump_endsection(textbuf, "history", 0);
333  ocs_ddump_endsection(textbuf, "q_hist", 0);
334  return;
335  }
336 
337  /* start from last entry and go backwards */
338  ocs_textbuf_printf(textbuf, "<history>\n");
339  ocs_textbuf_printf(textbuf, "(newest first):\n");
340 
341  ocs_lock(&q_hist->q_hist_lock);
342  x = ocs_queue_history_prev_index(q_hist->q_hist_index);
343  do {
344  int i;
345  ocs_q_hist_ftr_t ftr;
346  uint32_t mask;
347 
348 
349  /* footer's mask indicates what words were captured */
350  ftr.word = q_hist->q_hist[x];
351  mask = ftr.s.mask;
352  i = 0;
353 
354  /* if we've encountered a mask of 0, must be done */
355  if (mask == 0) {
356  break;
357  }
358 
359  /* display entry type */
360  ocs_textbuf_printf(textbuf, "%s:\n",
361  ocs_queue_history_type_name(ftr.s.type));
362 
363  if (ocs_queue_history_timestamp_enabled()) {
364  uint64_t tsc_value;
365  x = ocs_queue_history_prev_index(x);
366  tsc_value = ((q_hist->q_hist[x]) & 0x00000000FFFFFFFFull);
367  x = ocs_queue_history_prev_index(x);
368  tsc_value |= (((uint64_t)q_hist->q_hist[x] << 32) & 0xFFFFFFFF00000000ull);
369  ocs_textbuf_printf(textbuf, " t: %" PRIu64 "\n", tsc_value);
370  }
371 
372  if (ocs_queue_history_q_info_enabled()) {
373  if (ftr.s.type == OCS_Q_HIST_TYPE_CWQE ||
374  ftr.s.type == OCS_Q_HIST_TYPE_CXABT ||
375  ftr.s.type == OCS_Q_HIST_TYPE_WQE) {
376  x = ocs_queue_history_prev_index(x);
377  ocs_textbuf_printf(textbuf, " qid=0x%x idx=0x%x\n",
378  ((q_hist->q_hist[x] >> 16) & 0xFFFF),
379  ((q_hist->q_hist[x] >> 0) & 0xFFFF));
380  }
381  }
382 
383  while (mask) {
384  if ((mask & 1) && (x != q_hist->q_hist_index)){
385  /* get next word */
386  x = ocs_queue_history_prev_index(x);
387  ocs_textbuf_printf(textbuf, " [%d]=%x\n",
388  i, q_hist->q_hist[x]);
389  }
390  mask = (mask >> 1UL);
391  i++;
392  }
393 
394  /* go backwards to next element */
395  x = ocs_queue_history_prev_index(x);
396  } while (x != ocs_queue_history_prev_index(q_hist->q_hist_index));
397  ocs_unlock(&q_hist->q_hist_lock);
398 
399  ocs_textbuf_printf(textbuf, "</history>\n");
400  ocs_ddump_endsection(textbuf, "q_hist", 0);
401 }
402 #endif
403 
404 /**
405  * @brief Generate hal ddump
406  *
407  * Generates hal ddump
408  *
409  * @param textbuf pointer to text buffer
410  * @param hal pointer HAL context
411  * @param flags ddump flags
412  * @param qentries number of qentries to dump
413  *
414  * @return none
415  */
416 
417 static void
418 ocs_ddump_hal(ocs_textbuf_t *textbuf, ocs_hal_t *hal, uint32_t flags, uint32_t qentries)
419 {
420  ocs_t *ocs = hal->os;
421  uint32_t cnt = 0;
422  ocs_hal_io_t *io = NULL;
423  uint32_t i;
424  uint32_t j;
425  uint32_t max_rpi = sli_get_max_rsrc(&hal->sli, SLI_RSRC_FCOE_RPI);
426 
427  ocs_assert(ocs);
428 
429  ocs_ddump_section(textbuf, "hal", ocs->instance_index);
430 
431  /* device specific information */
432  switch(hal->sli.if_type) {
433  case 0:
434  ocs_ddump_value(textbuf, "uerr_mask_hi", "%08x",
435  sli_reg_read(&hal->sli, SLI4_REG_UERR_MASK_HI));
436  ocs_ddump_value(textbuf, "uerr_mask_lo", "%08x",
437  sli_reg_read(&hal->sli, SLI4_REG_UERR_MASK_LO));
438  ocs_ddump_value(textbuf, "uerr_status_hi", "%08x",
440  ocs_ddump_value(textbuf, "uerr_status_lo", "%08x",
442  break;
443  case 2:
444  ocs_ddump_value(textbuf, "sliport_status", "%08x",
446  ocs_ddump_value(textbuf, "sliport_error1", "%08x",
448  ocs_ddump_value(textbuf, "sliport_error2", "%08x",
450  break;
451  }
452 
453  ocs_ddump_value(textbuf, "link_status", "%d", hal->link.status);
454  ocs_ddump_value(textbuf, "link_speed", "%d", hal->link.speed);
455  ocs_ddump_value(textbuf, "link_topology", "%d", hal->link.topology);
456  ocs_ddump_value(textbuf, "state", "%d", hal->state);
457  ocs_ddump_value(textbuf, "io_alloc_failed_count", "%d", ocs_atomic_read(&hal->io_alloc_failed_count));
458  ocs_ddump_value(textbuf, "n_io", "%d", hal->config.n_io);
459 
460  ocs_ddump_value(textbuf, "queue_topology", "%s", hal->config.queue_topology);
461  ocs_ddump_value(textbuf, "rq_selection_policy", "%d", hal->config.rq_selection_policy);
462  ocs_ddump_value(textbuf, "rr_quanta", "%d", hal->config.rr_quanta);
463  for (i = 0; i < ARRAY_SIZE(hal->config.filter_def); i++) {
464  ocs_ddump_value(textbuf, "filter_def", "%08X", hal->config.filter_def[i]);
465  }
466  ocs_ddump_value(textbuf, "cq_process_limit", "%d", hal->config.cq_process_limit);
467  ocs_ddump_value(textbuf, "n_eq", "%d", hal->eq_count);
468  ocs_ddump_value(textbuf, "n_cq", "%d", hal->cq_count);
469  ocs_ddump_value(textbuf, "n_mq", "%d", hal->mq_count);
470  ocs_ddump_value(textbuf, "n_rq", "%d", hal->rq_count);
471  ocs_ddump_value(textbuf, "n_wq", "%d", hal->wq_count);
472  ocs_ddump_value(textbuf, "n_sgl", "%d", hal->config.n_sgl);
473 
474  ocs_ddump_sli(textbuf, &hal->sli);
475 
476  ocs_ddump_sli4_queue(textbuf, "wq", hal, hal->wq, hal->wq_count,
477  ((flags & OCS_DDUMP_FLAGS_WQES) ? qentries : 0));
478  ocs_ddump_sli4_queue(textbuf, "rq", hal, hal->rq, hal->rq_count,
479  ((flags & OCS_DDUMP_FLAGS_RQES) ? qentries : 0));
480  ocs_ddump_sli4_queue(textbuf, "mq", hal, hal->mq, hal->mq_count,
481  ((flags & OCS_DDUMP_FLAGS_MQES) ? qentries : 0));
482  ocs_ddump_sli4_queue(textbuf, "cq", hal, hal->cq, hal->cq_count,
483  ((flags & OCS_DDUMP_FLAGS_CQES) ? qentries : 0));
484  ocs_ddump_sli4_queue(textbuf, "eq", hal, hal->eq, hal->eq_count,
485  ((flags & OCS_DDUMP_FLAGS_EQES) ? qentries : 0));
486 
487  /* dump the IO quarantine list */
488  for (i = 0; i < hal->wq_count; i++) {
489  ocs_ddump_section(textbuf, "io_quarantine", i);
490  ocs_ddump_value(textbuf, "quarantine_index", "%d", hal->hal_wq[i]->quarantine_info.quarantine_index);
491  for (j = 0; j < OCS_HAL_QUARANTINE_QUEUE_DEPTH; j++) {
492  if (hal->hal_wq[i]->quarantine_info.quarantine_ios[j] != NULL) {
493  ocs_ddump_hal_io(textbuf, hal->hal_wq[i]->quarantine_info.quarantine_ios[j]);
494  }
495  }
496  ocs_ddump_endsection(textbuf, "io_quarantine", i);
497  }
498 
499  ocs_ddump_section(textbuf, "workaround", ocs->instance_index);
500  ocs_ddump_value(textbuf, "fwrev", "%08" PRIx64, hal->workaround.fwrev);
501  ocs_ddump_endsection(textbuf, "workaround", ocs->instance_index);
502 
503  ocs_lock(&hal->io_lock);
504  ocs_ddump_section(textbuf, "io_inuse", ocs->instance_index);
505  ocs_list_foreach(&hal->io_inuse, io) {
506  ocs_ddump_hal_io(textbuf, io);
507  }
508  ocs_ddump_endsection(textbuf, "io_inuse", ocs->instance_index);
509 
510  ocs_ddump_section(textbuf, "io_wait_free", ocs->instance_index);
511  ocs_list_foreach(&hal->io_wait_free, io) {
512  ocs_ddump_hal_io(textbuf, io);
513  }
514  ocs_ddump_endsection(textbuf, "io_wait_free", ocs->instance_index);
515  ocs_ddump_section(textbuf, "io_free", ocs->instance_index);
516  ocs_list_foreach(&hal->io_free, io) {
517  if (io->xbusy) {
518  /* only display free ios if they're active */
519  ocs_ddump_hal_io(textbuf, io);
520  }
521  cnt++;
522  }
523  ocs_ddump_endsection(textbuf, "io_free", ocs->instance_index);
524  ocs_ddump_value(textbuf, "ios_free", "%d", cnt);
525 
526  ocs_ddump_value(textbuf, "sec_hio_wait_count", "%d", hal->sec_hio_wait_count);
527  ocs_unlock(&hal->io_lock);
528 
529  /* now check the IOs not in a list; i.e. sequence coalescing xris */
530  ocs_ddump_section(textbuf, "port_owned_ios", ocs->instance_index);
531  for (i = 0; i < hal->config.n_io; i++) {
532  io = hal->io[i];
533  if (!io)
534  continue;
535 
536  if (ocs_hal_is_xri_port_owned(hal, io->indicator)) {
537  if (ocs_ref_read_count(&io->ref)) {
538  /* only display free ios if they're active */
539  ocs_ddump_hal_io(textbuf, io);
540  }
541  }
542  }
543  ocs_ddump_endsection(textbuf, "port_owned_ios", ocs->instance_index);
544 
545  ocs_textbuf_printf(textbuf, "<rpi_ref>");
546  for (i = 0; i < max_rpi; i++) {
547  if (ocs_atomic_read(&hal->rpi_ref[i].rpi_attached) ||
548  ocs_atomic_read(&hal->rpi_ref[i].rpi_count) ) {
549  ocs_textbuf_printf(textbuf, "[%d] att=%d cnt=%d\n", i,
550  ocs_atomic_read(&hal->rpi_ref[i].rpi_attached),
551  ocs_atomic_read(&hal->rpi_ref[i].rpi_count));
552  }
553  }
554  ocs_textbuf_printf(textbuf, "</rpi_ref>");
555 
556  for (i = 0; i < hal->wq_count; i++) {
557  ocs_ddump_value(textbuf, "wq_submit", "%d", hal->tcmd_wq_submit[i]);
558  }
559  for (i = 0; i < hal->wq_count; i++) {
560  ocs_ddump_value(textbuf, "wq_complete", "%d", hal->tcmd_wq_complete[i]);
561  }
562 
563  hal_queue_ddump(textbuf, hal);
564 
565  ocs_ddump_endsection(textbuf, "hal", ocs->instance_index);
566 
567  //sli4_link_event_t link;
568 }
569 
570 void
571 hal_queue_ddump(ocs_textbuf_t *textbuf, ocs_hal_t *hal)
572 {
573  hal_eq_t *eq;
574  hal_cq_t *cq;
575  hal_q_t *q;
576  hal_mq_t *mq;
577  hal_wq_t *wq;
578  hal_rq_t *rq;
579 
580  ocs_ddump_section(textbuf, "hal_queue", 0);
581  ocs_list_foreach(&hal->eq_list, eq) {
582  ocs_ddump_section(textbuf, "eq", eq->instance);
583  ocs_ddump_value(textbuf, "queue-id", "%d", eq->queue->id);
584  OCS_STAT(ocs_ddump_value(textbuf, "use_count", "%d", eq->use_count));
585  ocs_list_foreach(&eq->cq_list, cq) {
586  ocs_ddump_section(textbuf, "cq", cq->instance);
587  ocs_ddump_value(textbuf, "queue-id", "%d", cq->queue->id);
588  OCS_STAT(ocs_ddump_value(textbuf, "use_count", "%d", cq->use_count));
589  ocs_list_foreach(&cq->q_list, q) {
590  switch(q->type) {
591  case SLI_QTYPE_MQ:
592  mq = (hal_mq_t *) q;
593  ocs_ddump_section(textbuf, "mq", mq->instance);
594  ocs_ddump_value(textbuf, "queue-id", "%d", mq->queue->id);
595  OCS_STAT(ocs_ddump_value(textbuf, "use_count", "%d", mq->use_count));
596  ocs_ddump_endsection(textbuf, "mq", mq->instance);
597  break;
598  case SLI_QTYPE_WQ:
599  wq = (hal_wq_t *) q;
600  ocs_ddump_section(textbuf, "wq", wq->instance);
601  ocs_ddump_value(textbuf, "queue-id", "%d", wq->queue->id);
602  OCS_STAT(ocs_ddump_value(textbuf, "use_count", "%d", wq->use_count));
603  ocs_ddump_value(textbuf, "wqec_count", "%d", wq->wqec_count);
604  ocs_ddump_value(textbuf, "free_count", "%d", wq->free_count);
605  OCS_STAT(ocs_ddump_value(textbuf, "wq_pending_count", "%d",
606  wq->wq_pending_count));
607  ocs_ddump_endsection(textbuf, "wq", wq->instance);
608  break;
609  case SLI_QTYPE_RQ:
610  rq = (hal_rq_t *) q;
611  ocs_ddump_section(textbuf, "rq", rq->instance);
612  OCS_STAT(ocs_ddump_value(textbuf, "use_count", "%d", rq->use_count));
613  ocs_ddump_value(textbuf, "filter_mask", "%d", rq->filter_mask);
614  if (rq->hdr != NULL) {
615  ocs_ddump_value(textbuf, "hdr-id", "%d", rq->hdr->id);
616  OCS_STAT(ocs_ddump_value(textbuf, "hdr_use_count", "%d", rq->hdr_use_count));
617  }
618  if (rq->first_burst != NULL) {
619  OCS_STAT(ocs_ddump_value(textbuf, "fb-id", "%d", rq->first_burst->id));
620  OCS_STAT(ocs_ddump_value(textbuf, "fb_use_count", "%d", rq->fb_use_count));
621  }
622  if (rq->data != NULL) {
623  OCS_STAT(ocs_ddump_value(textbuf, "payload-id", "%d", rq->data->id));
624  OCS_STAT(ocs_ddump_value(textbuf, "payload_use_count", "%d", rq->payload_use_count));
625  }
626  ocs_ddump_value(textbuf, "rq_empty_warn_count", "%d", rq->rq_empty_warn_count);
627  ocs_ddump_value(textbuf, "rq_empty_err_count", "%d", rq->rq_empty_err_count);
628  ocs_ddump_endsection(textbuf, "rq", rq->instance);
629  break;
630  default:
631  break;
632  }
633  }
634  ocs_ddump_endsection(textbuf, "cq", cq->instance);
635  }
636  ocs_ddump_endsection(textbuf, "eq", eq->instance);
637  }
638  ocs_ddump_endsection(textbuf, "hal_queue", 0);
639 }
640 
641 /**
642  * @brief Initiate ddump
643  *
644  * Traverses the ocs/domain/port/node/io data structures to generate a driver
645  * dump.
646  *
647  * @param ocs pointer to device context
648  * @param textbuf pointer to text buffer
649  * @param flags ddump flags
650  * @param qentries number of queue entries to dump
651  *
652  * @return Returns 0 on success, or a negative value on failure.
653  */
654 
655 int
656 ocs_ddump(ocs_t *ocs, ocs_textbuf_t *textbuf, uint32_t flags, uint32_t qentries)
657 {
658  ocs_xport_t *xport = ocs->xport;
659  ocs_domain_t *domain;
660  uint32_t instance;
661  ocs_vport_spec_t *vport;
662  ocs_io_t *io;
663  int retval = 0;
664  uint32_t i;
665 
666  ocs_ddump_startfile(textbuf);
667 
668  ocs_ddump_section(textbuf, "ocs", ocs->instance_index);
669 
670  ocs_ddump_section(textbuf, "ocs_os", ocs->instance_index);
671  ocs_ddump_value(textbuf, "numa_node", "%d", ocs->ocs_os.numa_node);
672 
673  ocs_ddump_endsection(textbuf, "ocs_os", ocs->instance_index);
674 
675  ocs_ddump_value(textbuf, "drv_name", "%s", DRV_NAME);
676  ocs_ddump_value(textbuf, "drv_version", "%s", DRV_VERSION);
677  ocs_ddump_value(textbuf, "display_name", "%s", ocs->display_name);
678  ocs_ddump_value(textbuf, "enable_ini", "%d", ocs->enable_ini);
679  ocs_ddump_value(textbuf, "enable_tgt", "%d", ocs->enable_tgt);
680  ocs_ddump_value(textbuf, "enable_hlm", "%d", ocs->enable_hlm);
681  ocs_ddump_value(textbuf, "hlm_group_size", "%d", ocs->hlm_group_size);
682  ocs_ddump_value(textbuf, "fw_dump_type", "%d", ocs->fw_dump.type);
683  if (xport) {
684  ocs_ddump_value(textbuf, "nodes_count", "%d", xport->nodes_count);
685  ocs_ddump_value(textbuf, "io_alloc_failed_count", "%d", ocs_atomic_read(&xport->io_alloc_failed_count));
686  ocs_ddump_value(textbuf, "io_active_count", "%d", ocs_atomic_read(&xport->io_active_count));
687  ocs_ddump_value(textbuf, "io_pending_count", "%d", ocs_atomic_read(&xport->io_pending_count));
688  ocs_ddump_value(textbuf, "io_total_alloc", "%d", ocs_atomic_read(&xport->io_total_alloc));
689  ocs_ddump_value(textbuf, "io_total_free", "%d", ocs_atomic_read(&xport->io_total_free));
690  ocs_ddump_value(textbuf, "io_total_pending", "%d", ocs_atomic_read(&xport->io_total_pending));
691  ocs_ddump_value(textbuf, "io_pending_recursing", "%d", ocs_atomic_read(&xport->io_pending_recursing));
692  ocs_ddump_value(textbuf, "max_isr_time_msec", "%d", ocs->max_isr_time_msec);
693  for (i = 0; i < SLI4_MAX_FCFI; i++) {
694  ocs_lock(&xport->fcfi[i].pend_frames_lock);
695  if (!ocs_list_empty(&xport->fcfi[i].pend_frames)) {
696  ocs_hal_sequence_t *frame;
697  ocs_ddump_section(textbuf, "pending_frames", i);
698  ocs_ddump_value(textbuf, "hold_frames", "%d", xport->fcfi[i].hold_frames);
699  ocs_list_foreach(&xport->fcfi[i].pend_frames, frame) {
700  fc_header_t *hdr;
701  char buf[256];
702 
703  hdr = frame->header->dma.virt;
704  ocs_snprintf(buf, sizeof(buf), "%02x/%06x/%02x/%02x/%04x/%04x len %ld",
705  hdr->type, fc_be24toh(hdr->f_ctl), hdr->r_ctl, hdr->info,
706  ocs_be16toh(hdr->ox_id), ocs_be16toh(hdr->rx_id),
707  frame->payload->dma.len);
708  ocs_ddump_value(textbuf, "frame", "%s", buf);
709  }
710  ocs_ddump_endsection(textbuf, "pending_frames", i);
711  }
712  ocs_unlock(&xport->fcfi[i].pend_frames_lock);
713  }
714 
715  ocs_lock(&xport->io_pending_lock);
716  ocs_ddump_section(textbuf, "io_pending_list", ocs->instance_index);
717  ocs_list_foreach(&xport->io_pending_list, io) {
718  ocs_ddump_io(textbuf, io);
719  }
720  ocs_ddump_endsection(textbuf, "io_pending_list", ocs->instance_index);
721  ocs_unlock(&xport->io_pending_lock);
722 
723 
724  /* Dump any pending vports */
725  if (ocs_device_lock_try(ocs) != TRUE) {
726  /* Didn't get the lock */
727  return -1;
728  }
729  instance = 0;
730  ocs_list_foreach(&xport->vport_list, vport) {
731  ocs_ddump_section(textbuf, "vport_spec", instance);
732  ocs_ddump_value(textbuf, "domain_instance", "%d", vport->domain_instance);
733  ocs_ddump_value(textbuf, "wwnn", "%" PRIx64, vport->wwnn);
734  ocs_ddump_value(textbuf, "wwpn", "%" PRIx64, vport->wwpn);
735  ocs_ddump_value(textbuf, "fc_id", "0x%x", vport->fc_id);
736  ocs_ddump_value(textbuf, "enable_tgt", "%d", vport->enable_tgt);
737  ocs_ddump_value(textbuf, "enable_ini", "%d" PRIx64, vport->enable_ini);
738  ocs_ddump_endsection(textbuf, "vport_spec", instance ++);
739  }
740  ocs_device_unlock(ocs);
741  }
742 #if defined(ENABLE_LOCK_DEBUG)
743  /* Dump the lock list */
744  ocs_ddump_section(textbuf, "locks", 0);
745  ocs_lock(&ocs->ocs_os.locklist_lock); {
746  ocs_lock_t *l;
747  uint32_t idx = 0;
748  ocs_list_foreach(&ocs->ocs_os.locklist, l) {
749  ocs_ddump_section(textbuf, "lock", idx);
750  ocs_ddump_value(textbuf, "name", "%s", l->name);
751  ocs_ddump_value(textbuf, "inuse", "%d", l->inuse);
752  ocs_ddump_value(textbuf, "caller", "%p", l->caller[0]);
753  ocs_ddump_value(textbuf, "pid", "%08x", l->pid.l);
754  ocs_ddump_endsection(textbuf, "lock", idx);
755  idx++;
756  }
757  } ocs_unlock(&ocs->ocs_os.locklist_lock);
758  ocs_ddump_endsection(textbuf, "locks", 0);
759 #endif
760  /* Dump target and initiator private data */
763 
764  ocs_ddump_hal(textbuf, &ocs->hal, flags, qentries);
765 
766  if (ocs_device_lock_try(ocs) != TRUE) {
767  /* Didn't get the lock */
768  return -1;
769  }
770  /* Here the device lock is held */
771  ocs_list_foreach(&ocs->domain_list, domain) {
772  retval = ocs_ddump_domain(textbuf, domain);
773  if (retval != 0) {
774  break;
775  }
776  }
777 
778  /* Dump ramlog */
779  ocs_ddump_ramlog(textbuf, ocs->ramlog);
780  ocs_device_unlock(ocs);
781 
782 #if !defined(OCS_DEBUG_QUEUE_HISTORY)
783  ocs_ddump_section(textbuf, "q_hist", ocs->instance_index);
784  ocs_textbuf_printf(textbuf, "<history>\n");
785  ocs_textbuf_printf(textbuf, "No history available\n");
786  ocs_textbuf_printf(textbuf, "</history>\n");
787  ocs_ddump_endsection(textbuf, "q_hist", ocs->instance_index);
788 #else
789  ocs_ddump_queue_history(textbuf, &ocs->hal.q_hist);
790 #endif
791 
792 #if defined(OCS_DEBUG_MEMORY)
793  ocs_memory_allocated_ddump(textbuf);
794 #endif
795 
796  ocs_ddump_endsection(textbuf, "ocs", ocs->instance_index);
797 
798  ocs_ddump_endfile(textbuf);
799 
800  return retval;
801 }
802 
803 /**
804  * @brief Capture and save ddump
805  *
806  * Captures and saves a ddump to the ocs_t structure to save the
807  * current state. The goal of this function is to save a ddump
808  * as soon as an issue is encountered. The saved ddump will be
809  * kept until the user reads it.
810  *
811  * @param ocs pointer to device context
812  * @param flags ddump flags
813  * @param qentries number of queue entries to dump
814  *
815  * @return 0 if ddump was saved; > 0 of one already exists; < 0
816  * error
817  */
818 
819 int32_t
820 ocs_save_ddump(ocs_t *ocs, uint32_t flags, uint32_t qentries)
821 {
822  if (ocs_textbuf_get_written(&ocs->ddump_saved) > 0) {
823  ocs_log_debug(ocs, "Saved ddump already exists\n");
824  return 1;
825  }
826 
827  if (!ocs_textbuf_initialized(&ocs->ddump_saved)) {
828  ocs_log_err(ocs, "Saved ddump not allocated\n");
829  return -1;
830  }
831 
832  ocs_log_debug(ocs, "Saving ddump\n");
833  ocs_ddump(ocs, &ocs->ddump_saved, flags, qentries);
834  ocs_log_debug(ocs, "Saved ddump: %d bytes written\n", ocs_textbuf_get_written(&ocs->ddump_saved));
835  return 0;
836 }
837 
838 /**
839  * @brief Capture and save ddump for all OCS instances
840  *
841  * Calls ocs_save_ddump() for each OCS instance.
842  *
843  * @param flags ddump flags
844  * @param qentries number of queue entries to dump
845  * @param alloc_flag allocate dump buffer if not already allocated
846  *
847  * @return 0 if ddump was saved; > 0 of one already exists; < 0
848  * error
849  */
850 
851 int32_t
852 ocs_save_ddump_all(uint32_t flags, uint32_t qentries, uint32_t alloc_flag)
853 {
854  ocs_t *ocs;
855  uint32_t i;
856  int32_t rc = 0;
857 
858  for (i = 0; (ocs = ocs_get_instance(i)) != NULL; i++) {
859  if (alloc_flag && (!ocs_textbuf_initialized(&ocs->ddump_saved))) {
860  rc = ocs_textbuf_alloc(ocs, &ocs->ddump_saved, DEFAULT_SAVED_DUMP_SIZE);
861  if (rc) {
862  ocs_log_err(ocs, "textbuf_alloc failed\n");
863  break;
864  }
865  }
866 
867  rc = ocs_save_ddump(ocs, flags, qentries);
868  if (rc < 0) {
869  ocs_log_err(ocs, "save ddump failed\n");
870  break;
871  }
872  }
873  return rc;
874 }
875 
876 /**
877  * @brief Clear the previously saved ddump, and collect
878  * the ddump for all OCS instances of the adapter
879  */
880 int32_t
881 ocs_adapter_ddump_clear_and_save(ocs_t *ocs, uint8_t bus, uint8_t dev,
882  uint32_t flags, uint32_t qentries, uint32_t alloc_flag)
883 {
884  ocs_t *other_ocs;
885  uint8_t other_bus, other_dev, other_func;
886  int32_t index = 0, rc = 0;
887 
888  while ((other_ocs = ocs_get_instance(index++)) != NULL) {
889  ocs_get_bus_dev_func(other_ocs, &other_bus, &other_dev, &other_func);
890  if ((bus == other_bus) && (dev == other_dev)) {
891  if (alloc_flag) {
892  /* Clear the previously saved ddump */
893  ocs_clear_saved_ddump(other_ocs);
894 
895  rc = ocs_textbuf_alloc(other_ocs, &other_ocs->ddump_saved, DEFAULT_SAVED_DUMP_SIZE);
896  if (rc) {
897  ocs_log_err(other_ocs, "textbuf_alloc failed\n");
898  goto clear_ddump;
899  }
900  }
901 
902  rc = ocs_save_ddump(other_ocs, flags, qentries);
903  if (rc < 0) {
904  ocs_log_err(other_ocs, "Save ddump failed\n");
905  goto clear_ddump;
906  }
907 
908  ocs_log_debug(other_ocs, "Saved the driver dump successfully\n");
909  }
910  }
911 
912  return rc;
913 
914 clear_ddump:
915  index = 0;
916  while ((other_ocs = ocs_get_instance(index++)) != NULL) {
917  ocs_get_bus_dev_func(other_ocs, &other_bus, &other_dev, &other_func);
918  if ((bus == other_bus) && (dev == other_dev)) {
919  ocs_clear_saved_ddump(other_ocs);
920  }
921  }
922 
923  return rc;
924 }
925 
926 /**
927  * @brief Clear saved ddump
928  *
929  * Clears saved ddump to make room for next one.
930  *
931  * @param ocs pointer to device context
932  *
933  * @return 0 if ddump was cleared; > 0 no saved ddump found
934  */
935 
936 int32_t
938 {
939  /* if there's a saved ddump, copy to newly allocated textbuf */
940  if (ocs_textbuf_get_written(&ocs->ddump_saved)) {
941  ocs_log_debug(ocs, "saved ddump cleared\n");
942  ocs_textbuf_reset(&ocs->ddump_saved);
943  return 0;
944  } else {
945  ocs_log_debug(ocs, "no saved ddump found\n");
946  return 1;
947  }
948 }
949 
uint32_t sgl_page_sizes
Definition: sli4.h:3674
uint32_t chain_sge_initial_value_hi
Definition: sli4.h:3556
uint32_t uint32_t sge_supported_length
Definition: sli4.h:3654
uint32_t r_ctl
Definition: ocs_fcp.h:158
int ocs_ddump(ocs_t *ocs, ocs_textbuf_t *textbuf, uint32_t flags, uint32_t qentries)
Initiate ddump.
Definition: ocs_ddump.c:656
static void ocs_ddump_sli4_queue(ocs_textbuf_t *textbuf, const char *name, ocs_hal_t *hal, sli4_queue_t **queue, uint32_t q_count, uint32_t qentries)
Generate sli4 queue ddump.
Definition: ocs_ddump.c:62
#define OCS_DDUMP_FLAGS_WQES
Definition: ocs_ddump.h:38
static int32_t ocs_list_on_list(ocs_list_link_t *link)
Test if object is on a list.
Definition: ocs_list.h:460
int32_t ocs_adapter_ddump_clear_and_save(ocs_t *ocs, uint8_t bus, uint8_t dev, uint32_t flags, uint32_t qentries, uint32_t alloc_flag)
Clear the previously saved ddump, and collect the ddump for all OCS instances of the adapter...
Definition: ocs_ddump.c:881
sli4_qtype_e
Definition: sli4.h:3423
uint16_t e_d_tov
Definition: sli4.h:3614
uint16_t link_module_type
Definition: sli4.h:3621
static void ocs_ddump_sli(ocs_textbuf_t *textbuf, sli4_t *sli4)
Generate SLI4 ddump.
Definition: ocs_ddump.c:177
uint16_t size
Definition: sli4.h:3453
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:3606
uint16_t sgl_index_field_offset
Definition: sli4.h:3552
uint32_t max_qentries[SLI_QTYPE_MAX]
Definition: sli4.h:3617
ocs_hal_rq_buffer_t * header
Definition: ocs_hal.h:790
uint8_t ocs_hal_is_xri_port_owned(ocs_hal_t *hal, uint32_t xri)
Return TRUE if exchange is port-owned.
Definition: ocs_hal.c:12808
static int32_t ocs_list_empty(ocs_list_t *list)
Test if a list is empty.
Definition: ocs_list.h:125
uint32_t hw_rev[3]
Definition: sli4.h:3631
uint32_t sgl_pre_registered
Definition: sli4.h:3654
void ocs_ddump_endfile(ocs_textbuf_t *textbuf)
Generate driver dump end of file information.
Definition: ocs_ddumplib.c:73
sli4_sgl_chaining_params_t sgl_chaining_params
Definition: sli4.h:3677
uint32_t posted_limit
Definition: sli4.h:3461
uint8_t wwpn[8]
Definition: sli4.h:3626
uint32_t index
Definition: sli4.h:3452
uint32_t ox_id
Definition: ocs_fcp.h:168
#define DRV_VERSION
Definition: ocs.h:49
int32_t ocs_textbuf_get_written(ocs_textbuf_t *textbuf)
Definition: ocs_textbuf.c:54
const char * name
Definition: ocs_ddump.h:54
#define OCS_DDUMP_FLAGS_RQES
Definition: ocs_ddump.h:41
uint16_t r_a_tov
Definition: sli4.h:3615
#define DRV_NAME
Definition: ocs.h:48
int32_t ocs_ddump_ramlog(ocs_textbuf_t *textbuf, ocs_ramlog_t *ramlog)
Perform ramlog buffer driver dump.
Definition: ocs_ramlog.c:266
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:820
uint32_t sli_rev
Definition: sli4.h:3605
struct sli4_t::@47 config
#define OCS_DDUMP_FLAGS_EQES
Definition: ocs_ddump.h:42
Definition: sli4.h:3601
int32_t ocs_clear_saved_ddump(ocs_t *ocs)
Clear saved ddump.
Definition: ocs_ddump.c:937
void hal_queue_ddump(ocs_textbuf_t *textbuf, ocs_hal_t *hal)
Definition: ocs_ddump.c:571
FC header in big-endian order.
Definition: ocs_fcp.h:157
static void ocs_device_unlock(ocs_t *ocs)
Definition: ocs_drv_fc.h:223
uint8_t type
Definition: sli4.h:3460
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:852
static int32_t ocs_device_lock_try(ocs_t *ocs)
Definition: ocs_drv_fc.h:197
struct sli4_queue_t::@44::@45 flag
sli4_asic_type_e asic_type
Definition: sli4.h:3609
uint32_t high_login_mode
Definition: sli4.h:3654
uint16_t length
Definition: sli4.h:3454
uint32_t if_type
Definition: sli4.h:3607
uint16_t id
Definition: sli4.h:3456
#define DEFAULT_SAVED_DUMP_SIZE
Definition: ocs_ddump.c:42
ocs_t * ocs_get_instance(uint32_t index)
return pointer to ocs structure given instance index
#define OCS_STAT(x)
Definition: ocs_stats.h:46
static uint32_t sli_get_max_rsrc(sli4_t *sli4, sli4_resource_e rsrc)
Definition: sli4.h:3714
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
Fields retrieved from skyhawk that used used to build chained SGL.
Definition: sli4.h:3549
uint16_t n_posted
Definition: sli4.h:3455
uint32_t f_ctl
Definition: ocs_fcp.h:163
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:143
void ocs_ddump_startfile(ocs_textbuf_t *textbuf)
Generate driver dump start of file information.
Definition: ocs_ddumplib.c:53
uint32_t sgl_pre_registration_required
Definition: sli4.h:3654
uint32_t max_num_processed
Definition: sli4.h:3462
sli4_qtype_e type
Definition: ocs_hal.h:1160
static void ocs_ddump_hal(ocs_textbuf_t *textbuf, ocs_hal_t *hal, uint32_t flags, uint32_t qentries)
Generate hal ddump.
Definition: ocs_ddump.c:418
uint32_t r_idx
Definition: sli4.h:3471
void ocs_scsi_tgt_ddump(ocs_textbuf_t *textbuf, ocs_scsi_ddump_type_e type, void *obj)
Definition: ocs_ramd.c:6580
uint8_t fw_name[2][16]
Definition: sli4.h:3629
uint32_t sli_reg_read(sli4_t *sli, sli4_regname_e reg)
Read the given SLI register.
Definition: sli4.c:240
uint32_t last_processed_time
Definition: sli4.h:3464
void ocs_ddump_io(ocs_textbuf_t *textbuf, ocs_io_t *io)
Generate IO context ddump data.
Definition: ocs_io.c:385
uint8_t rq_batch
Definition: sli4.h:3622
Defines a general FC sequence object, consisting of a header, payload buffers and a HAL IO in the cas...
Definition: ocs_hal.h:784
void ocs_textbuf_printf(ocs_textbuf_t *textbuf, const char *fmt,...)
Helper function to dump message.
Definition: ocs_textbuf.c:238
uint32_t rx_id
Definition: ocs_fcp.h:168
ocs_dma_t dma
Definition: ocs_hal.h:328
uint32_t chain_sge_initial_value_lo
Definition: sli4.h:3555
int32_t ocs_get_bus_dev_func(ocs_t *ocs, uint8_t *bus, uint8_t *dev, uint8_t *func)
uint32_t info
Definition: ocs_fcp.h:158
uint32_t type
Definition: ocs_fcp.h:163
#define SLI4_MAX_FCFI
Maximum value for a FCFI.
Definition: sli4_fc.h:52
uint32_t max_sgl_pages
Definition: sli4.h:3675
#define OCS_HAL_QUARANTINE_QUEUE_DEPTH
Define the fields required to implement the skyhawk DIF quarantine.
Definition: ocs_hal.h:878
void ocs_textbuf_reset(ocs_textbuf_t *textbuf)
Definition: ocs_textbuf.c:406
#define ocs_assert(cond,...)
Definition: ocs_debug.h:176
uint16_t max_qcount[SLI_QTYPE_MAX]
Definition: sli4.h:3616
uint32_t fw_rev[2]
Definition: sli4.h:3628
uint64_t sgl_index_field_mask
Definition: sli4.h:3554
uint8_t topology
Definition: sli4.h:3625
static uint32_t fc_be24toh(uint32_t x)
Definition: ocs_fcp.h:143
int32_t ocs_textbuf_alloc(ocs_t *ocs, ocs_textbuf_t *textbuf, uint32_t length)
Definition: ocs_textbuf.c:105
uint16_t frag_num_field_offset
Definition: sli4.h:3551
uint64_t frag_num_field_mask
Definition: sli4.h:3553
uint32_t ocs_textbuf_initialized(ocs_textbuf_t *textbuf)
Definition: ocs_textbuf.c:94
uint32_t qpage_count[SLI_QTYPE_MAX]
Definition: sli4.h:3620
uint64_t max_process_time_ms
Definition: sli4.h:3463
#define ocs_list_foreach(list, item)
Iterate a linked list.
Definition: ocs_list.h:428
#define OCS_DDUMP_FLAGS_CQES
Definition: ocs_ddump.h:39
int ocs_ddump_domain(ocs_textbuf_t *textbuf, ocs_domain_t *domain)
Generate a domain ddump.
Definition: ocs_domain.c:1376
sli4_asic_rev_e asic_rev
Definition: sli4.h:3610
static void ocs_ddump_hal_io(ocs_textbuf_t *textbuf, ocs_hal_io_t *io)
Dump HAL IO.
Definition: ocs_ddump.c:283
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
union sli4_queue_t::@44 u
ocs_hal_rq_buffer_t * payload
Definition: ocs_hal.h:791
ocs_dma_t dma
Definition: sli4.h:3450
uint8_t wwnn[8]
Definition: sli4.h:3627
void ocs_scsi_ini_ddump(ocs_textbuf_t *textbuf, ocs_scsi_ddump_type_e type, void *obj)
Definition: ocs_ini_stub.c:266
#define OCS_DDUMP_FLAGS_MQES
Definition: ocs_ddump.h:40