field.h (48184B)
1 /*! \file field.h 2 * 3 * BCM field module APIs and structures used only internally. 4 */ 5 /* 6 * This license is set out in https://raw.githubusercontent.com/Broadcom-Network-Switching-Software/OpenBCM/master/Legal/LICENSE file. 7 * 8 * Copyright 2007-2020 Broadcom Inc. All rights reserved. 9 */ 10 11 #ifndef BCMINT_LTSW_MBCM_FIELD_H 12 #define BCMINT_LTSW_MBCM_FIELD_H 13 14 #include <bcm_int/ltsw/field_int.h> 15 #include <bcm_int/ltsw/flexctr.h> 16 17 /*! 18 * \brief Initialize Field control information. 19 * 20 * \param [in] unit Unit number. 21 * \param [out] control_info Field control database. 22 * 23 * \retval SHR_E_NONE No errors. 24 * \retval !SHR_E_NONE Failure. 25 */ 26 typedef int (*field_control_info_init_f)( 27 int unit, 28 bcmint_field_control_info_t *control_info); 29 30 /*! 31 * \brief Initialize Field stage information. 32 * 33 * \param [in] unit Unit number. 34 * \param [out] stage_info Field control database. 35 * 36 * \retval SHR_E_NONE No errors. 37 * \retval !SHR_E_NONE Failure. 38 */ 39 typedef int (*field_stage_info_init_f)( 40 int unit, 41 bcmint_field_stage_info_t *stage_info); 42 43 typedef int (*field_stage_db_init_f)( 44 int unit, 45 bcmint_field_stage_info_t *stage_info); 46 47 typedef int (*field_ingress_profile_init_f)( 48 int unit); 49 50 typedef int (*field_ingress_profile_deinit_f)( 51 int unit); 52 53 typedef int (*field_auto_enum_to_lt_enum_value_get_f)( 54 int unit, 55 bcm_field_qualify_t qual, 56 uint32 qual_enum, 57 bcm_qual_field_t *qual_info); 58 59 typedef int (*field_auto_lt_enum_value_to_enum_get_f)( 60 int unit, 61 bcm_field_qualify_t qual, 62 bcm_qual_field_t *qual_info, 63 uint32 *qual_enum); 64 65 typedef int (*field_manual_enum_to_lt_enum_value_get_f)( 66 int unit, 67 bcm_field_entry_t entry, 68 bcm_field_qualify_t qual, 69 uint32 qual_enum, 70 bcm_qual_field_t *qual_info); 71 72 typedef int (*field_manual_lt_enum_value_to_enum_get_f)( 73 int unit, 74 bcm_field_entry_t entry, 75 bcm_field_qualify_t qual, 76 bcm_qual_field_t *qual_info, 77 uint32 *qual_enum); 78 79 /*! 80 * \brief set action value 81 * 82 * \param [in] unit Unit number. 83 * 84 * \retval SHR_E_NONE No errors. 85 * \retval !SHR_E_NONE Failure. 86 */ 87 typedef int (*field_action_value_set_f)( 88 int unit, bcm_field_entry_t entry_id, 89 bcmi_ltsw_field_stage_t stage, 90 bcm_field_action_t action, 91 bcm_field_action_params_t *params, 92 bcm_field_action_match_config_t *match_config, 93 uint64_t *action_value); 94 95 /*! 96 * \brief get action value 97 * 98 * \param [in] unit Unit number. 99 * 100 * \retval SHR_E_NONE No errors. 101 * \retval !SHR_E_NONE Failure. 102 */ 103 typedef int (*field_action_value_get_f)( 104 int unit, bcm_field_entry_t entry_id, 105 bcmi_ltsw_field_stage_t stage, 106 bcm_field_action_t action, 107 bcm_field_action_params_t *params, 108 bcm_field_action_match_config_t *match_config, 109 uint64_t *action_value); 110 111 typedef int (*field_src_class_enum_to_lt_symbol_get_f)( 112 int unit, 113 bcm_field_src_class_mode_t mode, 114 char **key_fid); 115 116 typedef int (*field_src_class_lt_symbol_to_enum_get_f)( 117 int unit, 118 char *key_fid, 119 bcm_field_src_class_mode_t *mode); 120 121 typedef int (*field_src_class_hw_fields_encode_set_f)( 122 int unit, 123 bcm_field_src_class_mode_t mode, 124 bcm_field_src_class_t src_data, 125 bcm_field_src_class_t src_mask, 126 uint32 *hw_data, 127 uint32 *hw_mask); 128 129 typedef int (*field_src_class_hw_fields_decode_get_f)( 130 int unit, 131 bcm_field_src_class_mode_t mode, 132 uint32 hw_data, 133 uint32 hw_mask, 134 bcm_field_src_class_t *src_data, 135 bcm_field_src_class_t *src_mask); 136 137 typedef int (*field_action_profile_index_get_f) ( 138 int unit, bcm_field_entry_t entry, 139 bcm_field_action_t action, 140 uint16_t *act_prof_idx); 141 142 typedef int (*field_action_profile_add_f) ( 143 int unit, 144 bcmi_ltsw_field_stage_t stage_id, 145 bcm_field_action_t action, 146 bcm_field_action_params_t *params, 147 bcm_field_action_match_config_t *match_config, 148 uint64_t *act_prof_idx_val); 149 150 typedef int (*field_action_profile_get_f) ( 151 int unit, 152 bcmi_ltsw_field_stage_t stage_id, 153 bcm_field_action_t action, 154 uint64_t *act_prof_idx_val, 155 bcm_field_action_params_t *params, 156 bcm_field_action_match_config_t *match_config); 157 158 typedef int (*field_action_profile_del_f) ( 159 int unit, 160 bcmi_ltsw_field_stage_t stage_id, 161 bcm_field_action_t action, 162 uint64_t *act_prof_idx_val); 163 164 typedef int (*field_action_meter_cont_get_f)( 165 int unit, 166 bcmi_ltsw_field_stage_t stage, 167 int slice_idx, 168 char **cont_name); 169 170 typedef int (*field_compression_set_f)( 171 int unit, 172 bcmint_field_stage_info_t *stage_info, 173 bcmi_field_ha_entry_oper_t *entry_oper, 174 bcm_field_qset_t *qset, 175 uint32_t group_flags, 176 bcmlt_entry_handle_t grp_template); 177 178 typedef int (*field_compression_del_f)( 179 int unit, 180 bcmint_field_stage_info_t *stage_info, 181 bcm_field_qset_t *qset, 182 bcmlt_entry_handle_t grp_template); 183 184 typedef int (*field_port_filter_enable_set_f)( 185 int unit, 186 uint32 state, 187 bcm_pbmp_t port_pbmp); 188 189 typedef int (*field_qualify_macro_values_get_f)( 190 int unit, 191 uint8 set_flag, 192 bcm_qual_field_t *qual_info, 193 bcm_qual_field_values_t *qual_info_values); 194 195 typedef int (*field_ifp_clear_f)( 196 int unit); 197 198 typedef int (*field_vfp_clear_f)( 199 int unit); 200 201 typedef int (*field_efp_clear_f)( 202 int unit); 203 204 typedef int (*field_em_clear_f)( 205 int unit); 206 207 typedef int (*field_ft_clear_f)( 208 int unit); 209 210 typedef int (*field_clear_f)( 211 int unit); 212 213 typedef int (*field_lt_qual_name_update_f)( 214 int unit, 215 bool group_map, 216 bcmint_field_stage_info_t *stage_info, 217 const bcm_field_qset_t *qset, 218 const bcm_field_qual_map_info_t *lt_map_ref, 219 char **lt_field_name); 220 221 typedef int (*field_udf_qual_set_f)( 222 int unit, 223 bcmint_field_stage_info_t *stage_info, 224 bcmi_field_ha_group_oper_t *group_oper, 225 bcmi_field_ha_entry_oper_t *entry_oper, 226 bcm_udf_id_t udf_id, 227 int length, 228 uint8 *data, 229 uint8 *mask); 230 231 typedef int (*field_udf_qual_get_f)( 232 int unit, 233 bcmint_field_stage_info_t *stage_info, 234 bcmi_field_ha_group_oper_t *group_oper, 235 bcmi_field_ha_entry_oper_t *entry_oper, 236 bcm_udf_id_t udf_id, 237 int max_len, 238 uint8 *data, 239 uint8 *mask, 240 int *actual_len); 241 242 typedef int (*field_udf_qset_set_f)( 243 int unit, 244 int num_objects, 245 int objects_list[], 246 bcm_field_qset_t *qset); 247 248 typedef int (*field_udf_obj_get_f) ( 249 int unit, 250 bcm_field_qset_t qset, 251 int max, 252 int *objects_list, 253 int *actual); 254 255 typedef int (*field_group_mode_set_f) ( 256 int unit, 257 bcm_field_group_config_t *group_config, 258 bcmint_field_stage_info_t *stage_info, 259 bcmlt_entry_handle_t grp_template, 260 bool *mode_auto, 261 char **group_mode); 262 263 typedef int (*field_egr_group_qset_validate_f) ( 264 int unit, 265 bcm_field_group_t group_id, 266 bcmint_field_stage_info_t *stage_info, 267 bcm_field_qset_t new_qset, 268 bcm_field_group_mode_type_t *mode_type, 269 bcm_field_group_packet_type_t *packet_type); 270 271 typedef int (*field_group_pipe_get_f) ( 272 int unit, 273 bcmint_field_stage_info_t *stage_info, 274 bcm_pbmp_t pbmp, 275 uint8_t *field_pipe); 276 277 typedef int (*field_group_pbmp_get_f) ( 278 int unit, 279 bcm_field_group_config_t *group_config, 280 bcmint_field_stage_info_t *stage_info, 281 bcm_pbmp_t *pbmp); 282 283 typedef int (*field_pbmp_index_get_f) ( 284 int unit, 285 bcm_field_group_t group, 286 bcmint_field_stage_info_t *stage_info, 287 bcm_pbmp_t *in_pbmp, 288 bcm_pbmp_t *in_pbmp_mask, 289 uint8 *out_pbmp_idx, 290 uint8 *out_pbmp_idx_mask); 291 292 typedef int (*field_pbmp_get_f) ( 293 int unit, 294 bcm_field_group_t group, 295 bcmint_field_stage_info_t *stage_info, 296 uint8 *out_pbmp_idx, 297 uint8 *out_pbmp_idx_mask, 298 bcm_pbmp_t *in_pbmp, 299 bcm_pbmp_t *in_pbmp_mask); 300 301 typedef int (*field_destination_init_f) ( 302 int unit); 303 304 typedef int (*field_destination_deinit_f) ( 305 int unit); 306 307 typedef int (*field_destination_mirror_index_get_f) ( 308 int unit, 309 bcm_field_destination_match_t *match, 310 int *mirror_index); 311 312 typedef int (*field_destination_entry_add_f) ( 313 int unit, 314 uint32 options, 315 bcm_field_destination_match_t *match, 316 bcm_field_destination_action_t *action); 317 318 typedef int (*field_destination_entry_get_f) ( 319 int unit, 320 bcm_field_destination_match_t *match, 321 bcm_field_destination_action_t *action); 322 323 typedef int (*field_destination_entry_traverse_f) ( 324 int unit, 325 bcm_field_destination_entry_traverse_cb callback, 326 void *user_data); 327 328 typedef int (*field_destination_entry_delete_f) ( 329 int unit, 330 bcm_field_destination_match_t *match); 331 332 typedef int (*field_destination_flexctr_attach_f) ( 333 int unit, 334 bcm_field_destination_match_t *match, 335 bcmi_ltsw_flexctr_counter_info_t *info); 336 337 typedef int (*field_destination_flexctr_detach_f) ( 338 int unit, 339 bcm_field_destination_match_t *match); 340 341 typedef int (*field_destination_flexctr_info_get_f) ( 342 int unit, 343 bcm_field_destination_match_t *match, 344 bcmi_ltsw_flexctr_counter_info_t *info); 345 346 typedef int (*field_destination_flexctr_object_set_f) ( 347 int unit, 348 bcm_field_destination_match_t *match, 349 uint32_t value); 350 351 typedef int (*field_destination_flexctr_object_get_f) ( 352 int unit, 353 bcm_field_destination_match_t *match, 354 uint32_t *value); 355 356 typedef int (*field_internal_entry_enable_get_f) ( 357 int unit, 358 bcmint_field_stage_info_t *stage_info, 359 bool *enable); 360 361 typedef int (*field_qual_gport_validate_f)( 362 int unit, 363 bcm_field_entry_t entry, 364 bcm_field_qualify_t qual, 365 bcm_gport_t gport, 366 bcm_port_t *port); 367 368 typedef int (*field_qualify_copytocpureasonhigh_set_f) ( 369 int unit, 370 uint32_t *data, 371 uint32_t *mask); 372 373 typedef int (*field_qualify_copytocpureasonhigh_get_f) ( 374 int unit, 375 uint32_t *data, 376 uint32_t *mask); 377 378 typedef int (*field_qual_info_lt_name_get_f) ( 379 int unit, 380 const char *lt_field_name, 381 char *num_offset_field_name, 382 char *offset_field_name, 383 char *width_field_name); 384 385 typedef int (*field_policer_attach_f)( 386 int unit, 387 bcmint_field_stage_info_t *stage_info, 388 bcmi_field_ha_entry_oper_t *entry_oper, 389 bcm_policer_t policer_id); 390 391 typedef int (*field_policer_detach_f)( 392 int unit, 393 bcm_field_entry_t entry); 394 395 typedef int (*field_qual_mask_lt_field_get_f) ( 396 int unit, 397 char *qual_field, 398 char **qual_mask_field); 399 400 typedef int (*field_action_param_symbol_set_f) ( 401 int unit, 402 bcm_field_action_t action, 403 bcm_field_action_params_t *params, 404 char *param_name); 405 406 typedef int (*field_action_param_symbol_get_f) ( 407 int unit, 408 bcm_field_action_t action, 409 bcm_field_action_params_t *params, 410 char *param_name); 411 412 typedef int (*field_qual_value_set_f) ( 413 int unit, 414 bcm_field_entry_t entry, 415 bcm_qual_field_t *qual_info); 416 417 typedef int (*field_qual_value_get_f) ( 418 int unit, 419 bcm_field_entry_t entry, 420 bcm_qual_field_t *qual_info); 421 422 typedef int (*field_qual_info_set_f) ( 423 int unit, 424 bcm_field_entry_t entry, 425 bcm_qual_field_t *qual_info); 426 427 typedef int (*field_entry_table_id_get_f)( 428 int unit, 429 const char *pt_name, 430 uint32_t *table_id, 431 uint32_t *entry_idx); 432 433 typedef int (*field_aacl_class_id_get_f) ( 434 int unit, 435 bcm_field_qualify_t qid, 436 bcmint_field_stage_info_t *stage_info, 437 bcmi_field_ha_entry_oper_t *entry_oper, 438 int *class_id, 439 bcm_field_qualify_t *pair_qual); 440 441 typedef int (*field_action_stat_group_lt_field_validate_f) ( 442 int unit, 443 bcmint_field_stage_info_t *stage_info, 444 bcm_field_hintid_t hintid, 445 const char *field_name, 446 bool *is_valid); 447 448 typedef int (*field_group_udf_qset_update_with_hints_f)( 449 int unit, 450 bcm_udf_id_t udf_id, 451 bcm_field_hint_t *hint, 452 bcm_field_qset_t *udf_qset, 453 bcmi_field_udf_qset_bitmap_t *udf_qset_bitmap); 454 455 typedef int (*field_action_lt_map_valid_info_get_f)( 456 int unit, 457 bcmi_ltsw_field_stage_t stage, 458 bcm_field_entry_t entry_id, 459 bcm_field_action_t action, 460 uint16_t lt_map_flags, 461 uint16_t map_count, 462 bool *lt_field_map); 463 464 typedef int (*field_action_mirror_set_f)( 465 int unit, 466 bcmint_field_stage_info_t *stage_info, 467 bcm_field_entry_t entry, 468 bcm_field_action_t action, 469 bcm_gport_t mirror_gport); 470 471 typedef int (*field_action_mirror_remove_f)( 472 int unit, 473 bcmint_field_stage_info_t *stage_info, 474 bcm_field_entry_t entry, 475 bcm_field_action_t action, 476 bcm_gport_t mirror_gport); 477 478 typedef int (*field_action_mirror_index_get_f)( 479 int unit, 480 bcmint_field_stage_info_t *stage_info, 481 int entry, 482 bcm_field_action_t action, 483 int mirror_cont, 484 bool *enable, 485 int *mirror_index); 486 487 typedef int (*field_qualify_packetres_set_f) ( 488 int unit, 489 bcm_field_entry_t entry_id, 490 uint32_t data, 491 uint32_t mask); 492 493 typedef int (*field_qualify_packetres_get_f) ( 494 int unit, 495 bcm_field_entry_t entry_id, 496 uint32_t *data, 497 uint32_t *mask); 498 499 typedef int (*field_qualify_mhopcode_set_f) ( 500 int unit, 501 bcm_field_entry_t entry_id, 502 uint8_t data, 503 uint8_t mask); 504 505 typedef int (*field_qualify_mhopcode_get_f) ( 506 int unit, 507 bcm_field_entry_t entry_id, 508 uint8_t *data, 509 uint8_t *mask); 510 511 typedef int (*field_action_default_value_get_f)( 512 int unit, bcm_field_entry_t entry_id, 513 bcmint_field_stage_info_t *stage_info, 514 bcm_field_action_t action, 515 bool del_action, 516 bcmlt_field_def_t *fld_defs_out); 517 518 typedef int (*field_control_lt_info_init_f)( 519 int unit, 520 bcmint_field_control_info_t *control_info); 521 522 typedef int (*field_qualify_port_get_f)( 523 int unit, 524 bcm_field_entry_t entry, 525 bcm_field_qualify_t qual, 526 bcm_module_t *data_modid, 527 bcm_module_t *mask_modid, 528 bcm_port_t *data_port, 529 bcm_port_t *mask_port); 530 531 typedef int (*field_qualify_port_set_f)( 532 int unit, 533 bcm_field_entry_t entry, 534 bcm_field_qualify_t qual, 535 bcm_module_t data_modid, 536 bcm_module_t mask_modid, 537 bcm_port_t data_port, 538 bcm_port_t mask_port); 539 540 typedef int (*field_qualify_dstl3egress_get_f)( 541 int unit, 542 bcm_field_entry_t entry, 543 bcm_if_t *if_id); 544 545 typedef int (*field_qualify_dstl3egress_set_f)( 546 int unit, 547 bcm_field_entry_t entry, 548 bcm_if_t if_id); 549 550 typedef int (*field_group_mode_get_f)( 551 int unit, 552 bcmint_field_stage_info_t *stage_info, 553 bcmi_field_ha_group_oper_t *group_oper, 554 bcm_field_group_mode_t *mode); 555 556 /*! 557 * \brief Field driver structure. 558 */ 559 typedef struct mbcm_ltsw_field_drv_s { 560 561 /*! Initialize Field control information. */ 562 field_control_info_init_f field_control_info_init; 563 564 /*! Initialize Field stage information. */ 565 field_stage_info_init_f field_stage_info_init; 566 567 /*! Initialize Field stage database information. */ 568 field_stage_db_init_f field_stage_db_init; 569 570 /*! Initialize Field profile tables. */ 571 field_ingress_profile_init_f field_ingress_profile_init; 572 573 /*! De-initialize field profile tables. */ 574 field_ingress_profile_deinit_f field_ingress_profile_deinit; 575 576 /*! Get enum value for given enum, used by enum based qualifiers autogenerated by tooling */ 577 field_auto_enum_to_lt_enum_value_get_f field_auto_enum_to_lt_enum_value_get; 578 579 /*! Get enum for given enum value, used by enum based qualifiers autogenerated by tooling */ 580 field_auto_lt_enum_value_to_enum_get_f field_auto_lt_enum_value_to_enum_get; 581 582 /*! Get enum value for given enum, used by enum based qualifiers manually coded */ 583 field_manual_enum_to_lt_enum_value_get_f field_manual_enum_to_lt_enum_value_get; 584 585 /*! Get enum for given enum value, used by enum based qualifiers manually coded */ 586 field_manual_lt_enum_value_to_enum_get_f field_manual_lt_enum_value_to_enum_get; 587 588 /*! Set action value. */ 589 field_action_value_set_f field_action_value_set; 590 591 /*! Get action value. */ 592 field_action_value_get_f field_action_value_get; 593 594 /*! Get Source Class Mode LT Symbol. */ 595 field_src_class_enum_to_lt_symbol_get_f field_src_class_enum_to_lt_symbol_get; 596 597 /*! Get Source Class Mode Enum. */ 598 field_src_class_lt_symbol_to_enum_get_f field_src_class_lt_symbol_to_enum_get; 599 600 /*! Set Encoding of Source class H/W Fields. */ 601 field_src_class_hw_fields_encode_set_f field_src_class_hw_fields_encode_set; 602 603 /*! Get decoded H/W Fields of Source class. */ 604 field_src_class_hw_fields_decode_get_f field_src_class_hw_fields_decode_get; 605 606 /*! Get profile index for provided entry & action. */ 607 field_action_profile_index_get_f field_action_profile_index_get; 608 609 /*! Add action profile. */ 610 field_action_profile_add_f field_action_profile_add; 611 612 /*! Get action profile. */ 613 field_action_profile_get_f field_action_profile_get; 614 615 /*! Delete action profile index. */ 616 field_action_profile_del_f field_action_profile_del; 617 618 /*! Get Mirror container. */ 619 field_action_meter_cont_get_f field_action_meter_cont_get; 620 621 /*! Set field compression. */ 622 field_compression_set_f field_compression_set; 623 624 /*! Del field compression type. */ 625 field_compression_del_f field_compression_del; 626 627 /*! Clear field related LT tables. */ 628 field_port_filter_enable_set_f field_port_filter_enable_set; 629 630 /*! Get supported values for provided macro based qualifier. */ 631 field_qualify_macro_values_get_f field_qualify_macro_values_get; 632 633 /*! Clear field IFP related LT tables. */ 634 field_clear_f field_ifp_clear; 635 636 /*! Clear field VFP related LT tables. */ 637 field_clear_f field_vfp_clear; 638 639 /*! Clear field EFP related LT tables. */ 640 field_clear_f field_efp_clear; 641 642 /*! Clear field EFP related LT tables. */ 643 field_clear_f field_em_clear; 644 645 /*! Clear field FT related LT tables. */ 646 field_clear_f field_ft_clear; 647 648 /*! Clear field related LT tables. */ 649 field_clear_f field_clear; 650 651 /*! Clear field related LT tables. */ 652 field_lt_qual_name_update_f field_lt_qual_name_update; 653 654 /*! Field UDF Qual Set */ 655 field_udf_qual_set_f field_udf_qual_set; 656 657 /*! Field UDF Qual Get */ 658 field_udf_qual_get_f field_udf_qual_get; 659 660 /*! Field UDF Qset Set */ 661 field_udf_qset_set_f field_udf_qset_set; 662 663 /*! Field UDF Objects get */ 664 field_udf_obj_get_f field_udf_obj_get; 665 666 /*! Field UDF Qset Delete */ 667 field_udf_qset_set_f field_udf_qset_del; 668 669 /*! Field Group Mode Set */ 670 field_group_mode_set_f field_group_mode_set; 671 672 /*! Field egress group qset change validate */ 673 field_egr_group_qset_validate_f field_egr_group_qset_validate; 674 675 /* Field Group Pipe Get */ 676 field_group_pipe_get_f field_group_pipe_get; 677 678 /* Field Group PBMP Get */ 679 field_group_pbmp_get_f field_group_pbmp_get; 680 681 /* Field pbmp index Get */ 682 field_pbmp_index_get_f field_pbmp_index_get; 683 684 /* Field pbmp Get */ 685 field_pbmp_get_f field_pbmp_get; 686 687 /* Field destination init */ 688 field_destination_init_f field_destination_init; 689 690 /* Field destination deinit */ 691 field_destination_deinit_f field_destination_deinit; 692 693 /* Field destination mirror index get */ 694 field_destination_mirror_index_get_f field_destination_mirror_index_get; 695 /* Add a field destination entry */ 696 field_destination_entry_add_f field_destination_entry_add; 697 698 /* Get a field destination entry */ 699 field_destination_entry_get_f field_destination_entry_get; 700 701 /* Traverse field destination entrires */ 702 field_destination_entry_traverse_f field_destination_entry_traverse; 703 704 /* Delete a field destination entry */ 705 field_destination_entry_delete_f field_destination_entry_delete; 706 707 /* Attach a flex counter to a field destination entry */ 708 field_destination_flexctr_attach_f field_destination_flexctr_attach; 709 710 /* Detach a flex counter from a field destination entry */ 711 field_destination_flexctr_detach_f field_destination_flexctr_detach; 712 713 /* Get the flex counter info of a field destination entry */ 714 field_destination_flexctr_info_get_f field_destination_flexctr_info_get; 715 716 /* Set the flexctr object value of a field destination entry */ 717 field_destination_flexctr_object_set_f field_destination_flexctr_object_set; 718 719 /* Get the flexctr object value of a field destination entry */ 720 field_destination_flexctr_object_get_f field_destination_flexctr_object_get; 721 722 /* Get the hook for the dummy entry */ 723 field_internal_entry_enable_get_f field_internal_entry_enable_get; 724 725 /* validate the gport given as input to qual. */ 726 field_qual_gport_validate_f field_qual_gport_validate; 727 728 /* set copy to cpu reason */ 729 field_qualify_copytocpureasonhigh_set_f field_qualify_copytocpureasonhigh_set; 730 731 /* get copy to cpu reason */ 732 field_qualify_copytocpureasonhigh_get_f field_qualify_copytocpureasonhigh_get; 733 734 /* Field qualifier info LT field name */ 735 field_qual_info_lt_name_get_f field_qual_info_lt_name_get; 736 737 /* Attach a policer to the field entry. */ 738 field_policer_attach_f field_policer_attach; 739 740 /* Detach the policer from the field entry. */ 741 field_policer_detach_f field_policer_detach; 742 743 /*! Field Qual mask LT Field get*/ 744 field_qual_mask_lt_field_get_f field_qual_mask_lt_field_get; 745 746 /* set action param symbol */ 747 field_action_param_symbol_set_f field_action_param_symbol_set; 748 749 /* get action param symbol */ 750 field_action_param_symbol_get_f field_action_param_symbol_get; 751 752 /* Set Field Qual values */ 753 field_qual_value_set_f field_qual_value_set; 754 755 /* Get Field Qual values */ 756 field_qual_value_get_f field_qual_value_get; 757 758 /* Set Field Qual Info Struct characteristics */ 759 field_qual_info_set_f field_qual_info_set; 760 761 /* Get TABLE_ID from PT_NAME. */ 762 field_entry_table_id_get_f field_entry_table_id_get; 763 764 /* Get aacl class id */ 765 field_aacl_class_id_get_f field_aacl_class_id_get; 766 767 /* Validate statGroup LT field name */ 768 field_action_stat_group_lt_field_validate_f 769 field_action_stat_group_lt_field_validate; 770 771 /*! Field group udf qset update with Hints bitmap. */ 772 field_group_udf_qset_update_with_hints_f 773 field_group_udf_qset_update_with_hints; 774 775 /*! Get LT mapped fields information for the current action parameters. */ 776 field_action_lt_map_valid_info_get_f field_action_lt_map_valid_info_get; 777 778 /*! Field action mirror set */ 779 field_action_mirror_set_f field_action_mirror_set; 780 781 /*! Field action mirror remove */ 782 field_action_mirror_remove_f field_action_mirror_remove; 783 784 /*! Field action mirror index get */ 785 field_action_mirror_index_get_f field_action_mirror_index_get; 786 787 /*! set packet resolution */ 788 field_qualify_packetres_set_f field_qualify_packetres_set; 789 790 /*! get packet resolution */ 791 field_qualify_packetres_get_f field_qualify_packetres_get; 792 793 /*! Get default action value. */ 794 field_action_default_value_get_f field_action_default_value_get; 795 796 /*! Initialize Field control LT information. */ 797 field_control_lt_info_init_f field_control_lt_info_init; 798 799 /*! Get Qualify values of Mod ID and Port */ 800 field_qualify_port_get_f field_qualify_port_get; 801 802 /*! Set Qualify values of Mod ID and Port */ 803 field_qualify_port_set_f field_qualify_port_set; 804 805 /*! Get Qualify values of destination L3 egress object. */ 806 field_qualify_dstl3egress_get_f field_qualify_dstl3egress_get; 807 808 /*! Set Qualify values of destination L3 egress object. */ 809 field_qualify_dstl3egress_set_f field_qualify_dstl3egress_set; 810 811 /*! Get group mode */ 812 field_group_mode_get_f field_group_mode_get; 813 814 /*! set mhopcode */ 815 field_qualify_mhopcode_set_f field_qualify_mhopcode_set; 816 817 /*! get mhopcode */ 818 field_qualify_mhopcode_get_f field_qualify_mhopcode_get; 819 } mbcm_ltsw_field_drv_t; 820 821 /*! 822 * \brief Set the Field driver of the device. 823 * 824 * \param [in] unit Unit Number. 825 * \param [in] drv Field driver to set. 826 * 827 * \retval SHR_E_NONE No errors. 828 * \retval !SHR_E_NONE Failure. 829 */ 830 extern int 831 mbcm_ltsw_field_drv_set( 832 int unit, 833 mbcm_ltsw_field_drv_t *drv); 834 835 /*! 836 * \brief Initialize Field control information. 837 * 838 * \param [in] unit Unit number. 839 * \param [out] control_info Field control database. 840 * 841 * \retval SHR_E_NONE No errors. 842 * \retval !SHR_E_NONE Failure. 843 */ 844 extern int 845 mbcm_ltsw_field_control_info_init( 846 int unit, 847 bcmint_field_control_info_t *control_info); 848 849 /*! 850 * \brief Get control information. 851 * 852 * \param [in] unit Unit number. 853 * \param [out] control_info control information. 854 * 855 * \retval SHR_E_NONE No errors. 856 * \retval !SHR_E_NONE Failure. 857 */ 858 extern int 859 mbcm_ltsw_field_control_info_get( 860 int unit, 861 bcmint_field_control_info_t *control_info); 862 863 /*! 864 * \brief Initialize Field stage information. 865 * 866 * \param [in] unit Unit number. 867 * \param [out] stage_info Field stage database. 868 * 869 * \retval SHR_E_NONE No errors. 870 * \retval !SHR_E_NONE Failure. 871 */ 872 extern int 873 mbcm_ltsw_field_stage_info_init( 874 int unit, 875 bcmint_field_stage_info_t *stage_info); 876 877 extern int 878 mbcm_ltsw_field_stage_db_init( 879 int unit, 880 bcmint_field_stage_info_t *stage_info); 881 882 extern int 883 mbcm_ltsw_field_ingress_profile_init( 884 int unit); 885 886 extern int 887 mbcm_ltsw_field_ingress_profile_deinit( 888 int unit); 889 890 extern int 891 mbcm_ltsw_field_auto_enum_to_lt_enum_value_get( 892 int unit, 893 bcm_field_qualify_t qual, 894 uint32 qual_enum, 895 bcm_qual_field_t *qual_info); 896 897 extern int 898 mbcm_ltsw_field_auto_lt_enum_value_to_enum_get( 899 int unit, 900 bcm_field_qualify_t qual, 901 bcm_qual_field_t *qual_info, 902 uint32 *qual_enum); 903 904 extern int 905 mbcm_ltsw_field_manual_enum_to_lt_enum_value_get( 906 int unit, 907 bcm_field_entry_t entry, 908 bcm_field_qualify_t qual, 909 uint32 qual_enum, 910 bcm_qual_field_t *qual_info); 911 912 extern int 913 mbcm_ltsw_field_manual_lt_enum_value_to_enum_get( 914 int unit, 915 bcm_field_entry_t entry, 916 bcm_field_qualify_t qual, 917 bcm_qual_field_t *qual_info, 918 uint32 *qual_enum); 919 920 /*! 921 * \brief set action value 922 * 923 * \param [in] unit Unit number. 924 * 925 * \retval SHR_E_NONE No errors. 926 * \retval !SHR_E_NONE Failure. 927 */ 928 extern int 929 mbcm_ltsw_field_action_value_set( 930 int unit, bcm_field_entry_t entry_id, 931 bcmi_ltsw_field_stage_t stage, 932 bcm_field_action_t action, 933 bcm_field_action_params_t *params, 934 bcm_field_action_match_config_t *match_config, 935 uint64_t *action_value); 936 937 /*! 938 * \brief Get action value 939 * 940 * \param [in] unit Unit number. 941 * 942 * \retval SHR_E_NONE No errors. 943 * \retval !SHR_E_NONE Failure. 944 */ 945 extern int 946 mbcm_ltsw_field_action_value_get( 947 int unit, bcm_field_entry_t entry_id, 948 bcmi_ltsw_field_stage_t stage, 949 bcm_field_action_t action, 950 bcm_field_action_params_t *params, 951 bcm_field_action_match_config_t *match_config, 952 uint64_t *action_value); 953 954 extern int 955 mbcm_ltsw_field_src_class_enum_to_lt_symbol_get( 956 int unit, 957 bcm_field_src_class_mode_t mode, 958 char **key_fid); 959 960 extern int 961 mbcm_ltsw_field_src_class_lt_symbol_to_enum_get( 962 int unit, 963 char *key_fid, 964 bcm_field_src_class_mode_t *mode); 965 966 extern int 967 mbcm_ltsw_field_src_class_hw_fields_encode_set( 968 int unit, 969 bcm_field_src_class_mode_t mode, 970 bcm_field_src_class_t src_data, 971 bcm_field_src_class_t src_mask, 972 uint32 *hw_data, 973 uint32 *hw_mask); 974 975 extern int 976 mbcm_ltsw_field_src_class_hw_fields_decode_get( 977 int unit, 978 bcm_field_src_class_mode_t mode, 979 uint32 hw_data, 980 uint32 hw_mask, 981 bcm_field_src_class_t *src_data, 982 bcm_field_src_class_t *src_mask); 983 984 /*! 985 * \brief get profile index for provided action and entry. 986 * 987 * \param [in] unit - Unit number. 988 * [in] entry - Entry identifier. 989 * [in] action - Action identifier. 990 * [out] act_prof_idx - Associated action profile index. 991 * 992 * \retval SHR_E_NONE No errors. 993 * \retval !SHR_E_NONE Failure. 994 */ 995 extern int 996 mbcm_ltsw_field_action_profile_index_get( 997 int unit, 998 bcm_field_entry_t entry, 999 bcm_field_action_t action, 1000 uint16_t *act_prof_idx); 1001 1002 /*! 1003 * \brief add profile entry for provided action. 1004 * 1005 * \param [in] unit - Unit number. 1006 * [in] stage_id - Stage Id 1007 * [in] action - Action identifier. 1008 * [in] params - Action parameters. 1009 * [out] match_config - Match config. 1010 * [out] act_prof_idx_val - action value which is index 1011 * created for profile. 1012 * 1013 * \retval SHR_E_NONE No errors. 1014 * \retval !SHR_E_NONE Failure. 1015 */ 1016 extern int 1017 mbcm_ltsw_field_action_profile_add( 1018 int unit, 1019 bcmi_ltsw_field_stage_t stage_id, 1020 bcm_field_action_t action, 1021 bcm_field_action_params_t *params, 1022 bcm_field_action_match_config_t *match_config, 1023 uint64_t *act_prof_idx_val); 1024 1025 /*! 1026 * \brief get profile entry for provided action. 1027 * 1028 * \param [in] unit - Unit number. 1029 * [in] stage_id - Stage Id. 1030 * [in] action - Action identifier. 1031 * [in] act_prof_idx_val - action value which is index 1032 * to be fetched for profile. 1033 * [out] match_config - Match config. 1034 * [out] params - Action parameters. 1035 * 1036 * \retval SHR_E_NONE No errors. 1037 * \retval !SHR_E_NONE Failure. 1038 */ 1039 extern int 1040 mbcm_ltsw_field_action_profile_get( 1041 int unit, 1042 bcmi_ltsw_field_stage_t stage_id, 1043 bcm_field_action_t action, 1044 uint64_t *act_prof_idx_val, 1045 bcm_field_action_params_t *params, 1046 bcm_field_action_match_config_t *match_config); 1047 1048 /*! 1049 * \brief delete profile entry for provided action. 1050 * 1051 * \param [in] unit - Unit number. 1052 * [in] stage_id - Stage Id. 1053 * [in] action - Action identifier. 1054 * [in] act_prof_idx_val - action value which is index 1055 * to be fetched for profile. 1056 * 1057 * \retval SHR_E_NONE No errors. 1058 * \retval !SHR_E_NONE Failure. 1059 */ 1060 extern int 1061 mbcm_ltsw_field_action_profile_del( 1062 int unit, 1063 bcmi_ltsw_field_stage_t stage_id, 1064 bcm_field_action_t action, 1065 uint64_t *act_prof_idx_val); 1066 1067 /*! 1068 * \brief Get FP meter field for a given slice. 1069 * 1070 * \param [in] unit Unit number. 1071 * 1072 * \retval SHR_E_NONE No errors. 1073 * \retval !SHR_E_NONE Failure. 1074 */ 1075 extern int 1076 mbcm_ltsw_fp_meter_cont_field_get( 1077 int unit, 1078 bcmi_ltsw_field_stage_t stage, 1079 int slice_idx, 1080 char **cont_field); 1081 1082 /*! 1083 * \brief Set FP compression. 1084 * 1085 * \param [in] unit Unit number. 1086 * \param [in] stage_info Reference stage info structure. 1087 * \param [in] qset Reference to field qualifier set. 1088 * \param [in] template SDKLT group/rule template. 1089 * 1090 * \retval SHR_E_NONE No errors. 1091 * \retval !SHR_E_NONE Failure. 1092 */ 1093 extern int 1094 mbcm_ltsw_field_compression_set( 1095 int unit, 1096 bcmint_field_stage_info_t *stage_info, 1097 bcmi_field_ha_entry_oper_t *entry_oper, 1098 bcm_field_qset_t *qset, 1099 uint32_t group_flags, 1100 bcmlt_entry_handle_t templ); 1101 1102 /*! 1103 * \brief Set FP compression. 1104 * 1105 * \param [in] unit Unit number. 1106 * \param [in] stage_info Reference stage info structure. 1107 * \param [in] qset Reference to field qualifier set. 1108 * \param [in] template SDKLT group/rule template. 1109 * 1110 * \retval SHR_E_NONE No errors. 1111 * \retval !SHR_E_NONE Failure. 1112 */ 1113 extern int 1114 mbcm_ltsw_field_compression_del( 1115 int unit, 1116 bcmint_field_stage_info_t *stage_info, 1117 bcm_field_qset_t *qset, 1118 bcmlt_entry_handle_t templ); 1119 1120 /*! 1121 * \brief Set the filter enable state in the Port Tables. 1122 * 1123 * \param [in] unit Unit Number. 1124 * \param [in] state TRUE = to enable 1125 * FALSE = to disbale filtering 1126 * 1127 * \retval SHR_E_NONE No errors. 1128 * \retval !SHR_E_NONE Failure. 1129 */ 1130 extern int 1131 mbcm_ltsw_field_port_filter_enable_set( 1132 int unit, 1133 uint32 state, 1134 bcm_pbmp_t port_pbmp); 1135 1136 /*! 1137 * \brief get macro flags, value and other data supported for input 1138 * macro based qualifier. 1139 * 1140 * \param [in] unit Unit number. 1141 * \param [in] set_flag Set_flag(1 for qualify_set and 0 for qualify_get) 1142 * \param [in] qual_info Qualifier info. 1143 * \param [out] qual_info_values Qualifier values supported. 1144 * 1145 * \retval SHR_E_NONE No errors. 1146 * \retval !SHR_E_NONE Failure. 1147 */ 1148 extern int 1149 mbcm_ltsw_field_qualify_macro_values_get( 1150 int unit, 1151 uint8 set_flag, 1152 bcm_qual_field_t *qual_info, 1153 bcm_qual_field_values_t *qual_info_values); 1154 1155 /*! 1156 * \brief Clear field related LT tables. 1157 * 1158 * \param [in] unit Unit Number. 1159 * 1160 * \retval SHR_E_NONE No errors. 1161 * \retval !SHR_E_NONE Failure. 1162 */ 1163 extern int 1164 mbcm_ltsw_field_clear( 1165 int unit); 1166 1167 /*! 1168 * \Get Field Qualifier name for Group Template 1169 * 1170 * \param [in] unit Unit number. 1171 * 1172 * \retval SHR_E_NONE No errors. 1173 * \retval !SHR_E_NONE Failure. 1174 */ 1175 extern int 1176 mbcm_ltsw_field_lt_qual_name_update( 1177 int unit, 1178 bool group_map, 1179 bcmint_field_stage_info_t *stage_info, 1180 const bcm_field_qset_t *qset, 1181 const bcm_field_qual_map_info_t *lt_map_ref, 1182 char **lt_field_name); 1183 1184 extern int 1185 mbcm_ltsw_field_udf_qual_set( 1186 int unit, 1187 bcmint_field_stage_info_t *stage_info, 1188 bcmi_field_ha_group_oper_t *group_oper, 1189 bcmi_field_ha_entry_oper_t *entry_oper, 1190 bcm_udf_id_t udf_id, 1191 int length, 1192 uint8 *data, 1193 uint8 *mask); 1194 1195 extern int 1196 mbcm_ltsw_field_udf_qual_get( 1197 int unit, 1198 bcmint_field_stage_info_t *stage_info, 1199 bcmi_field_ha_group_oper_t *group_oper, 1200 bcmi_field_ha_entry_oper_t *entry_oper, 1201 bcm_udf_id_t udf_id, 1202 int max_len, 1203 uint8 *data, 1204 uint8 *mask, 1205 int *actual_len); 1206 1207 extern int 1208 mbcm_ltsw_field_udf_qset_set( 1209 int unit, 1210 int num_objects, 1211 int objects_list[], 1212 bcm_field_qset_t *qset); 1213 1214 extern int 1215 mbcm_ltsw_field_udf_obj_get( 1216 int unit, 1217 bcm_field_qset_t qset, 1218 int max, 1219 int *objects_list, 1220 int *actual); 1221 1222 extern int 1223 mbcm_ltsw_field_udf_qset_del( 1224 int unit, 1225 int num_objects, 1226 int objects_list[], 1227 bcm_field_qset_t *qset); 1228 1229 extern int 1230 mbcm_ltsw_field_group_mode_set( 1231 int unit, 1232 bcm_field_group_config_t *group_config, 1233 bcmint_field_stage_info_t *stage_info, 1234 bcmlt_entry_handle_t grp_template, 1235 bool *mode_auto, 1236 char **group_mode); 1237 1238 extern int 1239 mbcm_ltsw_field_egr_group_qset_validate( 1240 int unit, 1241 bcm_field_group_t group_id, 1242 bcmint_field_stage_info_t *stage_info, 1243 bcm_field_qset_t new_qset, 1244 bcm_field_group_mode_type_t *mode_type, 1245 bcm_field_group_packet_type_t *packet_type); 1246 1247 extern int 1248 mbcm_ltsw_field_group_pipe_get( 1249 int unit, 1250 bcmint_field_stage_info_t *stage_info, 1251 bcm_pbmp_t pbmp, 1252 uint8_t *field_pipe); 1253 1254 extern int 1255 mbcm_ltsw_field_group_pbmp_get( 1256 int unit, 1257 bcm_field_group_config_t *group_config, 1258 bcmint_field_stage_info_t *stage_info, 1259 bcm_pbmp_t *pbmp); 1260 1261 extern int 1262 mbcm_ltsw_field_pbmp_index_get( 1263 int unit, 1264 bcm_field_group_t group, 1265 bcmint_field_stage_info_t *stage_info, 1266 bcm_pbmp_t *in_pbmp, 1267 bcm_pbmp_t *in_pbmp_mask, 1268 uint8 *out_pbmp_idx, 1269 uint8 *out_pbmp_idx_mask); 1270 1271 extern int 1272 mbcm_ltsw_field_pbmp_get( 1273 int unit, 1274 bcm_field_group_t group, 1275 bcmint_field_stage_info_t *stage_info, 1276 uint8 *out_pbmp_idx, 1277 uint8 *out_pbmp_idx_mask, 1278 bcm_pbmp_t *in_pbmp, 1279 bcm_pbmp_t *in_pbmp_mask); 1280 1281 1282 /*! 1283 * \brief Mbcm field destination init. 1284 * 1285 * \param [in] unit Unit number. 1286 * 1287 * \retval SHR_E_NONE No errors. 1288 * \retval !SHR_E_NONE Failure. 1289 */ 1290 extern int 1291 mbcm_ltsw_field_destination_init( 1292 int unit); 1293 1294 /*! 1295 * \brief Mbcm field destination deinit. 1296 * 1297 * \param [in] unit Unit number. 1298 * 1299 * \retval SHR_E_NONE No errors. 1300 * \retval !SHR_E_NONE Failure. 1301 */ 1302 extern int 1303 mbcm_ltsw_field_destination_deinit( 1304 int unit); 1305 1306 /*! 1307 * \brief Get the mirror index used by the Field destination entry. 1308 * 1309 * \param [in] unit Unit number. 1310 * \param [in] match Match info. 1311 * \param [out] mirror_index Mirror index. 1312 * 1313 * \retval SHR_E_NONE No errors. 1314 * \retval !SHR_E_NONE Failure. 1315 */ 1316 extern int 1317 mbcm_ltsw_field_destination_mirror_index_get( 1318 int unit, 1319 bcm_field_destination_match_t *match, 1320 int *mirror_index); 1321 1322 /*! 1323 * \brief Add a field destination entry. 1324 * 1325 * \param [in] unit Unit number. 1326 * \param [in] options Entry operation options. 1327 * \param [in] match Match info. 1328 * \param [in] action Action info. 1329 * 1330 * \retval SHR_E_NONE No errors. 1331 * \retval !SHR_E_NONE Failure. 1332 */ 1333 extern int 1334 mbcm_ltsw_field_destination_entry_add( 1335 int unit, 1336 uint32 options, 1337 bcm_field_destination_match_t *match, 1338 bcm_field_destination_action_t *action); 1339 1340 /*! 1341 * \brief Get a field destination entry. 1342 * 1343 * \param [in] unit Unit number. 1344 * \param [in/out] match Match info. 1345 * \param [out] action Action info. 1346 * 1347 * \retval SHR_E_NONE No errors. 1348 * \retval !SHR_E_NONE Failure. 1349 */ 1350 extern int 1351 mbcm_ltsw_field_destination_entry_get( 1352 int unit, 1353 bcm_field_destination_match_t *match, 1354 bcm_field_destination_action_t *action); 1355 1356 /*! 1357 * \brief Traverse field destination entries. 1358 * 1359 * \param [in] unit Unit number. 1360 * \param [in] callback User callback. 1361 * \param [in] user_data User cookie. 1362 * 1363 * \retval SHR_E_NONE No errors. 1364 * \retval !SHR_E_NONE Failure. 1365 */ 1366 extern int 1367 mbcm_ltsw_field_destination_entry_traverse( 1368 int unit, 1369 bcm_field_destination_entry_traverse_cb callback, 1370 void *user_data); 1371 1372 /*! 1373 * \brief Delete a field destination entry. 1374 * 1375 * \param [in] unit Unit number. 1376 * \param [in] match Match info. 1377 * 1378 * \retval SHR_E_NONE No errors. 1379 * \retval !SHR_E_NONE Failure. 1380 */ 1381 extern int 1382 mbcm_ltsw_field_destination_entry_delete( 1383 int unit, 1384 bcm_field_destination_match_t *match); 1385 1386 /*! 1387 * \brief Attach a flex counter to the given field destination entry. 1388 * 1389 * \param [in] unit Unit number. 1390 * \param [in] match Match info. 1391 * \param [in] info Counter information. 1392 * 1393 * \retval SHR_E_NONE No errors. 1394 * \retval !SHR_E_NONE Failure. 1395 */ 1396 extern int 1397 mbcm_ltsw_field_destination_flexctr_attach( 1398 int unit, 1399 bcm_field_destination_match_t *match, 1400 bcmi_ltsw_flexctr_counter_info_t *info); 1401 1402 /*! 1403 * \brief Detach a flex counter from the given field destination entry. 1404 * 1405 * \param [in] unit Unit number. 1406 * \param [in] match Match info. 1407 * 1408 * \retval SHR_E_NONE No errors. 1409 * \retval !SHR_E_NONE Failure. 1410 */ 1411 extern int 1412 mbcm_ltsw_field_destination_flexctr_detach( 1413 int unit, 1414 bcm_field_destination_match_t *match); 1415 1416 /*! 1417 * \brief Get the info of a flex counter attached to 1418 * the given field destination entry. 1419 * 1420 * \param [in] unit Unit number. 1421 * \param [in] match Match info. 1422 * \param [out] info Counter information. 1423 * 1424 * \retval SHR_E_NONE No errors. 1425 * \retval !SHR_E_NONE Failure. 1426 */ 1427 extern int 1428 mbcm_ltsw_field_destination_flexctr_info_get( 1429 int unit, 1430 bcm_field_destination_match_t *match, 1431 bcmi_ltsw_flexctr_counter_info_t *info); 1432 1433 /*! 1434 * \brief Set the flexctr object for the given field destination entry. 1435 * 1436 * \param [in] unit Unit number. 1437 * \param [in] match Match info. 1438 * \param [in] value Flexctr object value. 1439 * 1440 * \retval SHR_E_NONE No errors. 1441 * \retval !SHR_E_NONE Failure. 1442 */ 1443 extern int 1444 mbcm_ltsw_field_destination_flexctr_object_set( 1445 int unit, 1446 bcm_field_destination_match_t *match, 1447 uint32_t value); 1448 1449 /*! 1450 * \brief Get the flexctr object of the given field destination entry. 1451 * 1452 * \param [in] unit Unit number. 1453 * \param [in] match Match info. 1454 * \param [out] value Flexctr object value. 1455 * 1456 * \retval SHR_E_NONE No errors. 1457 * \retval !SHR_E_NONE Failure. 1458 */ 1459 extern int 1460 mbcm_ltsw_field_destination_flexctr_object_get( 1461 int unit, 1462 bcm_field_destination_match_t *match, 1463 uint32_t *value); 1464 1465 extern int 1466 mbcm_ltsw_field_internal_entry_enable_get( 1467 int unit, 1468 bcmint_field_stage_info_t *stage_info, 1469 bool *enable); 1470 1471 extern int 1472 mbcm_ltsw_field_qual_gport_validate( 1473 int unit, 1474 bcm_field_entry_t entry, 1475 bcm_field_qualify_t qual, 1476 bcm_gport_t gport, 1477 bcm_port_t *port); 1478 1479 /*! 1480 * \brief Set copy to cpu reason high. 1481 * 1482 * \param [in] unit Unit number. 1483 * \param [in/out] data 1484 * \param [in/out] mask 1485 * 1486 * \retval SHR_E_NONE No errors. 1487 * \retval !SHR_E_NONE Failure. 1488 */ 1489 extern int 1490 mbcm_ltsw_field_qualify_copytocpureasonhigh_set( 1491 int unit, 1492 uint32_t *data, 1493 uint32_t *mask); 1494 /*! 1495 * \brief get copy to cpu reason high. 1496 * 1497 * \param [in] unit Unit number. 1498 * \param [in/out] data 1499 * \param [in/out] mask 1500 * 1501 * \retval SHR_E_NONE No errors. 1502 * \retval !SHR_E_NONE Failure. 1503 */ 1504 extern int 1505 mbcm_ltsw_field_qualify_copytocpureasonhigh_get( 1506 int unit, 1507 uint32_t *data, 1508 uint32_t *mask); 1509 1510 /*! 1511 * \brief Get qualifier info LT field names. 1512 * 1513 * \param [in] unit Unit number. 1514 * \param [in] lt_field_name LT field name 1515 * \param [out] num_offset_field_name Num offset field name. 1516 * \param [out] offset_field_name Offset field name. 1517 * \param [out] width_field_name Width field name. 1518 * 1519 * \retval SHR_E_NONE No errors. 1520 * \retval !SHR_E_NONE Failure. 1521 */ 1522 1523 extern int 1524 mbcm_ltsw_field_qual_info_lt_name_get( 1525 int unit, 1526 const char *lt_field_name, 1527 char *num_offset_field_name, 1528 char *offset_field_name, 1529 char *width_field_name); 1530 1531 extern int 1532 mbcm_ltsw_field_entry_policer_attach( 1533 int unit, 1534 bcmint_field_stage_info_t *stage_info, 1535 bcmi_field_ha_entry_oper_t *entry_oper, 1536 bcm_policer_t policer_id); 1537 1538 extern int 1539 mbcm_ltsw_field_entry_policer_detach( 1540 int unit, 1541 bcm_field_entry_t entry); 1542 1543 extern int 1544 mbcm_ltsw_field_qual_mask_lt_field_get( 1545 int unit, 1546 char *qual_field, 1547 char **qual_mask_field); 1548 1549 extern int 1550 mbcm_ltsw_field_action_param_symbol_set( 1551 int unit, 1552 bcm_field_action_t action, 1553 bcm_field_action_params_t *params, 1554 char *param_name); 1555 extern int 1556 mbcm_ltsw_field_action_param_symbol_get( 1557 int unit, 1558 bcm_field_action_t action, 1559 bcm_field_action_params_t *params, 1560 char *param_name); 1561 1562 extern int 1563 mbcm_ltsw_field_qual_value_set( 1564 int unit, 1565 bcm_field_entry_t entry, 1566 bcm_qual_field_t *qual_info); 1567 1568 extern int 1569 mbcm_ltsw_field_qual_value_get( 1570 int unit, 1571 bcm_field_entry_t entry, 1572 bcm_qual_field_t *qual_info); 1573 1574 extern int 1575 mbcm_ltsw_field_qual_info_set ( 1576 int unit, 1577 bcm_field_entry_t entry, 1578 bcm_qual_field_t *qual_info); 1579 1580 extern int 1581 mbcm_ltsw_field_entry_table_id_get( 1582 int unit, 1583 const char *pt_name, 1584 uint32_t *table_id, 1585 uint32_t *entry_idx); 1586 1587 extern int 1588 mbcm_ltsw_field_aacl_class_id_get( 1589 int unit, 1590 bcm_field_qualify_t qid, 1591 bcmint_field_stage_info_t *stage_info, 1592 bcmi_field_ha_entry_oper_t *entry_oper, 1593 int *class_id, 1594 bcm_field_qualify_t *pair_qual); 1595 1596 extern int 1597 mbcm_ltsw_field_action_stat_group_lt_field_validate( 1598 int unit, 1599 bcmint_field_stage_info_t *stage_info, 1600 bcm_field_hintid_t hintid, 1601 const char *field_name, 1602 bool *is_valid); 1603 1604 extern int 1605 mbcm_ltsw_field_group_udf_qset_update_with_hints( 1606 int unit, 1607 bcm_udf_id_t udf_id, 1608 bcm_field_hint_t *hint, 1609 bcm_field_qset_t *udf_qset, 1610 bcmi_field_udf_qset_bitmap_t *udf_qset_bitmap); 1611 1612 extern int 1613 mbcm_ltsw_field_action_mirror_set( 1614 int unit, 1615 bcmint_field_stage_info_t *stage_info, 1616 bcm_field_entry_t entry, 1617 bcm_field_action_t action, 1618 bcm_gport_t mirror_gport); 1619 extern int 1620 mbcm_ltsw_field_action_mirror_remove( 1621 int unit, 1622 bcmint_field_stage_info_t *stage_info, 1623 bcm_field_entry_t entry, 1624 bcm_field_action_t action, 1625 bcm_gport_t mirror_gport); 1626 extern int 1627 mbcm_ltsw_field_action_mirror_index_get( 1628 int unit, 1629 bcmint_field_stage_info_t *stage_info, 1630 int entry, 1631 bcm_field_action_t action, 1632 int mirror_cont, 1633 bool *enable, 1634 int *mirror_index); 1635 1636 extern int 1637 mbcm_ltsw_field_action_lt_map_valid_info_get( 1638 int unit, 1639 bcmi_ltsw_field_stage_t stage, 1640 bcm_field_entry_t entry_id, 1641 bcm_field_action_t action, 1642 uint16_t lt_map_flags, 1643 uint16_t map_count, 1644 bool *lt_field_map); 1645 1646 extern int 1647 mbcm_ltsw_field_qualify_packetres_set( 1648 int unit, 1649 bcm_field_entry_t entry_id, 1650 uint32_t data, 1651 uint32_t mask); 1652 1653 extern int 1654 mbcm_ltsw_field_qualify_packetres_get( 1655 int unit, 1656 bcm_field_entry_t entry_id, 1657 uint32_t *data, 1658 uint32_t *mask); 1659 1660 extern int 1661 mbcm_ltsw_field_qualify_mhopcode_set( 1662 int unit, 1663 bcm_field_entry_t entry_id, 1664 uint8_t data, 1665 uint8_t mask); 1666 1667 extern int 1668 mbcm_ltsw_field_qualify_mhopcode_get( 1669 int unit, 1670 bcm_field_entry_t entry_id, 1671 uint8_t *data, 1672 uint8_t *mask); 1673 1674 1675 extern int 1676 mbcm_ltsw_field_action_default_value_get( 1677 int unit, bcm_field_entry_t entry_id, 1678 bcmint_field_stage_info_t *stage_info, 1679 bcm_field_action_t action, 1680 bool del_action, 1681 bcmlt_field_def_t *fld_defs_out); 1682 1683 extern int 1684 mbcm_ltsw_field_control_lt_info_init( 1685 int unit, 1686 bcmint_field_control_info_t *ctrl_info); 1687 1688 extern int 1689 mbcm_ltsw_field_qualify_port_get( 1690 int unit, 1691 bcm_field_entry_t entry, 1692 bcm_field_qualify_t qual, 1693 bcm_module_t *data_modid, 1694 bcm_module_t *mask_modid, 1695 bcm_port_t *data_port, 1696 bcm_port_t *mask_port); 1697 1698 extern int 1699 mbcm_ltsw_field_qualify_port_set( 1700 int unit, 1701 bcm_field_entry_t entry, 1702 bcm_field_qualify_t qual, 1703 bcm_module_t data_modid, 1704 bcm_module_t mask_modid, 1705 bcm_port_t data_port, 1706 bcm_port_t mask_port); 1707 1708 extern int 1709 mbcm_ltsw_field_qualify_dstl3egress_get( 1710 int unit, 1711 bcm_field_entry_t entry, 1712 bcm_if_t *if_id); 1713 1714 extern int 1715 mbcm_ltsw_field_qualify_dstl3egress_set( 1716 int unit, 1717 bcm_field_entry_t entry, 1718 bcm_if_t if_id); 1719 1720 extern int 1721 mbcm_ltsw_field_group_mode_get( 1722 int unit, 1723 bcmint_field_stage_info_t *stage_info, 1724 bcmi_field_ha_group_oper_t *group_oper, 1725 bcm_field_group_mode_t *mode); 1726 1727 #endif /* BCMINT_LTSW_MBCM_FIELD_H */