2 * Copyright (C) 2013 Freescale Semiconductor, Inc.
4 * Permission is hereby granted, free of charge, to any person obtaining a copy
5 * of this software and associated documentation files (the "Software"), to deal
6 * in the Software without restriction, including without limitation the rights
7 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 * copies of the Software, and to permit persons to whom the Software is
9 * furnished to do so, subject to the following conditions:
11 * The above copyright notice and this permission notice shall be included
12 * in all copies or substantial portions of the Software.
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
27 #include "FManDebugLog.h"
29 using std::ostringstream
;
36 // return the log to the initial state
37 void FManDebugLog::reset()
39 log_complete_
= false;
40 log_parse_error_
= LOG_PARSE_NO_ERROR
;
41 vector
<FManModuleDebugLog
*>::iterator it
;
42 for (it
= logs_
.begin(); it
!= logs_
.end(); it
++) {
47 context_complete_
= false;
48 context_data_
.clear();
51 // add context data to the log
52 bool FManDebugLog::addContextData(uint32_t context_data
)
54 if (!context_complete_
) {
55 context_data_
.push_back(context_data
);
57 return !context_complete_
;
60 // parse the context data into the defined sub module logs
61 bool FManDebugLog::parseContextData()
63 FManModuleDebugLog
*log
;
65 if (!context_complete_
) {
66 log_complete_
= false;
70 vector
<uint32_t>::iterator pos
= context_data_
.begin();
71 while (pos
< context_data_
.end() &&
72 log_parse_error_
== LOG_PARSE_NO_ERROR
) {
74 // size of this log entry context data in bytes
75 // except for Fman Controller where it denotes words
76 uint32_t data_len
= (*pos
>> NIA_SIZE_SHIFT
& NIA_SIZE_MASK
);
78 log_parse_error_
= LOG_PARSE_DATA_LENGTH_ERROR
;
82 // identify the type of log from the word at pos
83 int eng
= *pos
>> NIA_ENG_SHIFT
& NIA_ENG_MASK
;
86 // data_len is measured here in words (4bytes)
87 assert(data_len
== 1 || data_len
== 2 || data_len
== 3);
88 vector
<uint32_t>::iterator frame_end
= pos
+ data_len
;
89 vector
<uint32_t> c_data(pos
, frame_end
);
90 log
= new FManControllerDebugLog();
91 log
->parseContextData(c_data
);
96 case 0x11: // FManParser
98 // round up the data_len to the next 4 byte multiple
101 (data_len
& 0xfffffffc) + 4 : data_len
;
102 assert(data_len
% 4 == 0);
103 vector
<uint32_t>::iterator frame_end
= pos
105 vector
<uint32_t> c_data(pos
, frame_end
);
106 log
= new FManParserDebugLog();
107 log
->parseContextData(c_data
);
108 logs_
.push_back(log
);
112 case 0x12: // FManKeyGen
115 data_len
== 4 || data_len
== 8
117 vector
<uint32_t>::iterator frame_end
= pos
119 vector
<uint32_t> c_data(pos
, frame_end
);
120 log
= new FManKeyGenDebugLog();
121 log
->parseContextData(c_data
);
122 logs_
.push_back(log
);
126 case 0x13: // FmanPolicer
129 data_len
== 8 || data_len
== 16
131 vector
<uint32_t>::iterator frame_end
= pos
133 vector
<uint32_t> c_data(pos
, frame_end
);
134 log
= new FManPolicerDebugLog();
135 log
->parseContextData(c_data
);
136 logs_
.push_back(log
);
140 case 0x14: // FManBMI
143 data_len
== 8 || data_len
== 16
145 vector
<uint32_t>::iterator frame_end
= pos
147 if (frame_end
<= context_data_
.end()) {
148 vector
<uint32_t> c_data(pos
, frame_end
);
149 log
= new FManBMIDebugLog();
150 log
->parseContextData(c_data
);
151 logs_
.push_back(log
);
154 log_parse_error_
= LOG_PARSE_DATA_LENGTH_ERROR
;
160 data_len
== 4 || data_len
== 8
162 vector
<uint32_t>::iterator frame_end
= pos
164 vector
<uint32_t> c_data(pos
, frame_end
);
165 log
= new FManQMIEnqueueDebugLog();
166 log
->parseContextData(c_data
);
167 logs_
.push_back(log
);
173 data_len
== 4 || data_len
== 8
175 vector
<uint32_t>::iterator frame_end
= pos
177 vector
<uint32_t> c_data(pos
, frame_end
);
178 log
= new FManQMIDequeueDebugLog();
179 log
->parseContextData(c_data
);
180 logs_
.push_back(log
);
185 log_parse_error_
= LOG_PARSE_UNDEFINED_ENG_ERROR
;
190 log_complete_
= true;
192 return log_complete_
;
195 // Output logs as a string
196 // Enforces a format template for log output
197 string
FManDebugLog::asString() const
200 os
<< "Debug Trace Log for FMAN" << (fmanID_
+ 1) << endl
;
201 os
<< "-------------------------" << endl
;
203 // for debug only print out the context data
204 if (log_parse_error_
== LOG_PARSE_NO_ERROR
) {
205 // print all the existing module specific (sub) logs
206 vector
<FManModuleDebugLog
*>::const_iterator it
;
207 for (it
= logs_
.begin(); it
!= logs_
.end(); it
++) {
208 os
<< (*it
)->asString();
212 os
<< "Warning: Detected error during evaluation of context data."
214 switch (log_parse_error_
) {
215 case LOG_PARSE_DATA_LENGTH_ERROR
:
216 os
<< "Data length value is incorrect." << endl
;
218 case LOG_PARSE_UNDEFINED_ENG_ERROR
:
219 os
<< "Undefined FMan Engine." << endl
;
222 os
<< "PROGRAM ERROR: Report this!" << endl
;
225 os
<< "Context raw data follows:"
227 vector
<uint32_t>::const_iterator i
;
228 for (i
= context_data_
.begin(); i
!= context_data_
.end(); i
++) {
229 os
<< "0x" << hex
<< setw(8) << setfill('0') << *i
236 // output top level log as a string
237 string
FManModuleDebugLog::asString() const
242 os
<< nameAsString() << endl
;
244 // Module generic information
245 os
<< "NIA VL : " << verbosity_level_
;
246 switch (verbosity_level_
) {
247 case FMAN_TRACE_DISABLED
:
248 os
<< " - Trace Disabled";
250 case FMAN_TRACE_MINIMUM
:
251 os
<< " - Minimal Trace";
253 case FMAN_TRACE_VERBOSE
:
254 os
<< " - Verbose Trace";
256 case FMAN_TRACE_VERY_VERBOSE
:
257 os
<< " - Very Verbose Trace";
260 os
<< " - Invalid verbosity level";
265 os
<< "NIA ORR : " << dec
<< order_restoration_required_
266 << " - Order restoration "
267 << (order_restoration_required_
? "is" : "is NOT")
268 << " required." << endl
;
270 // add the module specific information
273 if (has_timestamp_
) {
274 os
<< "FM TSTAMP : " << timestamp_
<< " (0x" << hex
<< setw(8)
275 << setfill('0') << timestamp_
<< ")" << dec
<< endl
;
281 // parse the context data header before calling the log specific parser
282 bool FManModuleDebugLog::parseContextData(vector
<uint32_t> &context_data
)
284 vector
<uint32_t>::iterator start
= context_data
.begin();
286 verbosity_level_
= *start
>> NIA_VL_SHIFT
& NIA_VL_MASK
;
287 order_restoration_required_
= *start
>> NIA_ORR_SHIFT
& NIA_ORR_MASK
;
289 return parseContextData_(context_data
);
292 // output a port ID string
293 string
FManModuleDebugLog::portIDasString_(uint32_t port_id
) const
305 os
<< "Offline/Host " << dec
<< port_id
;
315 os
<< "1/2.5G Eth" << dec
<< port_id
- 0x8 << " Rx";
318 os
<< "(10G Eth1 - 1/2.5G Eth9) Rx";
321 os
<< "(10G Eth2 - 1/2.5G Eth10) Rx";
331 os
<< "1/2.5G Eth" << dec
<< port_id
- 0x8 << " Tx";
334 os
<< "(10G Eth1 - 1/2.5G Eth9) Tx";
337 os
<< "(10G Eth2 - 1/2.5G Eth10) Tx";
340 os
<< "Unknown Port ID";
347 // ------------------------------------------------------------------------------
349 // parse the context data
350 bool FManControllerDebugLog::parseContextData_(vector
<uint32_t> &context_data
)
354 if (verbosity_level_
== FMAN_TRACE_VERBOSE
355 || verbosity_level_
== FMAN_TRACE_VERY_VERBOSE
) {
356 timestamp_
= context_data
[1];
357 has_timestamp_
= true;
360 if (verbosity_level_
== FMAN_TRACE_MINIMUM
361 || verbosity_level_
== FMAN_TRACE_VERBOSE
362 || verbosity_level_
== FMAN_TRACE_VERY_VERBOSE
) {
363 action_code_
= context_data
[0] >> NIA_AC_SHIFT
& NIA_AC_MASK
;
369 // output log as a string
370 string
FManControllerDebugLog::asString_() const
374 // Display the formatted Action code
375 os
<< "ACTION CD : 0x" << hex
<< setw(8) << setfill('0') << action_code_
377 switch (action_code_
) {
378 case CTRL_CLASSIF_CMD
:
379 os
<< "Coarse Classification";
381 case CTRL_INDEP_TX_CMD
:
382 os
<< "Independent Mode Transmit";
384 case CTRL_INDEP_RX_CMD
:
385 os
<< "Independent Mode Receive";
388 os
<< "Host Commands";
391 os
<< "Unknown Action Code";
399 // parse the context data
400 bool FManParserDebugLog::parseContextData_(vector
<uint32_t> &context_data
)
404 if (verbosity_level_
== FMAN_TRACE_VERY_VERBOSE
) {
405 parse_start_point_
= context_data
[2];
406 // gather up to max program counters
407 // from the remaining data
410 if (verbosity_level_
== FMAN_TRACE_VERBOSE
411 || verbosity_level_
== FMAN_TRACE_VERY_VERBOSE
) {
412 timestamp_
= context_data
[1];
413 has_timestamp_
= true;
416 if (verbosity_level_
== FMAN_TRACE_MINIMUM
417 || verbosity_level_
== FMAN_TRACE_VERBOSE
418 || verbosity_level_
== FMAN_TRACE_VERY_VERBOSE
) {
419 hxs_id_
= context_data
[0] >> NIA_AC_HXS_ID_SHIFT
420 & NIA_AC_HXS_ID_MASK
;
426 // output log as a string
427 string
FManParserDebugLog::asString_() const
431 // Display the formatted Action code
432 os
<< "HXS ID : 0x" << hex
<< setw(8) << setfill('0') << hxs_id_
436 os
<< "Ethernet HXS";
438 case PARSER_LLC_SNAP_CMD
:
439 os
<< "LLC+SNAP HXS";
441 case PARSER_VLAN_CMD
:
445 os
<< "PPPoE+PPP HXS";
447 case PARSER_MPLS_CMD
:
450 case PARSER_IPV4_CMD
:
453 case PARSER_IPV6_CMD
:
459 case PARSER_MINENCAP_CMD
:
460 os
<< "MinEncap HXS";
462 case PARSER_OTHER_L3_CMD
:
463 os
<< "Other L3 Shell HXS";
471 case PARSER_IPSEC_CMD
:
472 os
<< "IPSec Shell HXS";
474 case PARSER_SCTP_CMD
:
475 os
<< "SCTP Shell HXS";
477 case PARSER_DCCP_CMD
:
478 os
<< "DCCP Shell HXS";
480 case PARSER_OTHER_L4_CMD
:
481 os
<< "Other L4 Shell HXS";
483 case PARSER_NULL_CMD
:
484 os
<< "Null Parsing";
487 if (hxs_id_
>= 0x020 && hxs_id_
<= 0x3fd) {
488 os
<< "Soft Parse Program 0x" << hex
<< setw(8)
489 << setfill('0') << hxs_id_
;
491 os
<< "unknown value";
500 // parse the context data
501 bool FManKeyGenDebugLog::parseContextData_(vector
<uint32_t> &context_data
)
505 if (verbosity_level_
== FMAN_TRACE_VERY_VERBOSE
) {
506 selected_scheme_
= context_data
[2] >> FMKG_SS_SHIFT
& FMKG_SS_MASK
;
507 int_frame_ptr_
= context_data
[2] >> FMKG_IFP_SHIFT
& FMKG_IFP_MASK
;
510 if (verbosity_level_
== FMAN_TRACE_VERBOSE
511 || verbosity_level_
== FMAN_TRACE_VERY_VERBOSE
) {
512 timestamp_
= context_data
[1];
513 has_timestamp_
= true;
516 if (verbosity_level_
== FMAN_TRACE_MINIMUM
517 || verbosity_level_
== FMAN_TRACE_VERBOSE
518 || verbosity_level_
== FMAN_TRACE_VERY_VERBOSE
) {
519 ccen_
= context_data
[0] >> NIA_AC_CCEN_SHIFT
& NIA_AC_CCEN_MASK
;
520 ss_
= context_data
[0] >> NIA_AC_SS_SHIFT
& NIA_AC_SS_MASK
;
521 scheme_
= context_data
[0] >> NIA_AC_SCHEME_SHIFT
522 & NIA_AC_SCHEME_MASK
;
528 // output log as a string
529 string
FManKeyGenDebugLog::asString_() const
533 // Display the formatted Action code
534 os
<< "CCEN : " << ccen_
<< " - Coarse Classification "
535 << (ccen_
? "does" : "does NOT")
536 << " overwrite the IC field CCBASE" << endl
;
537 os
<< "SCHEME SEL: " << ss_
<< " - "
538 << (ss_
? "Using SCHEME number" :
539 "Selected according to parse result") << endl
;
541 os
<< "SCHEME : 0x" << setw(2) << setfill('0')
542 << scheme_
<< dec
<< endl
;
545 if (verbosity_level_
== FMAN_TRACE_VERY_VERBOSE
) {
546 os
<< "SEL SCHEME: 0x" << setw(2) << setfill('0')
547 << selected_scheme_
<< dec
<< endl
;
548 os
<< "IN FRM PTR: 0x" << setw(4) << setfill('0')
549 << int_frame_ptr_
<< dec
<< endl
;
555 // parse the context data
556 bool FManPolicerDebugLog::parseContextData_(vector
<uint32_t> &context_data
)
560 if (verbosity_level_
== FMAN_TRACE_VERY_VERBOSE
) {
561 profile_cbs_
= context_data
[4];
562 profile_cts_
= context_data
[5];
563 profile_pbs_ebs_
= context_data
[6];
564 profile_ets_
= context_data
[7];
567 if (verbosity_level_
== FMAN_TRACE_VERBOSE
568 || verbosity_level_
== FMAN_TRACE_VERY_VERBOSE
) {
569 fcs_action_
= (uint8_t) (context_data
[2] >> POLICE_FCS_SHIFT
571 port_id_
= (uint8_t) (context_data
[2] >> POLICE_PORTID_SHIFT
572 & POLICE_PORTID_MASK
);
573 pkt_length_
= (context_data
[3] >> POLICE_PKTLEN_LSB_SHIFT
574 & POLICE_PKTLEN_LSB_MASK
)
575 | ((context_data
[2] >> POLICE_PKTLEN_MSB_SHIFT
576 & POLICE_PKTLEN_MSB_MASK
) << 16);
579 if (verbosity_level_
== FMAN_TRACE_MINIMUM
580 || verbosity_level_
== FMAN_TRACE_VERBOSE
581 || verbosity_level_
== FMAN_TRACE_VERY_VERBOSE
) {
582 timestamp_
= context_data
[1];
583 has_timestamp_
= true;
584 pmo_
= context_data
[0] >> NIA_AC_PMO_SHIFT
& NIA_AC_PMO_MASK
;
585 pnum_
= context_data
[0] >> NIA_AC_PNUM_SHIFT
& NIA_AC_PNUM_MASK
;
591 // output log as a string
592 string
FManPolicerDebugLog::asString_() const
595 // Display the formatted Action code
597 if (verbosity_level_
== FMAN_TRACE_MINIMUM
598 || verbosity_level_
== FMAN_TRACE_VERBOSE
599 || verbosity_level_
== FMAN_TRACE_VERY_VERBOSE
) {
600 os
<< "NIA PMO : " << (uint32_t)pmo_
<< endl
;
601 os
<< "NIA PNUM : 0x" << hex
<< setw(2) << setfill('0')
602 << (uint32_t)pnum_
<< dec
<< endl
;
605 if (verbosity_level_
== FMAN_TRACE_VERBOSE
606 || verbosity_level_
== FMAN_TRACE_VERY_VERBOSE
) {
607 os
<< "FCS : " << (uint32_t)fcs_action_
<< endl
;
608 os
<< "PORT ID : 0x" << hex
<< setw(8) << setfill('0')
609 << (uint32_t)port_id_
<< dec
610 << " - " << portIDasString_(port_id_
) << endl
;
611 os
<< "PKT LEN : 0x" << hex
<< setw(8) << setfill('0')
612 << pkt_length_
<< dec
<< endl
;
615 if (verbosity_level_
== FMAN_TRACE_VERY_VERBOSE
) {
616 os
<< "PRFL_CBS : 0x" << hex
<< setw(8) << setfill('0')
617 << profile_cbs_
<< dec
<< endl
;
618 os
<< "PRFL_CTS : 0x" << hex
<< setw(8) << setfill('0')
619 << profile_cts_
<< dec
<< endl
;
620 os
<< "PRFL_P/EBS: 0x" << hex
<< setw(8) << setfill('0')
621 << profile_pbs_ebs_
<< dec
<< endl
;
622 os
<< "PRFL_CTS : 0x" << hex
<< setw(8) << setfill('0')
623 << profile_cts_
<< dec
<< endl
;
629 // parse the context data
630 bool FManBMIDebugLog::parseContextData_(vector
<uint32_t> &context_data
)
632 static const uint32_t BMI_PORTID_MASK
= 0xff;
633 static const uint32_t BMI_PORTID_SHIFT
= 0;
634 static const uint32_t BMI_TRAP_STATE_MASK
= 0x7;
635 static const uint32_t BMI_TRAP_STATE_SHIFT
= 8;
636 static const uint32_t BMI_FD_MASK
= 0xffff;
637 static const uint32_t BMI_FD_SHIFT
= 15;
641 // Special handling for the FD data
642 fd_
[0] = fd_
[1] = fd_
[2] = fd_
[3] = 0;
643 switch (verbosity_level_
) {
644 case FMAN_TRACE_VERY_VERBOSE
:
645 fd_
[0] = context_data
[4];
646 fd_
[1] = context_data
[5];
647 fd_
[2] = context_data
[6];
648 fd_
[3] = context_data
[7];
650 case FMAN_TRACE_VERBOSE
:
651 fd_
[2] = context_data
[1] >> BMI_FD_SHIFT
& BMI_FD_MASK
;
652 fd_
[3] = context_data
[3];
654 case FMAN_TRACE_MINIMUM
:
655 fd_
[2] = context_data
[1] >> BMI_FD_SHIFT
& BMI_FD_MASK
;
657 case FMAN_TRACE_DISABLED
:
662 if (verbosity_level_
== FMAN_TRACE_VERY_VERBOSE
) {
665 if (verbosity_level_
== FMAN_TRACE_VERBOSE
666 || verbosity_level_
== FMAN_TRACE_VERY_VERBOSE
) {
667 timestamp_
= context_data
[2];
668 has_timestamp_
= true;
671 if (verbosity_level_
== FMAN_TRACE_MINIMUM
672 || verbosity_level_
== FMAN_TRACE_VERBOSE
673 || verbosity_level_
== FMAN_TRACE_VERY_VERBOSE
) {
674 port_id_
= context_data
[1] >> BMI_PORTID_SHIFT
676 debug_trap_state_
= context_data
[1] >> BMI_TRAP_STATE_SHIFT
677 & BMI_TRAP_STATE_MASK
;
678 action_code_
= context_data
[0] >> NIA_AC_SHIFT
& NIA_AC_MASK
;
684 // output log as a string
685 string
FManBMIDebugLog::asString_() const
689 // Display the formatted Action code
690 os
<< "ACTION CD : 0x" << hex
<< setw(8) << setfill('0') << action_code_
692 switch (action_code_
) {
696 case BMI_REL_INT_BUF_TNUM_TERM_CMD
:
698 << "Release internal buffers and tnum. Termination of the task";
700 case BMI_REL_INT_IC_BUF_TNUM_TERM_CMD
:
702 << "Release internal IC buffers and tnum. Termination of the task";
704 case BMI_TX_FR_REL_BUF_OR_ENQ_CMD
:
706 << "Transmit frame and release external and internal buffers or enqueue to return FQID";
708 case BMI_TX_FR_NO_DMA_CMD
:
709 os
<< "Transmit frame without DMA";
711 case BMI_TX_FR_NO_DMA_REL_INT_BUF_CMD
:
712 os
<< "Transmit frame without DMA and release internal buffers";
714 case BMI_TX_FR_NO_DMA_REL_INT_BUF_TERM_CMD
:
716 << "Transmit frame without DMA, release internal buffers and terminate";
719 os
<< "Prepare to enqueue frame";
721 case BMI_DISC_FR_TERM_CMD
:
722 os
<< "Discard frame. Termination of the task";
724 case BMI_FETCH_FR_EXE_CMD
:
725 os
<< "Fetch frame and execute";
727 case BMI_FETCH_FR_HDR_EXE_CMD
:
728 os
<< "Fetch frame header and execute";
731 os
<< "Unknown Action code";
736 os
<< "PORT ID : 0x" << hex
<< port_id_
<< dec
737 << " - " << portIDasString_(port_id_
) << endl
;
738 os
<< "TRAP STATE: 0x" << hex
<< debug_trap_state_
<< dec
<< " -";
739 os
<< (debug_trap_state_
& 0x4 ? " A:set" : " A:clr");
740 os
<< (debug_trap_state_
& 0x2 ? " B:set" : " B:clr");
741 os
<< (debug_trap_state_
& 0x1 ? " C:set" : " C:clr");
743 os
<< "FD Addr : 0x" << hex
<< setw(8) << setfill('0') << fd_
[0]
744 << ":" << setw(8) << setfill('0') << fd_
[1] << ":" << setw(8)
745 << setfill('0') << fd_
[2] << ":" << setw(8) << setfill('0')
746 << fd_
[3] << dec
<< endl
;
751 // parse the context data
752 bool FManQMIDebugLog::parseContextData_(vector
<uint32_t> &context_data
)
756 if (verbosity_level_
== FMAN_TRACE_VERY_VERBOSE
) {
757 cfg_port_pri_
= (uint8_t) (context_data
[3]
758 >> QMI_CFG_PORTPRI_SHIFT
& QMI_CFG_PORTPRI_MASK
);
759 cfg_deq_opt_
= (uint8_t) (context_data
[3]
760 >> QMI_CFG_DEQOPT_SHIFT
& QMI_CFG_DEQOPT_MASK
);
761 cfg_port_en_
= (uint8_t) (context_data
[3]
762 >> QMI_CFG_PORTEN_SHIFT
& QMI_CFG_PORTEN_MASK
);
763 cfg_pref_opt_
= (uint8_t) (context_data
[3]
764 >> QMI_CFG_PREFOPT_SHIFT
& QMI_CFG_PREFOPT_MASK
);
765 cfg_frm_cnt_
= (uint8_t) (context_data
[3]
766 >> QMI_CFG_FRMCNT_SHIFT
& QMI_CFG_FRMCNT_MASK
);
767 cfg_sub_port_
= (uint8_t) (context_data
[3]
768 >> QMI_CFG_SUBPORT_SHIFT
& QMI_CFG_SUBPORT_MASK
);
769 cfg_byte_cnt_
= context_data
[3] >> QMI_CFG_BYTECNT_SHIFT
770 & QMI_CFG_BYTECNT_MASK
;
772 fd_cmd_
= context_data
[3];
774 res_sp_
= (uint8_t) (context_data
[4] >> QMI_RES_SP_SHIFT
776 res_fqid_src_
= (uint8_t) (context_data
[4]
777 >> QMI_RES_FQIDSRC_SHIFT
& QMI_RES_FQIDSRC_MASK
);
778 res_byte_cnt_
= (context_data
[4] >> QMI_RES_BYTECNT_SHIFT
779 & QMI_RES_BYTECNT_MASK
);
780 res_frm_cnt_
= (uint8_t) (context_data
[4]
781 >> QMI_RES_FRMCNT_SHIFT
& QMI_RES_FRMCNT_MASK
);
782 res_tag_
= (uint8_t) (context_data
[4] >> QMI_RES_TAG_SHIFT
786 if (verbosity_level_
== FMAN_TRACE_VERBOSE
787 || verbosity_level_
== FMAN_TRACE_VERY_VERBOSE
) {
788 timestamp_
= context_data
[1];
789 has_timestamp_
= true;
792 if (verbosity_level_
== FMAN_TRACE_MINIMUM
793 || verbosity_level_
== FMAN_TRACE_VERBOSE
794 || verbosity_level_
== FMAN_TRACE_VERY_VERBOSE
) {
800 // output log as a string
801 string
FManQMIDebugLog::asString_() const
805 if (verbosity_level_
== FMAN_TRACE_VERY_VERBOSE
) {
806 os
<< "PORT ENB : " << (uint32_t)cfg_port_en_
<< " - Port "
807 << (cfg_port_en_
? "is" : "is NOT") << " enabled"
809 os
<< "PORT PRI : " << (uint32_t)cfg_port_pri_
810 << (cfg_port_pri_
? " - High" : " - Normal")
811 << " priority" << endl
;
812 os
<< "DEQUE OPT : " << (uint32_t)cfg_deq_opt_
<< " - ";
813 switch (cfg_deq_opt_
) {
815 os
<< "Reserved" << endl
;
819 << "Dequeue with priority precedence and use intra-class scheduling"
824 << "Dequeue with active FQ precedence and use intra-class scheduling"
829 << "Dequeue with active FQ precedence and override intra-class scheduling"
833 os
<< "Reserved" << endl
;
836 os
<< "PREF OPT : " << (uint32_t)cfg_pref_opt_
<< endl
;
837 os
<< "FRAME CNT : " << (uint32_t)cfg_frm_cnt_
<< " - Dequeue "
838 << (cfg_frm_cnt_
? "up to three" : "at most one")
840 os
<< "CFG BYT CNT: 0x" << hex
<< setw(4) << setfill('0')
841 << cfg_byte_cnt_
<< dec
<< endl
;
842 os
<< "FD CMD : 0x" << hex
<< setw(8) << setfill('0')
843 << fd_cmd_
<< dec
<< endl
;
844 os
<< "SUB PORT : " << (uint32_t)cfg_sub_port_
845 << " - Response sub portal" << endl
;
846 os
<< "RES SP : " << (uint32_t)res_sp_
<< endl
;
847 os
<< "RES FQID : " << (uint32_t)res_fqid_src_
;
848 switch (res_fqid_src_
) {
850 os
<< " - Default" << endl
;
853 os
<< " - Context B" << endl
;
856 os
<< " - FD command field" << endl
;
859 os
<< " - TNUM has bypassed dequeue block" << endl
;
862 os
<< " - Unknown" << endl
;
865 os
<< "RES BYT CNT: " << hex
<< setw(4) << setfill('0')
866 << res_byte_cnt_
<< dec
867 << " - Response byte count level control" << endl
;
868 os
<< "RES FRM CNT: " << (uint32_t)res_frm_cnt_
<< endl
;
869 os
<< "RES TAG : 0x" << hex
<< setw(2) << setfill('0')
870 << (uint32_t)res_tag_
<< dec
<< endl
;