42 #define DEFAULT_SAVED_DUMP_SIZE (4*1024*1024)
63 sli4_queue_t **queue, uint32_t q_count, uint32_t qentries)
67 for (i = 0; i < q_count; i++) {
103 uint32_t rqe_count = 0;
110 for (i = 0; i < hal->hal_rq_count; i++) {
112 for (j = 0; j < rq->entry_count; j++) {
113 if (rq->rq_tracker[j] != NULL) {
153 default: q_desc =
"unknown";
break;
193 default: p =
"unknown";
break;
206 default: p =
"unknown";
break;
293 ocs_ddump_value(textbuf,
"ref_count",
"%d", ocs_ref_read_count(&io->ref));
297 ocs_ddump_value(textbuf,
"wq_index",
"%d", (io->wq == NULL ? 0xffff : io->wq->instance));
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"));
309 #if defined(OCS_DEBUG_QUEUE_HISTORY)
318 ocs_ddump_queue_history(
ocs_textbuf_t *textbuf, ocs_hal_q_hist_t *q_hist)
329 if (q_hist->q_hist == NULL) {
341 ocs_lock(&q_hist->q_hist_lock);
342 x = ocs_queue_history_prev_index(q_hist->q_hist_index);
345 ocs_q_hist_ftr_t ftr;
350 ftr.word = q_hist->q_hist[x];
361 ocs_queue_history_type_name(ftr.s.type));
363 if (ocs_queue_history_timestamp_enabled()) {
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);
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);
378 ((q_hist->q_hist[x] >> 16) & 0xFFFF),
379 ((q_hist->q_hist[x] >> 0) & 0xFFFF));
384 if ((mask & 1) && (x != q_hist->q_hist_index)){
386 x = ocs_queue_history_prev_index(x);
388 i, q_hist->q_hist[x]);
390 mask = (mask >> 1UL);
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);
420 ocs_t *ocs = hal->os;
422 ocs_hal_io_t *io = NULL;
432 switch(hal->sli.if_type) {
457 ocs_ddump_value(textbuf,
"io_alloc_failed_count",
"%d", ocs_atomic_read(&hal->io_alloc_failed_count));
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);
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]);
466 ocs_ddump_value(textbuf,
"cq_process_limit",
"%d", hal->config.cq_process_limit);
488 for (i = 0; i < hal->wq_count; i++) {
490 ocs_ddump_value(textbuf,
"quarantine_index",
"%d", hal->hal_wq[i]->quarantine_info.quarantine_index);
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]);
500 ocs_ddump_value(textbuf,
"fwrev",
"%08" PRIx64, hal->workaround.fwrev);
503 ocs_lock(&hal->io_lock);
526 ocs_ddump_value(textbuf,
"sec_hio_wait_count",
"%d", hal->sec_hio_wait_count);
527 ocs_unlock(&hal->io_lock);
531 for (i = 0; i < hal->config.n_io; i++) {
537 if (ocs_ref_read_count(&io->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) ) {
550 ocs_atomic_read(&hal->rpi_ref[i].rpi_attached),
551 ocs_atomic_read(&hal->rpi_ref[i].rpi_count));
556 for (i = 0; i < hal->wq_count; i++) {
559 for (i = 0; i < hal->wq_count; i++) {
560 ocs_ddump_value(textbuf,
"wq_complete",
"%d", hal->tcmd_wq_complete[i]);
606 wq->wq_pending_count));
614 if (rq->hdr != NULL) {
618 if (rq->first_burst != NULL) {
622 if (rq->data != NULL) {
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);
658 ocs_xport_t *xport = ocs->xport;
659 ocs_domain_t *domain;
661 ocs_vport_spec_t *vport;
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);
694 ocs_lock(&xport->fcfi[i].pend_frames_lock);
698 ocs_ddump_value(textbuf,
"hold_frames",
"%d", xport->fcfi[i].hold_frames);
704 ocs_snprintf(buf,
sizeof(buf),
"%02x/%06x/%02x/%02x/%04x/%04x len %ld",
706 ocs_be16toh(hdr->
ox_id), ocs_be16toh(hdr->
rx_id),
712 ocs_unlock(&xport->fcfi[i].pend_frames_lock);
715 ocs_lock(&xport->io_pending_lock);
721 ocs_unlock(&xport->io_pending_lock);
732 ocs_ddump_value(textbuf,
"domain_instance",
"%d", vport->domain_instance);
737 ocs_ddump_value(textbuf,
"enable_ini",
"%d" PRIx64, vport->enable_ini);
742 #if defined(ENABLE_LOCK_DEBUG)
745 ocs_lock(&ocs->ocs_os.locklist_lock); {
757 } ocs_unlock(&ocs->ocs_os.locklist_lock);
782 #if !defined(OCS_DEBUG_QUEUE_HISTORY)
789 ocs_ddump_queue_history(textbuf, &ocs->hal.q_hist);
792 #if defined(OCS_DEBUG_MEMORY)
793 ocs_memory_allocated_ddump(textbuf);
823 ocs_log_debug(ocs,
"Saved ddump already exists\n");
828 ocs_log_err(ocs,
"Saved ddump not allocated\n");
832 ocs_log_debug(ocs,
"Saving ddump\n");
833 ocs_ddump(ocs, &ocs->ddump_saved, flags, qentries);
862 ocs_log_err(ocs,
"textbuf_alloc failed\n");
869 ocs_log_err(ocs,
"save ddump failed\n");
882 uint32_t flags, uint32_t qentries, uint32_t alloc_flag)
885 uint8_t other_bus, other_dev, other_func;
886 int32_t index = 0, rc = 0;
890 if ((bus == other_bus) && (dev == other_dev)) {
897 ocs_log_err(other_ocs,
"textbuf_alloc failed\n");
904 ocs_log_err(other_ocs,
"Save ddump failed\n");
908 ocs_log_debug(other_ocs,
"Saved the driver dump successfully\n");
918 if ((bus == other_bus) && (dev == other_dev)) {
941 ocs_log_debug(ocs,
"saved ddump cleared\n");
945 ocs_log_debug(ocs,
"no saved ddump found\n");
uint32_t chain_sge_initial_value_hi
uint32_t uint32_t sge_supported_length
int ocs_ddump(ocs_t *ocs, ocs_textbuf_t *textbuf, uint32_t flags, uint32_t qentries)
Initiate ddump.
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.
#define OCS_DDUMP_FLAGS_WQES
static int32_t ocs_list_on_list(ocs_list_link_t *link)
Test if object is on a list.
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...
uint16_t link_module_type
static void ocs_ddump_sli(ocs_textbuf_t *textbuf, sli4_t *sli4)
Generate SLI4 ddump.
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.
uint16_t sgl_index_field_offset
uint32_t max_qentries[SLI_QTYPE_MAX]
ocs_hal_rq_buffer_t * header
uint8_t ocs_hal_is_xri_port_owned(ocs_hal_t *hal, uint32_t xri)
Return TRUE if exchange is port-owned.
static int32_t ocs_list_empty(ocs_list_t *list)
Test if a list is empty.
uint32_t sgl_pre_registered
void ocs_ddump_endfile(ocs_textbuf_t *textbuf)
Generate driver dump end of file information.
sli4_sgl_chaining_params_t sgl_chaining_params
int32_t ocs_textbuf_get_written(ocs_textbuf_t *textbuf)
#define OCS_DDUMP_FLAGS_RQES
int32_t ocs_ddump_ramlog(ocs_textbuf_t *textbuf, ocs_ramlog_t *ramlog)
Perform ramlog buffer driver dump.
void ocs_ddump_section(ocs_textbuf_t *textbuf, const char *name, uint32_t instance)
Generate driver dump section start data.
int32_t ocs_save_ddump(ocs_t *ocs, uint32_t flags, uint32_t qentries)
Capture and save ddump.
struct sli4_t::@47 config
#define OCS_DDUMP_FLAGS_EQES
int32_t ocs_clear_saved_ddump(ocs_t *ocs)
Clear saved ddump.
void hal_queue_ddump(ocs_textbuf_t *textbuf, ocs_hal_t *hal)
static void ocs_device_unlock(ocs_t *ocs)
int32_t ocs_save_ddump_all(uint32_t flags, uint32_t qentries, uint32_t alloc_flag)
Capture and save ddump for all OCS instances.
static int32_t ocs_device_lock_try(ocs_t *ocs)
struct sli4_queue_t::@44::@45 flag
sli4_asic_type_e asic_type
#define DEFAULT_SAVED_DUMP_SIZE
ocs_t * ocs_get_instance(uint32_t index)
return pointer to ocs structure given instance index
static uint32_t sli_get_max_rsrc(sli4_t *sli4, sli4_resource_e rsrc)
void ocs_ddump_endsection(ocs_textbuf_t *textbuf, const char *name, uint32_t instance)
Generate driver dump section end data.
Fields retrieved from skyhawk that used used to build chained SGL.
static void ocs_ddump_sli_q_fields(ocs_textbuf_t *textbuf, sli4_t *sli4, sli4_qtype_e qtype)
Generate SLI4 ddump.
void ocs_ddump_startfile(ocs_textbuf_t *textbuf)
Generate driver dump start of file information.
uint32_t sgl_pre_registration_required
uint32_t max_num_processed
static void ocs_ddump_hal(ocs_textbuf_t *textbuf, ocs_hal_t *hal, uint32_t flags, uint32_t qentries)
Generate hal ddump.
void ocs_scsi_tgt_ddump(ocs_textbuf_t *textbuf, ocs_scsi_ddump_type_e type, void *obj)
uint32_t sli_reg_read(sli4_t *sli, sli4_regname_e reg)
Read the given SLI register.
uint32_t last_processed_time
void ocs_ddump_io(ocs_textbuf_t *textbuf, ocs_io_t *io)
Generate IO context ddump data.
Defines a general FC sequence object, consisting of a header, payload buffers and a HAL IO in the cas...
void ocs_textbuf_printf(ocs_textbuf_t *textbuf, const char *fmt,...)
Helper function to dump message.
uint32_t chain_sge_initial_value_lo
int32_t ocs_get_bus_dev_func(ocs_t *ocs, uint8_t *bus, uint8_t *dev, uint8_t *func)
#define SLI4_MAX_FCFI
Maximum value for a FCFI.
#define OCS_HAL_QUARANTINE_QUEUE_DEPTH
Define the fields required to implement the skyhawk DIF quarantine.
void ocs_textbuf_reset(ocs_textbuf_t *textbuf)
#define ocs_assert(cond,...)
uint16_t max_qcount[SLI_QTYPE_MAX]
uint64_t sgl_index_field_mask
static uint32_t fc_be24toh(uint32_t x)
int32_t ocs_textbuf_alloc(ocs_t *ocs, ocs_textbuf_t *textbuf, uint32_t length)
uint16_t frag_num_field_offset
uint64_t frag_num_field_mask
uint32_t ocs_textbuf_initialized(ocs_textbuf_t *textbuf)
uint32_t qpage_count[SLI_QTYPE_MAX]
uint64_t max_process_time_ms
#define ocs_list_foreach(list, item)
Iterate a linked list.
#define OCS_DDUMP_FLAGS_CQES
int ocs_ddump_domain(ocs_textbuf_t *textbuf, ocs_domain_t *domain)
Generate a domain ddump.
static void ocs_ddump_hal_io(ocs_textbuf_t *textbuf, ocs_hal_io_t *io)
Dump HAL IO.
void ocs_ddump_value(ocs_textbuf_t *textbuf, const char *name, const char *fmt,...)
Generate driver dump data for a given value.
union sli4_queue_t::@44 u
ocs_hal_rq_buffer_t * payload
void ocs_scsi_ini_ddump(ocs_textbuf_t *textbuf, ocs_scsi_ddump_type_e type, void *obj)
#define OCS_DDUMP_FLAGS_MQES