stif_mgmt.h (22130B)
1 /** \file bcm_int/dnx/stat/stif/stif_mgmt.h 2 * 3 * Internal DNX STAT STIF MGMT 4 * 5 * This license is set out in https://raw.githubusercontent.com/Broadcom-Network-Switching-Software/OpenBCM/master/Legal/LICENSE file. 6 * 7 * Copyright 2007-2020 Broadcom Inc. All rights reserved. 8 */ 9 10 #ifndef _DNX_STIF_MGMT_INCLUDED__ 11 /* 12 * { 13 */ 14 #define _DNX_STIF_MGMT_INCLUDED__ 15 16 #ifndef BCM_DNX_SUPPORT 17 #error "This file is for use by DNX (JR2) family only!" 18 #endif 19 20 #include <bcm/cosq.h> 21 #include <soc/dnx/dbal/dbal.h> 22 /* 23 * MACROs 24 * { 25 */ 26 27 /** 28 * \brief 29 * defines the instance invalid value 30 */ 31 #define DNX_STIF_MGMT_INSTANCE_INVALID (-1) 32 33 /** 34 * \brief - return if the given element type is Object 35 */ 36 #define DNX_STIF_MGMT_BILLING_RECORD_ELEMENT_IS_OBJECT(_unit, _element_type) \ 37 (_element_type == bcmStatStifRecordElementObj0 || _element_type == bcmStatStifRecordElementObj1 || _element_type == bcmStatStifRecordElementObj2 || _element_type == bcmStatStifRecordElementObj3) 38 39 /** 40 * \brief - return if the given billing source is ENQUEUE source 41 */ 42 #define DNX_STIF_MGMT_BILLING_SOURCE_IS_ENQ_GET(_unit, _source_id, _is_enq) \ 43 {\ 44 _is_enq = (_source_id == DBAL_ENUM_FVAL_STIF_BILLING_SOURCE_ING_INT_ENQ || _source_id == DBAL_ENUM_FVAL_STIF_BILLING_SOURCE_ING_EXT_ENQ) ? TRUE : FALSE; \ 45 } 46 47 /** 48 * \brief - return if the given billing source is ENQUEUE source 49 */ 50 #define DNX_STIF_MGMT_BILLING_SOURCE_IS_DEQ_GET(_unit, _source_id, _is_deq) \ 51 {\ 52 _is_deq = (_source_id == DBAL_ENUM_FVAL_STIF_BILLING_SOURCE_ING_INT_DEQ || _source_id == DBAL_ENUM_FVAL_STIF_BILLING_SOURCE_ING_EXT_DEQ) ? TRUE : FALSE; \ 53 } 54 55 /** 56 * \brief - return if the given qsize source is ENQUEUE source 57 */ 58 #define DNX_STIF_MGMT_QSIZE_SOURCE_IS_ENQ_GET(_unit, _source_id, _is_enq) \ 59 {\ 60 _is_enq = (_source_id == DBAL_ENUM_FVAL_STIF_QSIZE_SOURCE_ING_INT_ENQ || _source_id == DBAL_ENUM_FVAL_STIF_QSIZE_SOURCE_ING_EXT_ENQ) ? TRUE : FALSE; \ 61 } 62 63 /** 64 * \brief - return if the given qsize source is ENQUEUE source 65 */ 66 #define DNX_STIF_MGMT_QSIZE_SOURCE_IS_DEQ_GET(_unit, _source_id, _is_deq) \ 67 {\ 68 _is_deq = (_source_id == DBAL_ENUM_FVAL_STIF_QSIZE_SOURCE_ING_INT_DEQ || _source_id == DBAL_ENUM_FVAL_STIF_QSIZE_SOURCE_ING_EXT_DEQ) ? TRUE : FALSE; \ 69 } 70 /* 71 * } 72 */ 73 74 typedef enum 75 { 76 dnx_stat_stif_mgmt_report_mode_qsize = 0, 77 dnx_stat_stif_mgmt_report_mode_billing = 1, 78 dnx_stat_stif_mgmt_report_mode_billing_ingress = 2 79 } dnx_stat_stif_mgmt_report_mode_t; 80 81 typedef enum 82 { 83 dnx_stat_stif_mgmt_opcode_use_one_type = 0, 84 dnx_stat_stif_mgmt_opcode_use_two_types = 1, 85 dnx_stat_stif_mgmt_opcode_use_three_types = 2, 86 dnx_stat_stif_mgmt_opcode_use_four_types = 3 87 } dnx_stat_stif_mgmt_opcode_t; 88 89 /** 90 * holds report format element (element type and mask) and 91 * shift used for sorting in the correct order the elements 92 */ 93 typedef struct dnx_stif_mgmt_report_format_element_with_shift_s 94 { 95 bcm_stat_stif_record_format_element_t element; 96 int shift; 97 } dnx_stif_mgmt_report_format_element_with_shift_t; 98 99 #define STIF_MGMT_VERIFY_GET 0 100 #define STIF_MGMT_VERIFY_SET 1 101 102 #define DNX_STIF_MGMT_ENABLE_COMPENSATION 1 103 #define DNX_STIF_MGMT_DISABLE_COMPENSATION 0 104 105 /** 106 * \brief 107 * defines the size of ingress elements (excluding the 4 objects 108 * and the PacketSize) 109 */ 110 #define DNX_STIF_INGRESS_MAX_RECORD_ELEMENTS (16) 111 /** 112 * \brief 113 * defines the size of egress elements (excluding the 4 objects 114 * and the PacketSize) 115 */ 116 #define DNX_STIF_EGRESS_MAX_RECORD_METADATA_ELEMENTS (10) 117 /** 118 * \brief 119 * defines the max possible nof object elements in a record 120 */ 121 #define DNX_STIF_RECORD_MAX_NOF_OBJECT_ELEMENTS (4) 122 123 #define DNX_STIF_MGMT_STAT_OBJ_MASK_16_BITS 0xFFFF 124 #define DNX_STIF_MGMT_STAT_OBJ_MASK_18_BITS 0x3FFFF 125 #define DNX_STIF_MGMT_STAT_OBJ_SHIFT_16_BITS 16 126 #define DNX_STIF_MGMT_STAT_OBJ_SHIFT_18_BITS 18 127 128 /** 129 * holds report format element type and its corresponding dbal 130 * mask field and dbal shift field 131 */ 132 typedef struct dnx_stif_mgmt_report_format_element_s 133 { 134 bcm_stat_stif_record_element_type_t element_type; 135 dbal_fields_e dbal_element_mask_field; 136 dbal_fields_e dbal_element_shift_field; 137 } dnx_stif_mgmt_report_format_element_t; 138 139 /** 140 * holds table for ingress billing report format types and their 141 * corresponding dbal mask and shift fields 142 */ 143 static const dnx_stif_mgmt_report_format_element_t ingress_element_enum_to_dbal_fields_binding_table[] = { 144 {bcmStatStifRecordElementObj0, DBAL_FIELD_EMPTY, DBAL_FIELD_EMPTY}, 145 {bcmStatStifRecordElementObj1, DBAL_FIELD_EMPTY, DBAL_FIELD_EMPTY}, 146 {bcmStatStifRecordElementObj2, DBAL_FIELD_EMPTY, DBAL_FIELD_EMPTY}, 147 {bcmStatStifRecordElementObj3, DBAL_FIELD_EMPTY, DBAL_FIELD_EMPTY}, 148 {bcmStatStifRecordElementPacketSize, DBAL_FIELD_EMPTY, DBAL_FIELD_EMPTY}, 149 {bcmStatStifRecordElementOpCode, DBAL_FIELD_STIF_CGM_BILL_OP_CODE_MASK, DBAL_FIELD_STIF_CGM_BILL_OP_CODE_SHIFT}, 150 {bcmStatStifRecordElementIngressDispositionIsDrop, DBAL_FIELD_STIF_CGM_BILL_RJCT_MASK, 151 DBAL_FIELD_STIF_CGM_BILL_RJCT_SHIFT}, 152 {bcmStatStifRecordElementIngressTmDropReason, DBAL_FIELD_STIF_CGM_BILL_RJCT_REASON_MASK, 153 DBAL_FIELD_STIF_CGM_BILL_RJCT_REASON_SHIFT}, 154 {bcmStatStifRecordElementIngressTrafficClass, DBAL_FIELD_STIF_CGM_BILL_TC_MASK, DBAL_FIELD_STIF_CGM_BILL_TC_SHIFT}, 155 {bcmStatStifRecordElementIngressIncomingDropPrecedence, DBAL_FIELD_STIF_CGM_BILL_IN_DP_MASK, 156 DBAL_FIELD_STIF_CGM_BILL_IN_DP_SHIFT}, 157 {bcmStatStifRecordElementIngressDropPrecedenceMeterResolved, DBAL_FIELD_STIF_CGM_BILL_FINAL_DP_MASK, 158 DBAL_FIELD_STIF_CGM_BILL_FINAL_DP_SHIFT}, 159 {bcmStatStifRecordElementIngressDropPrecedenceMeter0Valid, DBAL_FIELD_STIF_CGM_BILL_OBJ_0_DP_VALID_MASK, 160 DBAL_FIELD_STIF_CGM_BILL_OBJ_0_DP_VALID_SHIFT}, 161 {bcmStatStifRecordElementIngressDropPrecedenceMeter0Value, DBAL_FIELD_STIF_CGM_BILL_OBJ_0_DP_MASK, 162 DBAL_FIELD_STIF_CGM_BILL_OBJ_0_DP_SHIFT}, 163 {bcmStatStifRecordElementIngressDropPrecedenceMeter1Valid, DBAL_FIELD_STIF_CGM_BILL_OBJ_1_DP_VALID_MASK, 164 DBAL_FIELD_STIF_CGM_BILL_OBJ_1_DP_VALID_SHIFT}, 165 {bcmStatStifRecordElementIngressDropPrecedenceMeter1Value, DBAL_FIELD_STIF_CGM_BILL_OBJ_1_DP_MASK, 166 DBAL_FIELD_STIF_CGM_BILL_OBJ_1_DP_SHIFT}, 167 {bcmStatStifRecordElementIngressDropPrecedenceMeter2Valid, DBAL_FIELD_STIF_CGM_BILL_OBJ_2_DP_VALID_MASK, 168 DBAL_FIELD_STIF_CGM_BILL_OBJ_2_DP_VALID_SHIFT}, 169 {bcmStatStifRecordElementIngressDropPrecedenceMeter2Value, DBAL_FIELD_STIF_CGM_BILL_OBJ_2_DP_MASK, 170 DBAL_FIELD_STIF_CGM_BILL_OBJ_2_DP_SHIFT}, 171 {bcmStatStifRecordElementIngressCore, DBAL_FIELD_STIF_CGM_BILL_CORE_ID_MASK, 172 DBAL_FIELD_STIF_CGM_BILL_CORE_ID_SHIFT}, 173 {bcmStatStifRecordElementIngressPpMetaData, DBAL_FIELD_STIF_CGM_BILL_PP_META_DATA_MASK, 174 DBAL_FIELD_STIF_CGM_BILL_PP_META_DATA_SHIFT}, 175 {bcmStatStifRecordElementIngressQueueNumber, DBAL_FIELD_STIF_CGM_BILL_QNUM_MASK, 176 DBAL_FIELD_STIF_CGM_BILL_QNUM_SHIFT}, 177 {bcmStatStifRecordElementEgressMetaDataMultiCast, -1, -1}, 178 {bcmStatStifRecordElementEgressMetaDataPpDropReason, -1, -1}, 179 {bcmStatStifRecordElementEgressMetaDataPort, -1, -1}, 180 {bcmStatStifRecordElementEgressMetaDataEcnEligibleAndCni, -1, -1}, 181 {bcmStatStifRecordElementEgressMetaDataTrafficClass, -1, -1}, 182 {bcmStatStifRecordElementEgressMetaDataDropPrecedence, -1, -1}, 183 {bcmStatStifRecordElementEgressMetaDataObj0, -1, -1}, 184 {bcmStatStifRecordElementEgressMetaDataObj1, -1, -1}, 185 {bcmStatStifRecordElementEgressMetaDataObj2, -1, -1}, 186 {bcmStatStifRecordElementEgressMetaDataObj3, -1, -1}, 187 {bcmStatStifRecordElementEgressMetaDataCore, -1, -1}, 188 {bcmStatStifRecordElementIngressIsLastCopy, DBAL_FIELD_STIF_CGM_BILL_IS_LAST_COPY_MASK, 189 DBAL_FIELD_STIF_CGM_BILL_IS_LAST_COPY_SHIFT} 190 }; 191 192 /* 193 * Functions prototypes 194 * { 195 */ 196 197 /** 198 * \brief 199 * initialize dnx stat stif module 200 * \param [in] unit - unit id 201 * \return 202 * shr_error_e - Error Type 203 * \remark 204 * * None 205 * \see 206 * * None 207 */ 208 shr_error_e dnx_stif_init( 209 int unit); 210 211 /** 212 * \brief 213 * deinitialize dnx stif module 214 * \param [in] unit - unit id 215 * \return 216 * shr_error_e - Error Type 217 * \remark 218 * * None 219 * \see 220 * * None 221 */ 222 shr_error_e dnx_stif_deinit( 223 int unit); 224 225 /** 226 * \brief 227 * for the given port reset the credits for the sif instance 228 * \param [in] unit - unit id 229 * \param [in] instance_core - core id of the instance 230 * \param [in] instance_id - id of the instance 231 * \return 232 * shr_error_e - Error Type 233 * \remark 234 * * None 235 * \see 236 * * None 237 */ 238 shr_error_e dnx_stif_mgmt_credit_reset( 239 int unit, 240 int instance_core, 241 int instance_id); 242 243 /** 244 * \brief 245 * for the given logical port return if it's connected to any sif instance, 246 * if yes: return the instance id and the core id of the instance 247 * \param [in] unit - unit id 248 * \param [in] port - logical port stat 249 * \param [out] instance_core - core id of the instance 250 * \param [out] instance_id - the instance id it is represented 251 * \param [out] is_connected - if port is connected to any of the SIF instances 252 * \return 253 * shr_error_e - Error Type 254 * \remark 255 * * None 256 * \see 257 * * None 258 */ 259 shr_error_e dnx_stif_mgmt_logical_port_is_connected( 260 int unit, 261 bcm_port_t port, 262 int *instance_core, 263 int *instance_id, 264 uint8 *is_connected); 265 /** 266 * \brief 267 * for the given logical port return the instance id and the 268 * core id of the instance 269 * \param [in] unit - unit id 270 * \param [in] port - logical port stat 271 * \param [in] source - source given 272 * \param [in] instance_core - core id of the instance 273 * \param [out] instance_id - the instance id it is represented 274 * \return 275 * shr_error_e - Error Type 276 * \remark 277 * * None 278 * \see 279 * * None 280 */ 281 shr_error_e dnx_stif_mgmt_logical_port_to_instance_id_get( 282 int unit, 283 bcm_port_t port, 284 bcm_stat_stif_source_t source, 285 int *instance_core, 286 int *instance_id); 287 288 /** 289 * \brief 290 * map in DBAL statistics source (statistics interface source) 291 * to logical port 292 * \param [in] unit - unit ID 293 * \param [in] flags - flags 294 * \param [in] source - stif source type and core 295 * \param [in] port - logical port 296 * \return 297 * shr_error_e - Error Type 298 * \remark 299 * * 300 * \see 301 * * None 302 */ 303 shr_error_e dnx_stif_mgmt_source_mapping_set( 304 int unit, 305 int flags, 306 bcm_stat_stif_source_t source, 307 bcm_port_t port); 308 309 /** 310 * \brief 311 * API get the mapping of statistics source to its logical port. 312 * port=invalid means that the source is disconnected. 313 * in addition it can return the SIF instance id and core that connect to that port. 314 * \param [in] unit - unit ID 315 * \param [in] flags - flags 316 * \param [in] source - stif source type and core 317 * \param [out] port - logical port the source is connected 318 * \param [out] instance_id - the SIF instance id that the port is conencted to 319 * \param [out] instance_core - the SIF instance core the port is connected to 320 * \return 321 * shr_error_e - Error Type 322 * \remark 323 * * 324 * \see 325 * * None 326 */ 327 shr_error_e dnx_stif_mgmt_source_mapping_get( 328 int unit, 329 int flags, 330 bcm_stat_stif_source_t source, 331 bcm_port_t * port, 332 int *instance_id, 333 int *instance_core); 334 335 /** 336 * \brief - 337 * API bcm_stat_control_set - called with control bcmStatControlStifFcEnable 338 * Flow control enable (dequeue only) 339 * \param [in] unit - unit id 340 * \param [in] flags - flags 341 * \param [in] fc_enable - flow control enabled/disabled 342 * \return 343 * See shr_error_e 344 * \remark 345 * * None 346 * \see 347 * * None 348 */ 349 shr_error_e dnx_stif_mgmt_flow_control_enable_set( 350 int unit, 351 int flags, 352 int fc_enable); 353 354 /** 355 * \brief - 356 * API bcm_stat_control_get - called with control 357 * bcmStatControlStifFcEnable Flow control enabled/disabled 358 * (dequeue only) 359 * \param [in] unit - unit id 360 * \param [in] flags - flags 361 * \param [out] fc_enable - flow control enabled/disabled 362 * \return 363 * See shr_error_e 364 * \remark 365 * * None 366 * \see 367 * * None 368 */ 369 shr_error_e dnx_stif_mgmt_flow_control_enable_get( 370 int unit, 371 int flags, 372 int *fc_enable); 373 374 /** 375 * \brief 376 * sort the given array of report formats according to the 377 * shift value in ascending order 378 * \param [in] unit - unit id 379 * \param [in] object_count - count of the objects 380 * \param [out] count - count the elements 381 * \param [out] elements_array_get - elements array with shift 382 * and masks values 383 * \return 384 * shr_error_e - Error Type 385 * \remark 386 * * None 387 * \see 388 * * None 389 */ 390 shr_error_e dnx_stif_mgmt_ingress_format_elements_shift_values_get( 391 int unit, 392 int object_count, 393 int *count, 394 dnx_stif_mgmt_report_format_element_with_shift_t * elements_array_get); 395 396 /** 397 * \brief 398 * sort the given array of report formats according to the 399 * shift value in ascending order 400 * \param [in] unit - unit id 401 * \param [in] is_ingress - if it is called from ingress or 402 * egress 403 * \param [in] nof_elements - nof elements 404 * \param [in] elements_array - array of elements and shifts 405 * \return 406 * shr_error_e - Error Type 407 * \remark 408 * * None 409 * \see 410 * * None 411 */ 412 shr_error_e dnx_stif_mgmt_format_elements_array_sort( 413 int unit, 414 int is_ingress, 415 int nof_elements, 416 dnx_stif_mgmt_report_format_element_with_shift_t * elements_array); 417 418 /** 419 * \brief 420 * service function - builds the format of the billing records 421 * - ingress 422 * \param [in] unit - unit ID 423 * \param [in] nof_elements - nof of elements set in the format 424 * \param [in] record_format_elements - format elements 425 * \return 426 * shr_error_e - Error Type 427 * \remark 428 * * 429 * \see 430 * * None 431 */ 432 shr_error_e dnx_stif_mgmt_ingress_record_format_set( 433 int unit, 434 int nof_elements, 435 bcm_stat_stif_record_format_element_t * record_format_elements); 436 437 /** 438 * \brief 439 * service function - get the format of the billing records - 440 * ingress 441 * \param [in] unit - unit ID 442 * \param [in] max_nof_elements - max nof of elements 443 * \param [out] elements_array - format elements 444 * \param [out] nof_elements - nof elements in the array 445 * \param [out] elements_size_array - the sizes of the elements 446 * \return 447 * shr_error_e - Error Type 448 * \remark 449 * * 450 * \see 451 * * None 452 */ 453 shr_error_e dnx_stif_mgmt_ingress_record_format_get( 454 int unit, 455 int max_nof_elements, 456 bcm_stat_stif_record_format_element_t * elements_array, 457 int *nof_elements, 458 int *elements_size_array); 459 460 /** 461 * \brief 462 * return the dbal value representation for the given ETPP 463 * metadata value) 464 * \param [in] unit - unit id 465 * \param [in] value - hw value 466 * \param [out] opcode_mask - mask value 467 * \param [out] shift - how many bits to shift 468 * \return 469 * shr_error_e - Error Type 470 * \remark 471 * * None 472 * \see 473 * * None 474 */ 475 shr_error_e dnx_stif_mgmt_report_format_opcode_hw_mask_value_get( 476 int unit, 477 uint32 value, 478 uint32 *opcode_mask, 479 int *shift); 480 481 /** 482 * \brief 483 * service function - builds the format of the billing records 484 * - egress 485 * \param [in] unit - unit ID 486 * \param [in] nof_elements - nof of elements set in the format 487 * \param [in] record_format_elements - format elements 488 * \return 489 * shr_error_e - Error Type 490 * \remark 491 * * 492 * \see 493 * * None 494 */ 495 shr_error_e dnx_stif_mgmt_egress_record_format_set( 496 int unit, 497 int nof_elements, 498 bcm_stat_stif_record_format_element_t * record_format_elements); 499 500 /** 501 * \brief 502 * service function - get the format of the billing records - 503 * egress 504 * \param [in] unit - unit ID 505 * \param [in] max_nof_elements - max nof of elements 506 * \param [out] elements_array - format elements 507 * \param [out] nof_elements - nof elements in the array 508 * \param [out] elements_size_array - the sizes of the 509 * elements 510 * \return 511 * shr_error_e - Error Type 512 * \remark 513 * * 514 * \see 515 * * None 516 */ 517 shr_error_e dnx_stif_mgmt_egress_record_format_get( 518 int unit, 519 int max_nof_elements, 520 bcm_stat_stif_record_format_element_t * elements_array, 521 int *nof_elements, 522 int *elements_size_array); 523 524 /** 525 * \brief 526 * verify function for API bcm_cosq_control_range_set 527 * \param [in] unit - unit ID 528 * \param [in] verify_set - if is called from set or get API 529 * \param [in] port - gport 530 * \param [in] type - control type - Queues/ScrubberQueues 531 * \param [in] range - queue range 532 * \return 533 * shr_error_e - Error Type 534 * \remark 535 * * 536 * \see 537 * * None 538 */ 539 shr_error_e dnx_stif_mgmt_control_range_verify( 540 int unit, 541 int verify_set, 542 bcm_gport_t port, 543 bcm_cosq_control_range_type_t type, 544 bcm_cosq_range_t * range); 545 546 /** 547 * \brief 548 * configure range of queues for queues/scrubber reports - 549 * service func to API bcm_cosq_control_range_set 550 * type=bcmCosqStatIfQueues or type=bcmCosqStatIfScrubberQueues 551 * for StatIfQueues - configure the 2 queues with same range 552 * 553 * valid for all report modes 554 * \param [in] unit - unit id 555 * \param [in] core - core id 556 * \param [in] type - qnum or scrubber 557 * \param [in] range_start - q range start 558 * \param [in] range_end - q range end 559 * \return 560 * shr_error_e - Error Type 561 * \remark 562 * * None 563 * \see 564 * * None 565 */ 566 shr_error_e dnx_stif_mgmt_queues_range_dbal_set( 567 int unit, 568 bcm_core_t core, 569 bcm_cosq_control_range_type_t type, 570 int range_start, 571 int range_end); 572 573 /** 574 * \brief 575 * get queue range for qsize/scrubber reports - service func 576 * to API bcm_cosq_control_range_get type=bcmCosqStatIfQueues 577 * or type=bcmCosqStatIfScrubberQueues 578 * for StatIfQueues return range of queue 0 (API assumes both 579 * has the same value) 580 * 581 * valid for all report modes 582 * \param [in] unit - unit id 583 * \param [in] core - core id 584 * \param [in] type - type - qnum or scrubber 585 * \param [out] range_start - q range start 586 * \param [out] range_end - q range end 587 * \return 588 * shr_error_e - Error Type 589 * \remark 590 * * None 591 * \see 592 * * None 593 */ 594 shr_error_e dnx_stif_mgmt_queues_range_dbal_get( 595 int unit, 596 bcm_core_t core, 597 bcm_cosq_control_range_type_t type, 598 int *range_start, 599 int *range_end); 600 601 /** 602 * \brief - 603 * verification for API bcm_stat_pkt_size_adjust_select_set/get 604 * \param [in] unit - Unit-ID 605 * \param [in] key - core,source,command_id - only core is used 606 * \param [in] select_type - header adjust select type 607 * 608 * \return 609 * See shr_error_e 610 * \remark 611 * * None 612 * \see 613 * * None 614 */ 615 shr_error_e dnx_stif_mgmt_pkt_size_adjust_select_verify( 616 int unit, 617 bcm_stat_counter_command_id_key_t * key, 618 bcm_stat_pkt_size_adjust_select_type_t select_type); 619 620 /** 621 * \brief - 622 * verification for API bcm_stat_pkt_size_adjust_select_set 623 * \param [in] unit - Unit-ID 624 * \param [in] key - core,source,command_id - only core is used 625 * \param [in] select_type - header adjust select type 626 * \param [in] enable - header-truncate enabled/disabled 627 * 628 * \return 629 * See shr_error_e 630 * \remark 631 * * None 632 * \see 633 * * None 634 */ 635 shr_error_e dnx_stif_mgmt_pkt_size_adjust_select_set_verify( 636 int unit, 637 bcm_stat_counter_command_id_key_t * key, 638 bcm_stat_pkt_size_adjust_select_type_t select_type, 639 int enable); 640 641 /** 642 * \brief - 643 * for IRPP/ITM set which IRPP/ITM mask is used - enable/disable 644 * header truncate compensation 645 * \param [in] unit - Unit-ID 646 * \param [in] key - core,source,command_id 647 * \param [in] select_type - header adjust select type 648 * \param [in] enable - header-truncate enabled/disabled 649 * 650 * \return 651 * See shr_error_e 652 * \remark 653 * * None 654 * \see 655 * * None 656 */ 657 shr_error_e dnx_stif_mgmt_pkt_size_adjust_select_set( 658 int unit, 659 bcm_stat_counter_command_id_key_t * key, 660 bcm_stat_pkt_size_adjust_select_type_t select_type, 661 int enable); 662 663 /** 664 * \brief - 665 * for IRPP/ITM get which IRPP/ITM mask is used - if 666 * header-truncate is enabled or not 667 * \param [in] unit - Unit-ID 668 * \param [in] key - core,source,command_id 669 * \param [in] select_type - header adjust select type 670 * \param [out] enable - header-truncate enabled/disabled 671 * 672 * \return 673 * See shr_error_e 674 * \remark 675 * * None 676 * \see 677 * * None 678 */ 679 shr_error_e dnx_stif_mgmt_pkt_size_adjust_select_get( 680 int unit, 681 bcm_stat_counter_command_id_key_t * key, 682 bcm_stat_pkt_size_adjust_select_type_t select_type, 683 int *enable); 684 685 /** 686 * \brief - 687 * verification for API bcm_stat_pkt_size_adjust_select_set/get 688 * \param [in] unit - Unit-ID 689 * \param [in] key - core,source,command_id 690 * \param [in] filter - select filter group to be set 691 * 692 * \return 693 * See shr_error_e 694 * \remark 695 * * None 696 * \see 697 * * None 698 */ 699 shr_error_e dnx_stif_mgmt_filter_group_verify( 700 int unit, 701 bcm_stat_counter_command_id_key_t * key, 702 bcm_stat_counter_group_filter_t filter); 703 704 /** 705 * \brief - 706 * verification for API bcm_stat_pkt_size_adjust_select_set 707 * \param [in] unit - Unit-ID 708 * \param [in] key - core,source,command_id 709 * \param [in] filter - select filter group to be set 710 * \param [in] is_active - is the filter group active 711 * 712 * \return 713 * See shr_error_e 714 * \remark 715 * * None 716 * \see 717 * * None 718 */ 719 shr_error_e dnx_stif_mgmt_filter_group_set_verify( 720 int unit, 721 bcm_stat_counter_command_id_key_t * key, 722 bcm_stat_counter_group_filter_t filter, 723 int is_active); 724 725 /** 726 * \brief 727 * set filter criteria group to be filtered in/out 728 * \param [in] unit - unit id 729 * \param [in] key - core, source, command_id 730 * \param [in] filter - filter group 731 * \param [in] is_active - activate/deactivate the filter group 732 * \return 733 * \retval Non-zero (!= _SHR_E_NONE) in case of an error 734 * \retval Zero (= _SHR_E_NONE) in case of NO ERROR 735 * \remark 736 * NONE 737 * \see 738 * NONE 739 */ 740 shr_error_e dnx_stif_mgmt_filter_group_set( 741 int unit, 742 bcm_stat_counter_command_id_key_t * key, 743 bcm_stat_counter_group_filter_t filter, 744 int is_active); 745 746 /** 747 * \brief 748 * determine if certain filter is active 749 * \param [in] unit - unit id 750 * \param [in] key - core, source, command_id 751 * \param [in] filter - filter group 752 * \param [out] is_active - is the filter active 753 * \return 754 * \retval Non-zero (!= _SHR_E_NONE) in case of an error 755 * \retval Zero (= _SHR_E_NONE) in case of NO ERROR 756 * \remark 757 * NONE 758 * \see 759 * NONE 760 */ 761 shr_error_e dnx_stif_mgmt_filter_group_get( 762 int unit, 763 bcm_stat_counter_command_id_key_t * key, 764 bcm_stat_counter_group_filter_t filter, 765 int *is_active); 766 767 #endif/*_DNX_STIF_MGMT_INCLUDED__*/