l3_egress.h (42359B)
1 /*! \file l3_egress.h 2 * 3 * BCM L3 egress module APIs and data 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 BCMI_LTSW_MBCM_L3_EGRESS_H 12 #define BCMI_LTSW_MBCM_L3_EGRESS_H 13 14 #include <bcm/l3.h> 15 #include <bcm_int/ltsw/flexctr.h> 16 #include <bcm_int/ltsw/l3_egress.h> 17 #include <bcm_int/ltsw/l3_egress_int.h> 18 19 typedef int (*l3_egress_init_f)(int unit); 20 21 typedef int (*l3_egress_l2_rsv_f)(int unit); 22 23 typedef int (*l3_egress_deinit_f)(int unit); 24 25 typedef int (*l3_egress_id_range_get_f)( 26 int unit, 27 int type, 28 int *min, 29 int *max); 30 31 typedef int (*l3_egress_create_f)( 32 int unit, 33 bcm_l3_egress_t *egr, 34 int *idx); 35 36 typedef int (*l3_egress_destroy_f)( 37 int unit, 38 int idx); 39 40 typedef int (*l3_egress_get_f)( 41 int unit, 42 int idx, 43 bcm_l3_egress_t *egr); 44 45 typedef int (*l3_egress_find_f)( 46 int unit, 47 bcm_l3_egress_t *egr, 48 int *idx); 49 50 typedef int (*l3_egress_traverse_f)( 51 int unit, 52 bcm_l3_egress_traverse_cb trav_fn, 53 void *user_data); 54 55 typedef int (*l3_egress_obj_id_resolve_f)( 56 int unit, 57 bcm_if_t intf, 58 int *nhidx, 59 bcmi_ltsw_l3_egr_obj_type_t *type); 60 61 typedef int (*l3_egress_obj_id_construct_f)( 62 int unit, 63 int nhidx, 64 bcmi_ltsw_l3_egr_obj_type_t type, 65 bcm_if_t *intf); 66 67 typedef int (*l3_egress_obj_info_get_f)( 68 int unit, 69 bcm_if_t intf, 70 bcmi_ltsw_l3_egr_obj_info_t *info); 71 72 typedef int (*l3_egress_obj_cnt_get_f)( 73 int unit, 74 bcmi_ltsw_l3_egr_obj_type_t type, 75 int *max, 76 int *used); 77 78 typedef int (*l3_egress_dvp_set_f)( 79 int unit, 80 bcm_if_t intf, 81 int dvp); 82 83 typedef int (*l3_egress_flexctr_attach_f)( 84 int unit, 85 bcm_if_t intf_id, 86 bcmi_ltsw_flexctr_counter_info_t *info); 87 88 typedef int (*l3_egress_flexctr_detach_f)( 89 int unit, 90 bcm_if_t intf_id); 91 92 typedef int (*l3_egress_flexctr_info_get_f)( 93 int unit, 94 bcm_if_t intf_id, 95 bcmi_ltsw_flexctr_counter_info_t *info); 96 97 typedef int (*l3_egress_flexctr_object_set_f)( 98 int unit, 99 bcm_if_t intf_id, 100 uint32_t value); 101 102 typedef int (*l3_egress_flexctr_object_get_f)( 103 int unit, 104 bcm_if_t intf_id, 105 uint32_t *value); 106 107 typedef int (*l3_egress_ifa_create_f)( 108 int unit, 109 bcmi_ltsw_l3_egr_ifa_t *egr_ifa, 110 int *idx); 111 112 typedef int (*l3_egress_ifa_destroy_f)( 113 int unit, 114 int idx); 115 116 typedef int (*l3_egress_ifa_get_f)( 117 int unit, 118 int idx, 119 bcmi_ltsw_l3_egr_ifa_t *egr_ifa); 120 121 typedef int (*l3_egress_ifa_traverse_f)( 122 int unit, 123 bcm_ifa_header_traverse_cb trav_fn, 124 bcmi_ltsw_l3_egr_to_ifa_header_cb cb, 125 void *user_data); 126 127 typedef int (*l3_ecmp_create_f)( 128 int unit, 129 bcm_l3_egress_ecmp_t *ecmp_info, 130 int ecmp_member_count, 131 bcm_l3_ecmp_member_t *ecmp_member_array); 132 133 typedef int (*l3_ecmp_destroy_f)( 134 int unit, 135 bcm_if_t ecmp_group_id); 136 137 typedef int (*l3_ecmp_get_f)( 138 int unit, 139 bcm_l3_egress_ecmp_t *ecmp_info, 140 int ecmp_member_size, 141 bcm_l3_ecmp_member_t *ecmp_member_array, 142 int *ecmp_member_count); 143 144 typedef int (*l3_ecmp_member_add_f)( 145 int unit, 146 bcm_if_t ecmp_group_id, 147 bcm_l3_ecmp_member_t *ecmp_member); 148 149 typedef int (*l3_ecmp_member_del_f)( 150 int unit, 151 bcm_if_t ecmp_group_id, 152 bcm_l3_ecmp_member_t *ecmp_member); 153 154 typedef int (*l3_ecmp_member_del_all_f)( 155 int unit, 156 bcm_if_t ecmp_group_id); 157 158 typedef int (*l3_ecmp_find_f)( 159 int unit, 160 int ecmp_member_count, 161 bcm_l3_ecmp_member_t *ecmp_member_array, 162 bcm_l3_egress_ecmp_t *ecmp_info); 163 164 typedef int (*l3_ecmp_trav_f)( 165 int unit, 166 bcm_l3_ecmp_traverse_cb trav_fn, 167 void *user_data); 168 169 typedef int (*l3_ecmp_max_paths_get_f)( 170 int unit, 171 uint32_t attr, 172 int *max_paths); 173 174 typedef int (*l3_ecmp_hash_ctrl_set_f)( 175 int unit, 176 int underlay, 177 int flow_based); 178 179 typedef int (*l3_ecmp_hash_ctrl_get_f)( 180 int unit, 181 int underlay, 182 int *flow_based); 183 184 typedef int (*l3_ecmp_flow_hash_set_f)( 185 int unit, 186 bcmi_ltsw_l3_ecmp_hash_cfg_type_t type, 187 int arg); 188 189 typedef int (*l3_ecmp_flow_hash_get_f)( 190 int unit, 191 bcmi_ltsw_l3_ecmp_hash_cfg_type_t type, 192 int *arg); 193 194 typedef int (*l3_ecmp_port_hash_set_f)( 195 int unit, 196 int port, 197 bcmi_ltsw_l3_ecmp_hash_cfg_type_t type, 198 int arg); 199 200 typedef int (*l3_ecmp_port_hash_get_f)( 201 int unit, 202 int port, 203 bcmi_ltsw_l3_ecmp_hash_cfg_type_t type, 204 int *arg); 205 206 typedef int (*l3_ecmp_member_status_set_f)( 207 int unit, 208 bcm_if_t intf, 209 int status); 210 211 typedef int (*l3_ecmp_member_status_get_f)( 212 int unit, 213 bcm_if_t intf, 214 int *status); 215 216 typedef int (*l3_ecmp_ethertype_set_f)( 217 int unit, 218 uint32_t flags, 219 int ethertype_count, 220 int *ethertype_array); 221 222 typedef int (*l3_ecmp_ethertype_get_f)( 223 int unit, 224 int ethertype_max, 225 uint32_t *flags, 226 int *ethertype_array, 227 int *ethertype_count); 228 229 typedef int (*l3_ecmp_dlb_mon_config_set_f)( 230 int unit, 231 bcm_if_t ecmp_group_id, 232 bcm_l3_ecmp_dlb_mon_cfg_t *dlb_mon_cfg); 233 234 typedef int (*l3_ecmp_dlb_mon_config_get_f)( 235 int unit, 236 bcm_if_t ecmp_group_id, 237 bcm_l3_ecmp_dlb_mon_cfg_t *dlb_mon_cfg); 238 239 typedef int (*ecmp_member_dest_alloc_f)( 240 int unit, 241 bcmi_ltsw_ecmp_member_dest_info_t *dest_info, 242 int *dest_index); 243 244 typedef int (*ecmp_member_dest_get_f)( 245 int unit, 246 int dest_index, 247 bcmi_ltsw_ecmp_member_dest_info_t *dest_info); 248 249 typedef int (*ecmp_member_dest_free_f)( 250 int unit, 251 int dest_index); 252 253 typedef int (*ecmp_member_dest_update_f)( 254 int unit, 255 bcmi_ltsw_ecmp_member_dest_info_t *dest_info); 256 257 typedef int (*l3_egress_size_get_f)( 258 int unit, 259 int *size); 260 261 typedef int (*l3_egress_count_get_f)( 262 int unit, 263 int *count); 264 265 typedef int (*l3_ecmp_size_get_f)( 266 int unit, 267 int *size); 268 269 typedef int (*l3_ecmp_count_get_f)( 270 int unit, 271 int *count); 272 273 typedef int (*l3_ecmp_flexctr_attach_f)( 274 int unit, 275 bcm_if_t intf_id, 276 bcmi_ltsw_flexctr_counter_info_t *info); 277 278 typedef int (*l3_ecmp_flexctr_detach_f)( 279 int unit, 280 bcm_if_t intf_id); 281 282 typedef int (*l3_ecmp_flexctr_info_get_f)( 283 int unit, 284 bcm_if_t intf_id, 285 bcmi_ltsw_flexctr_counter_info_t *info); 286 287 typedef int (*l3_ecmp_flexctr_object_set_f)( 288 int unit, 289 bcm_if_t intf_id, 290 uint32_t value); 291 292 typedef int (*l3_ecmp_flexctr_object_get_f)( 293 int unit, 294 bcm_if_t intf_id, 295 uint32_t *value); 296 297 typedef int (*l3_egress_tbl_db_get_f)( 298 int unit, 299 bcmint_ltsw_l3_egress_tbl_db_t *tbl_db); 300 301 typedef int (*l3_ecmp_tbl_db_get_f)( 302 int unit, 303 bcmint_ltsw_l3_egress_tbl_db_t *tbl_db); 304 305 typedef int (*l3_ecmp_flexctr_action_tbl_db_get_f)( 306 int unit, 307 bcmint_ltsw_l3_egress_tbl_db_t *tbl_db); 308 309 typedef int (*l3_overlay_table_init_f)( 310 int unit, 311 bcmint_ltsw_l3_ol_tbl_info_t *info); 312 313 typedef int (*l3_ecmp_dlb_stat_set_f)( 314 int unit, 315 bcm_if_t ecmp_intf, 316 bcm_l3_ecmp_dlb_stat_t type, 317 uint64_t value); 318 319 typedef int (*l3_ecmp_dlb_stat_get_f)( 320 int unit, 321 bcm_if_t ecmp_intf, 322 bcm_l3_ecmp_dlb_stat_t type, 323 uint64_t *value); 324 325 typedef int (*l3_ecmp_dlb_stat_sync_get_f)( 326 int unit, 327 bcm_if_t ecmp_intf, 328 bcm_l3_ecmp_dlb_stat_t type, 329 uint64_t *value); 330 331 typedef int (*l3_egress_add_l2tag_f)( 332 int unit, 333 int nhidx, 334 bcmi_ltsw_l3_egr_l2_tag_info_t *l2_tag_info); 335 336 typedef int (*l3_egress_get_l2tag_f)( 337 int unit, 338 int nhidx, 339 bcmi_ltsw_l3_egr_l2_tag_info_t *l2_tag_info); 340 341 typedef int (*l3_egress_delete_l2tag_f)( 342 int unit, 343 int nhidx); 344 345 typedef int (*l3_egress_php_action_add_f)( 346 int unit, 347 bcm_if_t intf); 348 349 typedef int (*l3_egress_php_action_del_f)( 350 int unit, 351 bcm_if_t intf); 352 353 typedef int (*l3_secmp_clear_f)( 354 int unit); 355 356 typedef int (*l3_secmp_set_f)( 357 int unit, 358 int idx, 359 bcm_l3_egress_ecmp_t *ecmp_info, 360 bcmi_ltsw_l3_ecmp_member_info_t *member, 361 int count); 362 363 typedef int (*l3_secmp_del_f)( 364 int unit, 365 int idx); 366 367 typedef int (*l3_secmp_member_add_f)( 368 int unit, 369 int idx, 370 bcmi_ltsw_l3_ecmp_member_info_t *member); 371 372 typedef int (*l3_secmp_member_del_f)( 373 int unit, 374 int idx, 375 bcmi_ltsw_l3_ecmp_member_info_t *member, 376 int count, 377 bcmi_ltsw_l3_ecmp_member_info_t *del_member); 378 379 typedef int (*l3_secmp_member_del_all_f)( 380 int unit, 381 int idx); 382 383 typedef int (*l3_egress_trunk_member_del_f)( 384 int unit, 385 bcm_trunk_t trunk_id, 386 int member_cnt, 387 bcm_port_t *member_arr); 388 389 typedef int (*l3_egress_trunk_member_add_f)( 390 int unit, 391 bcm_trunk_t trunk_id, 392 int member_cnt, 393 bcm_port_t *member_arr); 394 395 /* L3 Egress function vector driver. */ 396 typedef struct mbcm_ltsw_l3_egress_drv_s { 397 398 l3_egress_l2_rsv_f l3_egress_l2_rsv; 399 400 l3_egress_init_f l3_egress_init; 401 402 l3_egress_deinit_f l3_egress_deinit; 403 404 l3_egress_id_range_get_f l3_egress_id_range_get; 405 406 l3_egress_create_f l3_egress_create; 407 408 l3_egress_destroy_f l3_egress_destroy; 409 410 l3_egress_get_f l3_egress_get; 411 412 l3_egress_find_f l3_egress_find; 413 414 l3_egress_traverse_f l3_egress_traverse; 415 416 l3_egress_obj_id_resolve_f l3_egress_obj_id_resolve; 417 418 l3_egress_obj_id_construct_f l3_egress_obj_id_construct; 419 420 l3_egress_obj_info_get_f l3_egress_obj_info_get; 421 422 l3_egress_obj_cnt_get_f l3_egress_obj_cnt_get; 423 424 l3_egress_dvp_set_f l3_egress_dvp_set; 425 426 l3_egress_flexctr_attach_f l3_egress_flexctr_attach; 427 428 l3_egress_flexctr_detach_f l3_egress_flexctr_detach; 429 430 l3_egress_flexctr_info_get_f l3_egress_flexctr_info_get; 431 432 l3_egress_flexctr_object_set_f l3_egress_flexctr_object_set; 433 434 l3_egress_flexctr_object_get_f l3_egress_flexctr_object_get; 435 436 l3_egress_ifa_create_f l3_egress_ifa_create; 437 438 l3_egress_ifa_destroy_f l3_egress_ifa_destroy; 439 440 l3_egress_ifa_get_f l3_egress_ifa_get; 441 442 l3_egress_ifa_traverse_f l3_egress_ifa_traverse; 443 444 l3_ecmp_create_f l3_ecmp_create; 445 446 l3_ecmp_destroy_f l3_ecmp_destroy; 447 448 l3_ecmp_get_f l3_ecmp_get; 449 450 l3_ecmp_member_add_f l3_ecmp_member_add; 451 452 l3_ecmp_member_del_f l3_ecmp_member_del; 453 454 l3_ecmp_member_del_all_f l3_ecmp_member_del_all; 455 456 l3_ecmp_find_f l3_ecmp_find; 457 458 l3_ecmp_trav_f l3_ecmp_trav; 459 460 l3_ecmp_max_paths_get_f l3_ecmp_max_paths_get; 461 462 l3_ecmp_hash_ctrl_set_f l3_ecmp_hash_ctrl_set; 463 464 l3_ecmp_hash_ctrl_get_f l3_ecmp_hash_ctrl_get; 465 466 l3_ecmp_flow_hash_set_f l3_ecmp_flow_hash_set; 467 468 l3_ecmp_flow_hash_get_f l3_ecmp_flow_hash_get; 469 470 l3_ecmp_port_hash_set_f l3_ecmp_port_hash_set; 471 472 l3_ecmp_port_hash_get_f l3_ecmp_port_hash_get; 473 474 l3_ecmp_member_status_set_f l3_ecmp_member_status_set; 475 476 l3_ecmp_member_status_get_f l3_ecmp_member_status_get; 477 478 l3_ecmp_ethertype_set_f l3_ecmp_ethertype_set; 479 480 l3_ecmp_ethertype_get_f l3_ecmp_ethertype_get; 481 482 l3_ecmp_dlb_mon_config_set_f l3_ecmp_dlb_mon_config_set; 483 484 l3_ecmp_dlb_mon_config_get_f l3_ecmp_dlb_mon_config_get; 485 486 ecmp_member_dest_alloc_f ecmp_member_dest_alloc; 487 488 ecmp_member_dest_get_f ecmp_member_dest_get; 489 490 ecmp_member_dest_free_f ecmp_member_dest_free; 491 492 ecmp_member_dest_update_f ecmp_member_dest_update; 493 494 l3_egress_size_get_f l3_egress_size_get; 495 496 l3_egress_count_get_f l3_egress_count_get; 497 498 l3_ecmp_size_get_f l3_ecmp_size_get; 499 500 l3_ecmp_count_get_f l3_ecmp_count_get; 501 502 l3_ecmp_flexctr_attach_f l3_ecmp_flexctr_attach; 503 504 l3_ecmp_flexctr_detach_f l3_ecmp_flexctr_detach; 505 506 l3_ecmp_flexctr_info_get_f l3_ecmp_flexctr_info_get; 507 508 l3_ecmp_flexctr_object_set_f l3_ecmp_flexctr_object_set; 509 510 l3_ecmp_flexctr_object_get_f l3_ecmp_flexctr_object_get; 511 512 l3_egress_tbl_db_get_f l3_egress_tbl_db_get; 513 514 l3_ecmp_tbl_db_get_f l3_ecmp_tbl_db_get; 515 516 l3_ecmp_flexctr_action_tbl_db_get_f l3_ecmp_flexctr_action_tbl_db_get; 517 518 l3_overlay_table_init_f l3_overlay_table_init; 519 520 l3_ecmp_dlb_stat_set_f l3_ecmp_dlb_stat_set; 521 522 l3_ecmp_dlb_stat_get_f l3_ecmp_dlb_stat_get; 523 524 l3_ecmp_dlb_stat_sync_get_f l3_ecmp_dlb_stat_sync_get; 525 526 l3_egress_add_l2tag_f l3_egress_add_l2tag; 527 528 l3_egress_get_l2tag_f l3_egress_get_l2tag; 529 530 l3_egress_delete_l2tag_f l3_egress_delete_l2tag; 531 532 l3_egress_php_action_add_f l3_egress_php_action_add; 533 534 l3_egress_php_action_del_f l3_egress_php_action_del; 535 536 l3_secmp_clear_f l3_secmp_clear; 537 538 l3_secmp_set_f l3_secmp_set; 539 540 l3_secmp_del_f l3_secmp_del; 541 542 l3_secmp_member_add_f l3_secmp_member_add; 543 544 l3_secmp_member_del_f l3_secmp_member_del; 545 546 l3_secmp_member_del_all_f l3_secmp_member_del_all; 547 548 l3_egress_trunk_member_del_f l3_egress_trunk_member_del; 549 550 l3_egress_trunk_member_add_f l3_egress_trunk_member_add; 551 552 } mbcm_ltsw_l3_egress_drv_t; 553 554 /*! 555 * \brief Set the L3 egress driver of the device. 556 * 557 * \param [in] unit Unit number. 558 * \param [in] drv L2 driver to set. 559 * 560 * \retval SHR_E_NONE No errors. 561 */ 562 extern int 563 mbcm_ltsw_l3_egress_drv_set(int unit, mbcm_ltsw_l3_egress_drv_t *drv); 564 565 /*! 566 * \brief Initialize the L3 egress entries that reserved for L2. 567 * 568 * \param [in] unit Unit number. 569 * 570 * \retval SHR_E_NONE No errors. 571 */ 572 extern int 573 mbcm_ltsw_l3_egress_l2_rsv(int unit); 574 575 /*! 576 * \brief Initialize L3 egress module. 577 * 578 * \param [in] unit Unit number. 579 * 580 * \retval SHR_E_NONE No errors. 581 */ 582 extern int 583 mbcm_ltsw_l3_egress_init(int unit); 584 585 /*! 586 * \brief De-Initialize L3 egress module. 587 * 588 * \param [in] unit Unit number. 589 * 590 * \retval SHR_E_NONE No errors. 591 */ 592 extern int 593 mbcm_ltsw_l3_egress_deinit(int unit); 594 595 /*! 596 * \brief Get the index range of a specified egress object type. 597 * 598 * \param [in] unit Unit number. 599 * \param [in] type Egress object type. 600 * \param [out] min Min index of the egress object type. 601 * \param [out] max Max index of the egress object type. 602 * 603 * \retval SHR_E_NONE No errors. 604 * \retval SHR_E_PARAM Invalid egress object type. 605 */ 606 extern int 607 mbcm_ltsw_l3_egress_id_range_get(int unit, int type, int *min, int *max); 608 609 /*! 610 * \brief Create a L3 egress object. 611 * 612 * \param [in] unit Unit number. 613 * \param [in] egr Egress forwarding destination info. 614 * \param [in/out] idx Egress object ID. 615 * 616 * \retval SHR_E_NONE No errors. 617 */ 618 extern int 619 mbcm_ltsw_l3_egress_create(int unit, bcm_l3_egress_t *egr, int *idx); 620 621 /*! 622 * \brief Destroy a L3 egress object. 623 * 624 * \param [in] unit Unit number. 625 * \param [in] idx Egress object ID. 626 * 627 * \retval SHR_E_NONE No errors. 628 */ 629 extern int 630 mbcm_ltsw_l3_egress_destroy(int unit, int idx); 631 632 /*! 633 * \brief Get a L3 egress object. 634 * 635 * \param [in] unit Unit number. 636 * \param [in] idx Egress object ID. 637 * \param [out] egr Egress object info. 638 * 639 * \retval SHR_E_NONE No errors. 640 */ 641 extern int 642 mbcm_ltsw_l3_egress_get(int unit, int idx, bcm_l3_egress_t *egr); 643 644 /*! 645 * \brief Find a L3 egress object. 646 * 647 * \param [in] unit Unit number. 648 * \param [in] egr Egress object info to match. 649 * \param [out] idx Egress object ID. 650 * 651 * \retval SHR_E_NONE No errors. 652 */ 653 extern int 654 mbcm_ltsw_l3_egress_find(int unit, bcm_l3_egress_t *egr, int *idx); 655 656 /*! 657 * \brief Traverse L3 egress objects. 658 * 659 * Goes through egress objects table and runs the user callback 660 * function at each valid egress objects entry passing back the 661 * information for that object. 662 * 663 * \param [in] unit Unit number. 664 * \param [in] trav_fn Callback function. 665 * \param [in] user_data User data to be passed to callback function. 666 * 667 * \retval SHR_E_NONE No errors. 668 */ 669 extern int 670 mbcm_ltsw_l3_egress_traverse(int unit, 671 bcm_l3_egress_traverse_cb trav_fn, 672 void *user_data); 673 674 /*! 675 * \brief Get egress object type and nhop/ecmp id from egress object ID. 676 * 677 * \param [in] unit Unit number. 678 * \param [in] intf Egress object ID. 679 * \param [out] nh_ecmp_idx Nexthop or ECMP group ID. 680 * \param [out] type Egress object type. 681 * 682 * \retval SHR_E_NONE No errors. 683 */ 684 extern int 685 mbcm_ltsw_l3_egress_obj_id_resolve(int unit, 686 bcm_if_t intf, 687 int *nh_ecmp_idx, 688 bcmi_ltsw_l3_egr_obj_type_t *type); 689 690 /*! 691 * \brief Construct an egress object ID from type and nhop/ecmp index. 692 * 693 * \param [in] unit Unit number. 694 * \param [in] nh_ecmp_idx Nexthop or ECMP group ID. 695 * \param [in] type Egress object type. 696 * \param [out] intf Egress object ID. 697 * 698 * \retval SHR_E_NONE No errors. 699 */ 700 extern int 701 mbcm_ltsw_l3_egress_obj_id_construct(int unit, 702 int nh_ecmp_idx, 703 bcmi_ltsw_l3_egr_obj_type_t type, 704 bcm_if_t *intf); 705 706 /*! 707 * \brief Get the L3 egress object info. 708 * 709 * \param [in] unit Unit Number. 710 * \param [in] intf Egress object ID. 711 * \param [out] info L3 egress object info. 712 * 713 * \retval SHR_E_NONE No errors. 714 * \retval !SHR_E_NONE Failure. 715 */ 716 extern int 717 mbcm_ltsw_l3_egress_obj_info_get(int unit, bcm_if_t intf, 718 bcmi_ltsw_l3_egr_obj_info_t *info); 719 720 /*! 721 * \brief Get the L3 egress object maximum and used number. 722 * 723 * \param [in] unit Unit Number. 724 * \param [in] type Egress object type. 725 * \param [out] max Maximum number of object. 726 * \param [out] used Used number of object. 727 * 728 * \retval SHR_E_NONE No errors. 729 * \retval !SHR_E_NONE Failure. 730 */ 731 extern int 732 mbcm_ltsw_l3_egress_obj_cnt_get(int unit, bcmi_ltsw_l3_egr_obj_type_t type, 733 int *max, int *used); 734 735 /*! 736 * \brief Set the dvp of given egress object. 737 * 738 * \param [in] unit Unit number. 739 * \param [in] intf Egress object ID. 740 * \param [in] dvp Destination VP. 741 * 742 * \retval SHR_E_PARAM Invalid egress object ID. 743 * \retval SHR_E_NONE No errors. 744 * \retval SHR_E_NOT_FOUND The given egress object does not exist. 745 */ 746 extern int 747 mbcm_ltsw_l3_egress_dvp_set(int unit, bcm_if_t intf, int dvp); 748 749 /*! 750 * \brief Attach flexctr action to the given egress object. 751 * 752 * \param [in] unit Unit number. 753 * \param [in] intf_if Interface id of a L3 egress object. 754 * \param [in] info Flex counter information. 755 * 756 * \retval SHR_E_NONE No errors. 757 */ 758 extern int 759 mbcm_ltsw_l3_egress_flexctr_attach( 760 int unit, 761 bcm_if_t intf_id, 762 bcmi_ltsw_flexctr_counter_info_t *info); 763 764 /*! 765 * \brief Detach flexctr action of the given egress object. 766 * 767 * \param [in] unit Unit number. 768 * \param [in] intf_id Interface id of a L3 egress object. 769 * 770 * \retval SHR_E_NONE No errors. 771 */ 772 extern int 773 mbcm_ltsw_l3_egress_flexctr_detach( 774 int unit, 775 bcm_if_t intf_id); 776 777 /*! 778 * \brief Get flex counter information of the given egress object. 779 * 780 * \param [in] unit Unit number. 781 * \param [in] intf_if Interface id of a L3 egress object. 782 * \param [out] info Flex counter information. 783 * 784 * \retval SHR_E_NONE No errors. 785 * \retval !SHR_E_NONE Failure. 786 */ 787 extern int 788 mbcm_ltsw_l3_egress_flexctr_info_get( 789 int unit, 790 bcm_if_t intf_id, 791 bcmi_ltsw_flexctr_counter_info_t *info); 792 793 /*! 794 * \brief Set flex counter object value for the given egress object. 795 * 796 * \param [in] unit Unit number. 797 * \param [in] intf_id Interface id of a L3 egress object. 798 * \param [in] value Flex counter object value. 799 * 800 * The flex counter object value could be used to generate counter index. 801 * 802 * \retval SHR_E_NONE No errors. 803 * \retval !SHR_E_NONE Failure. 804 */ 805 extern int 806 mbcm_ltsw_l3_egress_flexctr_object_set( 807 int unit, 808 bcm_if_t intf_id, 809 uint32_t value); 810 811 /*! 812 * \brief Get flex counter object value for the given egress object. 813 * 814 * \param [in] unit Unit Number. 815 * \param [in] intf_id L3 interface ID pointing to egress object. 816 * \param [out] value Flex counter object value. 817 * 818 * \retval SHR_E_NONE No errors. 819 * \retval !SHR_E_NONE Failure. 820 */ 821 extern int 822 mbcm_ltsw_l3_egress_flexctr_object_get( 823 int unit, 824 bcm_if_t intf_id, 825 uint32_t *value); 826 827 /*! 828 * \brief Create a L3 egress object for IFA. 829 * 830 * \param [in] unit Unit number. 831 * \param [in] egr_ifa L3 egress IFA data. 832 * \param [in/out] idx Egress object ID. 833 * 834 * \retval SHR_E_NONE No errors. 835 */ 836 extern int 837 mbcm_ltsw_l3_egress_ifa_create( 838 int unit, 839 bcmi_ltsw_l3_egr_ifa_t *egr_ifa, 840 int *idx); 841 842 /*! 843 * \brief Destroy a L3 egress object for IFA. 844 * 845 * \param [in] unit Unit number. 846 * \param [in] idx Egress object ID. 847 * 848 * \retval SHR_E_NONE No errors. 849 */ 850 extern int 851 mbcm_ltsw_l3_egress_ifa_destroy(int unit, int idx); 852 853 /*! 854 * \brief Get a L3 egress object for IFA. 855 * 856 * \param [in] unit Unit number. 857 * \param [in] idx Egress object ID. 858 * \param [out] egr_ifa L3 egress IFA data. 859 * 860 * \retval SHR_E_NONE No errors. 861 */ 862 extern int 863 mbcm_ltsw_l3_egress_ifa_get( 864 int unit, 865 int idx, 866 bcmi_ltsw_l3_egr_ifa_t *egr_ifa); 867 868 /*! 869 * \brief Traverse L3 egress objects for IFA. 870 * 871 * Goes through egress objects table and runs the user callback 872 * function at each valid egress objects entry passing back the 873 * information for that object. 874 * 875 * \param [in] unit Unit number. 876 * \param [in] trav_fn Callback function. 877 * \param [in] cb Callback function to contruct IFA header from L3 egress. 878 * \param [in] user_data User data to be passed to callback function. 879 * 880 * \retval SHR_E_NONE No errors. 881 */ 882 extern int 883 mbcm_ltsw_l3_egress_ifa_traverse( 884 int unit, 885 bcm_ifa_header_traverse_cb trav_fn, 886 bcmi_ltsw_l3_egr_to_ifa_header_cb cb, 887 void *user_data); 888 889 /*! 890 * \brief Create an Egress ECMP forwarding object. 891 * 892 * \param [in] unit Unit number. 893 * \param [in] ecmp_info ECMP group information. 894 * \param [in] ecmp_member_count Number of elements in ecmp_member_array. 895 * \param [in] ecmp_member_array Member array of egress forwarding objects. 896 * 897 * \retval SHR_E_NONE No errors. 898 * \retval !SHR_E_NONE Failure. 899 */ 900 extern int 901 mbcm_ltsw_l3_ecmp_create( 902 int unit, 903 bcm_l3_egress_ecmp_t *ecmp_info, 904 int ecmp_member_count, 905 bcm_l3_ecmp_member_t *ecmp_member_array); 906 907 /*! 908 * \brief Destroy an Egress ECMP forwarding object. 909 * 910 * \param [in] unit Unit number. 911 * \param [in] ecmp_group_id L3 ECMP forwarding object ID. 912 * 913 * \retval SHR_E_NONE No errors. 914 * \retval !SHR_E_NONE Failure. 915 */ 916 extern int 917 mbcm_ltsw_l3_ecmp_destroy( 918 int unit, 919 bcm_if_t ecmp_group_id); 920 921 /*! 922 * \brief Get an Egress ECMP forwarding object information. 923 * 924 * \param [in] unit Unit number. 925 * \param [in/out] ecmp_info ECMP group information. 926 * \param [in] ecmp_member_size Size of allocated entries in ecmp_member_array. 927 * \param [out] ecmp_member_array Member array of egress forwarding objects. 928 * \param [out] ecmp_member_count Number of elements in ecmp_member_array. 929 * 930 * If the ecmp_member_size is 0, then ecmp_member_array is ignored and 931 * ecmp_member_count is filled in with the number of members that would have 932 * been filled into ecmp_member_array. 933 * 934 * \retval SHR_E_NONE No errors. 935 * \retval !SHR_E_NONE Failure. 936 */ 937 extern int 938 mbcm_ltsw_l3_ecmp_get( 939 int unit, 940 bcm_l3_egress_ecmp_t *ecmp_info, 941 int ecmp_member_size, 942 bcm_l3_ecmp_member_t *ecmp_member_array, 943 int *ecmp_member_count); 944 945 /*! 946 * \brief Add a member to an Egress ECMP forwarding object. 947 * 948 * \param [in] unit Unit number. 949 * \param [in] ecmp_group_id Egress ECMP forwarding object ID. 950 * \param [in] ecmp_member Pointer to ECMP objects member structure. 951 * 952 * \retval SHR_E_NONE No errors. 953 * \retval !SHR_E_NONE Failure. 954 */ 955 extern int 956 mbcm_ltsw_l3_ecmp_member_add( 957 int unit, 958 bcm_if_t ecmp_group_id, 959 bcm_l3_ecmp_member_t *ecmp_member); 960 961 /*! 962 * \brief Delete a member from an Egress ECMP forwarding object. 963 * 964 * \param [in] unit Unit number. 965 * \param [in] ecmp_group_id Egress ECMP forwarding object ID. 966 * \param [in] ecmp_member Pointer to ECMP objects member structure. 967 * 968 * \retval SHR_E_NONE No errors. 969 * \retval !SHR_E_NONE Failure. 970 */ 971 extern int 972 mbcm_ltsw_l3_ecmp_member_del( 973 int unit, 974 bcm_if_t ecmp_group_id, 975 bcm_l3_ecmp_member_t *ecmp_member); 976 977 /*! 978 * \brief Delete all member from an Egress ECMP forwarding object. 979 * 980 * \param [in] unit Unit number. 981 * \param [in] ecmp_group_id Egress ECMP forwarding object ID. 982 * 983 * \retval SHR_E_NONE No errors. 984 * \retval !SHR_E_NONE Failure. 985 */ 986 extern int 987 mbcm_ltsw_l3_ecmp_member_del_all( 988 int unit, 989 bcm_if_t ecmp_group_id); 990 991 /*! 992 * \brief Find an Egress ECMP forwarding object by given member info. 993 * 994 * \param [in] unit Unit number. 995 * \param [in] ecmp_member_count Number of elements in ecmp_member_array. 996 * \param [in] ecmp_member_array ECMP member array. 997 * \param [out] ecmp_info ECMP group info. 998 * 999 * \retval SHR_E_NONE No errors. 1000 * \retval !SHR_E_NONE Failure. 1001 */ 1002 extern int 1003 mbcm_ltsw_l3_ecmp_find( 1004 int unit, 1005 int ecmp_member_count, 1006 bcm_l3_ecmp_member_t *ecmp_member_array, 1007 bcm_l3_egress_ecmp_t *ecmp_info); 1008 1009 /*! 1010 * \brief Traverse L3 ECMP objects. 1011 * 1012 * Goes through Egress ECMP forwarding objects table and runs the 1013 * user callback function at each Egress ECMP forwarding objects 1014 * entry passing back the information for that ECMP object. 1015 * 1016 * \param [in] unit Unit number. 1017 * \param [in] trav_fun Callback function. 1018 * \param [in] user_data User data to be passed to callback function. 1019 * 1020 * \retval SHR_E_NONE No errors. 1021 * \retval !SHR_E_NONE Failure. 1022 */ 1023 extern int 1024 mbcm_ltsw_l3_ecmp_trav( 1025 int unit, 1026 bcm_l3_ecmp_traverse_cb trav_fn, 1027 void *user_data); 1028 1029 /*! 1030 * \brief Get the maximum ECMP paths supported by LT. 1031 * 1032 * \param [in] unit Unit number. 1033 * \param [in] attr ECMP attributes. 1034 * \param [out] max Maximum number of paths for ECMP. 1035 * 1036 * \retval SHR_E_NONE No errors. 1037 */ 1038 extern int 1039 mbcm_ltsw_l3_ecmp_max_paths_get(int unit, uint32_t attr, int *max_paths); 1040 1041 /*! 1042 * \brief Set the ECMP hash output selection control info. 1043 * 1044 * \param [in] unit Unit number. 1045 * \param [in] underlay Use 1 for underlay ECMP, 0 for overlay ECMP. 1046 * \param [in] flow_based Use 1 for flow-based hash, 0 for port-based hash. 1047 * 1048 * \retval SHR_E_NONE NO errors. 1049 */ 1050 extern int 1051 mbcm_ltsw_l3_ecmp_hash_ctrl_set(int unit, int underlay, int flow_based); 1052 1053 /*! 1054 * \brief Get the ECMP hash output selection control info. 1055 * 1056 * \param [in] unit Unit number. 1057 * \param [in] underlay Use 1 for underlay ECMP, 0 for overlay ECMP. 1058 * \param [out] flow_based Use 1 for flow-based hash, 0 for port-based hash. 1059 * 1060 * \retval SHR_E_NONE NO errors. 1061 */ 1062 extern int 1063 mbcm_ltsw_l3_ecmp_hash_ctrl_get(int unit, int underlay, int *flow_based); 1064 1065 /*! 1066 * \brief Configure the ECMP flow-based hash output selection. 1067 * 1068 * \param [in] unit Unit number. 1069 * \param [in] type ECMP hash output selection configure type. 1070 * \param [in] arg Configuration value. 1071 * 1072 * \retval SHR_E_NONE NO errors. 1073 */ 1074 extern int 1075 mbcm_ltsw_l3_ecmp_flow_hash_set(int unit, 1076 bcmi_ltsw_l3_ecmp_hash_cfg_type_t type, 1077 int arg); 1078 1079 /*! 1080 * \brief Get the ECMP flow-based hash output selection info. 1081 * 1082 * \param [in] unit Unit number. 1083 * \param [in] type ECMP hash output selection configure type. 1084 * \param [out] arg Configuration value. 1085 * 1086 * \retval SHR_E_NONE NO errors. 1087 */ 1088 extern int 1089 mbcm_ltsw_l3_ecmp_flow_hash_get(int unit, 1090 bcmi_ltsw_l3_ecmp_hash_cfg_type_t type, 1091 int *arg); 1092 1093 /*! 1094 * \brief Configure the ECMP port-based hash output selection. 1095 * 1096 * \param [in] unit Unit number. 1097 * \param [in] port Port number. 1098 * \param [in] type ECMP hash output selection configure type. 1099 * \param [in] arg Configuration value. 1100 * 1101 * \retval SHR_E_NONE NO errors. 1102 */ 1103 extern int 1104 mbcm_ltsw_l3_ecmp_port_hash_set(int unit, 1105 int port, 1106 bcmi_ltsw_l3_ecmp_hash_cfg_type_t type, 1107 int arg); 1108 1109 /*! 1110 * \brief Get the ECMP port-based hash output selection control. 1111 * 1112 * \param [in] unit Unit number. 1113 * \param [in] port Port number. 1114 * \param [in] type ECMP hash output selection configure type. 1115 * \param [out] arg Configuration value. 1116 * 1117 * \retval SHR_E_NONE NO errors. 1118 */ 1119 extern int 1120 mbcm_ltsw_l3_ecmp_port_hash_get(int unit, 1121 int port, 1122 bcmi_ltsw_l3_ecmp_hash_cfg_type_t type, 1123 int *arg); 1124 1125 /*! 1126 * \brief Set ECMP dynamic load balancing member status. 1127 * 1128 * \param [in] unit Unit number. 1129 * \param [in] intf L3 interface ID pointing to an Egress Object. 1130 * \param [in] status ECMP member status. 1131 * 1132 * \retval SHR_E_NONE No errors. 1133 * \retval !SHR_E_NONE Failure. 1134 */ 1135 extern int 1136 mbcm_ltsw_l3_ecmp_member_status_set(int unit, bcm_if_t intf, int status); 1137 1138 /*! 1139 * \brief Get ECMP dynamic load balancing member status. 1140 * 1141 * \param [in] unit Unit number. 1142 * \param [in] intf L3 interface ID pointing to an Egress Object. 1143 * \param [out] status ECMP member status. 1144 * 1145 * \retval SHR_E_NONE No errors. 1146 * \retval !SHR_E_NONE Failure. 1147 */ 1148 extern int 1149 mbcm_ltsw_l3_ecmp_member_status_get(int unit, bcm_if_t intf, int *status); 1150 1151 /*! 1152 * \brief Set DLB Eligibility Ethertype. 1153 * 1154 * \param [in] unit Unit Number. 1155 * \param [in] flags Flags. 1156 * \param [in] ethertype_count Ethertype count. 1157 * \param [in] ethertype_array Ethertype array. 1158 * 1159 * \retval SHR_E_NONE No errors. 1160 * \retval !SHR_E_NONE Failure. 1161 */ 1162 extern int 1163 mbcm_ltsw_l3_ecmp_ethertype_set( 1164 int unit, 1165 uint32_t flags, 1166 int ethertype_count, 1167 int *ethertype_array); 1168 1169 /*! 1170 * \brief Get DLB Eligibility Ethertype. 1171 * 1172 * \param [in] unit Unit Number. 1173 * \param [in] ethertype_max Max ethertype count. 1174 * \param [out] flags Flags. 1175 * \param [out] ethertype_array Ethertype array. 1176 * \param [out] ethertype_count Actual ethertype count. 1177 * 1178 * \retval SHR_E_NONE No errors. 1179 * \retval !SHR_E_NONE Failure. 1180 */ 1181 extern int 1182 mbcm_ltsw_l3_ecmp_ethertype_get( 1183 int unit, 1184 int ethertype_max, 1185 uint32_t *flags, 1186 int *ethertype_array, 1187 int *ethertype_count); 1188 1189 /*! 1190 * \brief Set the ECMP dlb monitor configurations. 1191 * 1192 * \param [in] unit Unit Number. 1193 * \param [in] tid ECMP Identifier. 1194 * \param [in] dlb_mon_cfg ECMP DLB monitor configurations. 1195 * 1196 * \retval SHR_E_NONE No errors. 1197 * \retval !SHR_E_NONE Failure. 1198 */ 1199 extern int 1200 mbcm_ltsw_l3_ecmp_dlb_mon_config_set(int unit, 1201 bcm_if_t ecmp_group_id, 1202 bcm_l3_ecmp_dlb_mon_cfg_t *dlb_mon_cfg); 1203 1204 /*! 1205 * \brief Get the ECMP dlb monitor configurations. 1206 * 1207 * \param [in] unit Unit Number. 1208 * \param [in] tid ECMP Identifier. 1209 * \param [out] dlb_mon_cfg ECMP DLB monitor configurations. 1210 * 1211 * \retval SHR_E_NONE No errors. 1212 * \retval !SHR_E_NONE Failure. 1213 */ 1214 extern int 1215 mbcm_ltsw_l3_ecmp_dlb_mon_config_get(int unit, 1216 bcm_if_t ecmp_group_id, 1217 bcm_l3_ecmp_dlb_mon_cfg_t *dlb_mon_cfg); 1218 1219 /*! 1220 * \brief Allocate an entry from ECMP Level 0 member table. 1221 * 1222 * \param [in] unit Unit Number. 1223 * \param [in] dest_info Destination info. 1224 * \param [out] dest_index Entry index. 1225 * 1226 * \retval SHR_E_NONE No errors. 1227 * \retval !SHR_E_NONE Failure. 1228 */ 1229 extern int 1230 mbcm_ltsw_ecmp_member_dest_alloc(int unit, 1231 bcmi_ltsw_ecmp_member_dest_info_t *dest_info, 1232 int *dest_index); 1233 1234 /*! 1235 * \brief Get ECMP MEMBER destination info. 1236 * 1237 * \param [in] unit Unit Number. 1238 * \param [in] dest_index Entry index. 1239 * \param [out] dest_info Destination info. 1240 * 1241 * \retval SHR_E_NONE No errors. 1242 * \retval !SHR_E_NONE Failure. 1243 */ 1244 extern int 1245 mbcm_ltsw_ecmp_member_dest_get(int unit, 1246 int dest_index, 1247 bcmi_ltsw_ecmp_member_dest_info_t *dest_info); 1248 1249 /*! 1250 * \brief Free an entry to ECMP Level 0 member table. 1251 * 1252 * \param [in] unit Unit Number. 1253 * \param [in] dest_index Destination index. 1254 * 1255 * \retval SHR_E_NONE No errors. 1256 * \retval !SHR_E_NONE Failure. 1257 */ 1258 extern int 1259 mbcm_ltsw_ecmp_member_dest_free(int unit, int dest_index); 1260 1261 /*! 1262 * \brief Update an entry in ECMP Level 0 member table. 1263 * 1264 * \param [in] unit Unit Number. 1265 * \param [in] dest_info Destination info. 1266 * 1267 * \retval SHR_E_NONE No errors. 1268 * \retval !SHR_E_NONE Failure. 1269 */ 1270 extern int 1271 mbcm_ltsw_ecmp_member_dest_update(int unit, 1272 bcmi_ltsw_ecmp_member_dest_info_t *dest_info); 1273 1274 /*! 1275 * \brief Public function to get L3 egress next hop table size. 1276 * 1277 * \param [in] unit Unit Number. 1278 * \param [out] size L3 egress next hop table size. 1279 * 1280 * \retval SHR_E_NONE No errors. 1281 * \retval !SHR_E_NONE Failure. 1282 */ 1283 1284 extern int 1285 mbcm_ltsw_l3_egress_size_get( 1286 int unit, 1287 int *size); 1288 1289 /*! 1290 * \brief Public function to get current L3 egress next hop entry count. 1291 * 1292 * \param [in] unit Unit Number. 1293 * \param [out] count L3 egress next hop entry count. 1294 * 1295 * \retval SHR_E_NONE No errors. 1296 * \retval !SHR_E_NONE Failure. 1297 */ 1298 extern int 1299 mbcm_ltsw_l3_egress_count_get( 1300 int unit, 1301 int *count); 1302 1303 /*! 1304 * \brief Public function to get L3 ECMP table size. 1305 * 1306 * \param [in] unit Unit Number. 1307 * \param [out] size L3 ECMP table size. 1308 * 1309 * \retval SHR_E_NONE No errors. 1310 * \retval !SHR_E_NONE Failure. 1311 */ 1312 1313 extern int 1314 mbcm_ltsw_l3_ecmp_size_get( 1315 int unit, 1316 int *size); 1317 1318 /*! 1319 * \brief Public function to get current L3 ECMP entry count. 1320 * 1321 * \param [in] unit Unit Number. 1322 * \param [out] count L3 ECMP entry count. 1323 * 1324 * \retval SHR_E_NONE No errors. 1325 * \retval !SHR_E_NONE Failure. 1326 */ 1327 extern int 1328 mbcm_ltsw_l3_ecmp_count_get( 1329 int unit, 1330 int *count); 1331 1332 /*! 1333 * \brief Attach flexctr action to the given L3 ECMP object. 1334 * 1335 * \param [in] unit Unit number. 1336 * \param [in] intf_if Interface id of a L3 ECMP object. 1337 * \param [in] info Flex counter information. 1338 * 1339 * \retval SHR_E_NONE No errors. 1340 */ 1341 extern int 1342 mbcm_ltsw_l3_ecmp_flexctr_attach( 1343 int unit, 1344 bcm_if_t intf_id, 1345 bcmi_ltsw_flexctr_counter_info_t *info); 1346 1347 /*! 1348 * \brief Detach flexctr action of the given L3 ECMP object. 1349 * 1350 * \param [in] unit Unit number. 1351 * \param [in] intf_id Interface id of a L3 ECMP object. 1352 * 1353 * \retval SHR_E_NONE No errors. 1354 */ 1355 extern int 1356 mbcm_ltsw_l3_ecmp_flexctr_detach( 1357 int unit, 1358 bcm_if_t intf_id); 1359 1360 /*! 1361 * \brief Get flex counter information of the given L3 ECMP object. 1362 * 1363 * \param [in] unit Unit number. 1364 * \param [in] intf_if Interface id of aL3 ECMP object. 1365 * \param [out] info Flex counter information. 1366 * 1367 * \retval SHR_E_NONE No errors. 1368 * \retval !SHR_E_NONE Failure. 1369 */ 1370 extern int 1371 mbcm_ltsw_l3_ecmp_flexctr_info_get( 1372 int unit, 1373 bcm_if_t intf_id, 1374 bcmi_ltsw_flexctr_counter_info_t *info); 1375 1376 /*! 1377 * \brief Set flex counter object value for the given L3 ECMP object. 1378 * 1379 * \param [in] unit Unit number. 1380 * \param [in] intf_id Interface id of a L3 ECMP object. 1381 * \param [in] value Flex counter object value. 1382 * 1383 * The flex counter object value could be used to generate counter index. 1384 * 1385 * \retval SHR_E_NONE No errors. 1386 * \retval !SHR_E_NONE Failure. 1387 */ 1388 extern int 1389 mbcm_ltsw_l3_ecmp_flexctr_object_set( 1390 int unit, 1391 bcm_if_t intf_id, 1392 uint32_t value); 1393 1394 /*! 1395 * \brief Get flex counter object value for the given L3 ECMP object. 1396 * 1397 * \param [in] unit Unit Number. 1398 * \param [in] intf_id L3 interface ID pointing to L3 ECMP object. 1399 * \param [out] value Flex counter object value. 1400 * 1401 * \retval SHR_E_NONE No errors. 1402 * \retval !SHR_E_NONE Failure. 1403 */ 1404 extern int 1405 mbcm_ltsw_l3_ecmp_flexctr_object_get( 1406 int unit, 1407 bcm_if_t intf_id, 1408 uint32_t *value); 1409 1410 /*! 1411 * \brief Get the L3 egress table database. 1412 * 1413 * \param [in] unit Unit number. 1414 * \param [out] tbl_db L3 egress table databse. 1415 * 1416 * \retval SHR_E_NONE No errors. 1417 */ 1418 extern int 1419 mbcm_ltsw_l3_egress_tbl_db_get( 1420 int unit, 1421 bcmint_ltsw_l3_egress_tbl_db_t *tbl_db); 1422 1423 /*! 1424 * \brief Get the L3 ECMP table database. 1425 * 1426 * \param [in] unit Unit number. 1427 * \param [out] tbl_db L3 ECMP table databse. 1428 * 1429 * \retval SHR_E_NONE No errors. 1430 */ 1431 extern int 1432 mbcm_ltsw_l3_ecmp_tbl_db_get( 1433 int unit, 1434 bcmint_ltsw_l3_egress_tbl_db_t *tbl_db); 1435 1436 /*! 1437 * \brief Get the L3 ECMP flex ctr action table database. 1438 * 1439 * \param [in] unit Unit number. 1440 * \param [out] tbl_db L3 ECMP flex ctr action table databse. 1441 * 1442 * \retval SHR_E_NONE No errors. 1443 */ 1444 extern int 1445 mbcm_ltsw_l3_ecmp_flexctr_action_tbl_db_get( 1446 int unit, 1447 bcmint_ltsw_l3_egress_tbl_db_t *tbl_db); 1448 1449 /*! 1450 * \brief Init L3 overlay entries. 1451 * 1452 * \param [in] unit Unit number. 1453 * 1454 * \retval SHR_E_NONE No errors. 1455 */ 1456 extern int 1457 mbcm_ltsw_l3_overlay_table_init( 1458 int unit, 1459 bcmint_ltsw_l3_ol_tbl_info_t *info); 1460 1461 /*! 1462 * \brief Set the DLB statistics based on the ECMP interface. 1463 * 1464 * \param [in] unit Unit number. 1465 * \param [in] ecmp_intf ECMP interface id. 1466 * \param [in] type L3 ECMP DLB statistics type.. 1467 * \param [in] value 64-bit counter value. 1468 * 1469 * \retval SHR_E_NONE on success and error code otherwise. 1470 */ 1471 extern int 1472 mbcm_ltsw_l3_ecmp_dlb_stat_set( 1473 int unit, 1474 bcm_if_t ecmp_intf, 1475 bcm_l3_ecmp_dlb_stat_t type, 1476 uint64_t value); 1477 1478 /*! 1479 * \brief Get the DLB statistics based on the ECMP interface. 1480 * 1481 * \param [in] unit Unit number. 1482 * \param [in] ecmp_intf ECMP interface id. 1483 * \param [in] type L3 ECMP DLB statistics type.. 1484 * \param [out] value 64-bit counter value. 1485 * 1486 * \retval SHR_E_NONE on success and error code otherwise. 1487 */ 1488 extern int 1489 mbcm_ltsw_l3_ecmp_dlb_stat_get( 1490 int unit, 1491 bcm_if_t ecmp_intf, 1492 bcm_l3_ecmp_dlb_stat_t type, 1493 uint64_t *value); 1494 1495 /*! 1496 * \brief Get the DLB statistics based on the ECMP interface in sync mode. 1497 * 1498 * \param [in] unit Unit number. 1499 * \param [in] ecmp_intf ECMP interface id. 1500 * \param [in] type L3 ECMP DLB statistics type.. 1501 * \param [out] value 64-bit counter value. 1502 * 1503 * \retval SHR_E_NONE on success and error code otherwise. 1504 */ 1505 extern int 1506 mbcm_ltsw_l3_ecmp_dlb_stat_sync_get( 1507 int unit, 1508 bcm_if_t ecmp_intf, 1509 bcm_l3_ecmp_dlb_stat_t type, 1510 uint64_t *value); 1511 1512 /*! 1513 * \brief Public function to add L2 tag for L3 egress. 1514 * 1515 * \param [in] unit Unit Number. 1516 * \param [in] nhidx Nexthop index. 1517 * \param [in] l2_tag_info L2 tag information. 1518 * 1519 * \retval SHR_E_NONE No errors. 1520 * \retval !SHR_E_NONE Failure. 1521 */ 1522 extern int 1523 mbcm_ltsw_l3_egress_add_l2tag( 1524 int unit, 1525 int nhidx, 1526 bcmi_ltsw_l3_egr_l2_tag_info_t *l2_tag_info); 1527 1528 /*! 1529 * \brief Public function to get L2 tag from L3 egress. 1530 * 1531 * \param [in] unit Unit Number. 1532 * \param [in] nhidx Nexthop index. 1533 * \param [out] l2_tag_info L2 tag information. 1534 * 1535 * \retval SHR_E_NONE No errors. 1536 * \retval !SHR_E_NONE Failure. 1537 */ 1538 extern int 1539 mbcm_ltsw_l3_egress_get_l2tag( 1540 int unit, 1541 int nhidx, 1542 bcmi_ltsw_l3_egr_l2_tag_info_t *l2_tag_info); 1543 1544 /*! 1545 * \brief Public function to delete L2 tag from L3 egress. 1546 * 1547 * \param [in] unit Unit Number. 1548 * \param [in] nhidx Nexthop index. 1549 * 1550 * \retval SHR_E_NONE No errors. 1551 * \retval !SHR_E_NONE Failure. 1552 */ 1553 extern int 1554 mbcm_ltsw_l3_egress_delete_l2tag( 1555 int unit, 1556 int nhidx); 1557 1558 /*! 1559 * \brief Public function to add PHP action to L3 egress. 1560 * 1561 * \param [in] unit Unit Number. 1562 * \param [in] nhidx Nexthop index. 1563 * 1564 * \retval SHR_E_NONE No errors. 1565 * \retval !SHR_E_NONE Failure. 1566 */ 1567 extern int 1568 mbcm_ltsw_l3_egress_php_action_add( 1569 int unit, 1570 bcm_if_t intf); 1571 1572 /*! 1573 * \brief Public function to delete PHP action from L3 egress. 1574 * 1575 * \param [in] unit Unit Number. 1576 * \param [in] nhidx Nexthop index. 1577 * 1578 * \retval SHR_E_NONE No errors. 1579 * \retval !SHR_E_NONE Failure. 1580 */ 1581 extern int 1582 mbcm_ltsw_l3_egress_php_action_delete( 1583 int unit, 1584 bcm_if_t intf); 1585 1586 /*! 1587 * \brief clear all source ECMP table. 1588 * 1589 * \param [in] unit Unit number. 1590 * 1591 * \retval SHR_E_NONE No errors. 1592 * \retval !SHR_E_NONE Failure. 1593 */ 1594 extern int 1595 mbcm_ltsw_l3_secmp_clear(int unit); 1596 1597 /*! 1598 * \brief Set source ECMP. 1599 * 1600 * \param [in] unit Unit number. 1601 * \param [in] idx Entry index. 1602 * \param [in] ecmp_info ECMP group info. 1603 * \param [in] member Array of ECMP member info. 1604 * \param [in] count Count of ECMP member. 1605 * 1606 * \retval SHR_E_NONE No errors. 1607 * \retval !SHR_E_NONE Failure. 1608 */ 1609 extern int 1610 mbcm_ltsw_l3_secmp_set( 1611 int unit, 1612 int idx, 1613 bcm_l3_egress_ecmp_t *ecmp_info, 1614 bcmi_ltsw_l3_ecmp_member_info_t *member, 1615 int count); 1616 /*! 1617 * \brief Delete source ECMP group. 1618 * 1619 * \param [in] unit Unit number. 1620 * \param [in] idx Entry index of source ECMP group. 1621 * 1622 * \retval SHR_E_NONE No errors. 1623 * \retval !SHR_E_NONE Failure. 1624 */ 1625 extern int 1626 mbcm_ltsw_l3_secmp_del( 1627 int unit, 1628 int idx); 1629 1630 /*! 1631 * \brief Add a member to a source ECMP group. 1632 * 1633 * \param [in] unit Unit number. 1634 * \param [in] idx Entry index. 1635 * \param [in] member Pointer to ECMP member info. 1636 * 1637 * \retval SHR_E_NONE No errors. 1638 * \retval !SHR_E_NONE Failure. 1639 */ 1640 extern int 1641 mbcm_ltsw_l3_secmp_member_add( 1642 int unit, 1643 int idx, 1644 bcmi_ltsw_l3_ecmp_member_info_t *member); 1645 1646 /*! 1647 * \brief Delete a member from a source ECMP group. 1648 * 1649 * \param [in] unit Unit number. 1650 * \param [in] idx Entry index. 1651 * \param [in] member Array of ECMP member info. 1652 * \param [in] count Count of ECMP member. 1653 * \param [in] del_member Information to ECMP member to be deleted. 1654 * 1655 * \retval SHR_E_NONE No errors. 1656 * \retval !SHR_E_NONE Failure. 1657 */ 1658 extern int 1659 mbcm_ltsw_l3_secmp_member_del( 1660 int unit, 1661 int idx, 1662 bcmi_ltsw_l3_ecmp_member_info_t *member, 1663 int count, 1664 bcmi_ltsw_l3_ecmp_member_info_t *del_member); 1665 1666 /*! 1667 * \brief Delete all members from a source ECMP group. 1668 * 1669 * \param [in] unit Unit number. 1670 * \param [in] idx Entry index. 1671 * 1672 * \retval SHR_E_NONE No errors. 1673 * \retval !SHR_E_NONE Failure. 1674 */ 1675 extern int 1676 mbcm_ltsw_l3_secmp_member_del_all( 1677 int unit, 1678 int idx); 1679 1680 /*! 1681 * \brief Clear trunk port membership from EGR_SYSPORT_TO_NHI 1682 * 1683 * \param [in] unit Unit number. 1684 * \param [in] tid Trunk ID. 1685 * \param [out] member_cnt Count of trunk members to be deleted. 1686 * \param [out] member_arr Trunk member gports to be deleted. 1687 * 1688 * \retval SHR_E_NONE No errors. 1689 * \retval SHR_E_PARAM Invalid egress object type. 1690 */ 1691 extern int 1692 mbcm_ltsw_l3_egress_trunk_member_delete(int unit, bcm_trunk_t trunk_id, 1693 int member_cnt, bcm_port_t *member_arr); 1694 1695 /*! 1696 * \brief Active trunk port membership in EGR_SYSPORT_TO_NHI 1697 * 1698 * \param [in] unit Unit number. 1699 * \param [in] tid Trunk ID. 1700 * \param [out] member_cnt Count of trunk members to be added. 1701 * \param [out] member_arr Trunk member gports to be added. 1702 * 1703 * \retval SHR_E_NONE No errors. 1704 * \retval SHR_E_PARAM Invalid egress object type. 1705 */ 1706 extern int 1707 mbcm_ltsw_l3_egress_trunk_member_add(int unit, bcm_trunk_t trunk_id, 1708 int member_cnt, bcm_port_t *member_arr); 1709 #endif /* BCMI_LTSW_MBCM_L3_EGRESS_H */ 1710