qos.h (21718B)
1 /* 2 * DO NOT EDIT THIS FILE! 3 * This file is auto-generated. 4 * Edits to this file will be lost when it is regenerated. 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_QOS_H 12 #define BCMINT_LTSW_MBCM_QOS_H 13 14 #include <bcm/qos.h> 15 #include <bcm/types.h> 16 17 #include <bcm_int/ltsw/qos.h> 18 #include <bcm_int/ltsw/qos_int.h> 19 20 #include <sal/sal_types.h> 21 22 /*! 23 * \brief Initialize QoS module. 24 * 25 * \param [in] unit Unit Number. 26 * 27 * \retval SHR_E_NONE No errors. 28 * \retval !SHR_E_NONE Failure. 29 */ 30 typedef int (*qos_init_f)(int unit); 31 32 /*! 33 * \brief Detach QoS module. 34 * 35 * \param [in] unit Unit Number. 36 * 37 * \retval SHR_E_NONE No errors. 38 * \retval !SHR_E_NONE Failure. 39 */ 40 typedef int (*qos_detach_f)(int unit); 41 42 /*! 43 * \brief Clear all QoS tables. 44 * 45 * \param [in] unit Unit Number. 46 * 47 * \retval SHR_E_NONE No errors. 48 * \retval !SHR_E_NONE Failure. 49 */ 50 typedef int (*qos_table_clear_all_f)(int unit); 51 52 /*! 53 * \brief Set QoS controls. 54 * 55 * \param [in] unit Unit Number. 56 * \param [in] control The desired configuration parameter to modify. 57 * \param [in] value The value with which to set the parameter. 58 * 59 * \retval SHR_E_NONE No errors. 60 * \retval !SHR_E_NONE Failure. 61 */ 62 typedef int (*qos_control_set_f)( 63 int unit, 64 bcmi_ltsw_qos_control_t control, 65 uint32_t value); 66 67 /*! 68 * \brief Get QoS controls. 69 * 70 * \param [in] unit Unit Number. 71 * \param [in] control The desired configuration parameter to retrieve. 72 * \param [out] value Pointer to where the retrieved value will be written. 73 * 74 * \retval SHR_E_NONE No errors. 75 * \retval !SHR_E_NONE Failure. 76 */ 77 typedef int (*qos_control_get_f)( 78 int unit, 79 bcmi_ltsw_qos_control_t control, 80 uint32_t *value); 81 82 /*! 83 * \brief Create a QoS map. 84 * 85 * \param [in] unit Unit Number. 86 * \param [in] flags QoS flags. 87 * \param [out] map_id QoS map id. 88 * 89 * \retval SHR_E_NONE No errors. 90 * \retval !SHR_E_NONE Failure. 91 */ 92 typedef int (*qos_map_create_f)( 93 int unit, 94 uint32_t flags, 95 int *map_id); 96 97 /*! 98 * \brief Destroy a QoS map. 99 * 100 * \param [in] unit Unit Number. 101 * \param [in] map_id QoS map id. 102 * 103 * \retval SHR_E_NONE No errors. 104 * \retval !SHR_E_NONE Failure. 105 */ 106 typedef int (*qos_map_destroy_f)( 107 int unit, 108 int map_id); 109 110 /*! 111 * \brief Add an entry into a QoS map. 112 * 113 * \param [in] unit Unit Number. 114 * \param [in] flags QoS flags. 115 * \param [in] map QoS map. 116 * \param [in] map_id QoS map id. 117 * 118 * \retval SHR_E_NONE No errors. 119 * \retval !SHR_E_NONE Failure. 120 */ 121 typedef int (*qos_map_add_f)( 122 int unit, 123 uint32_t flags, 124 bcm_qos_map_t *map, 125 int map_id); 126 127 /*! 128 * \brief Delete an entry from a QoS map. 129 * 130 * \param [in] unit Unit Number. 131 * \param [in] flags QoS flags. 132 * \param [in] map QoS map. 133 * \param [in] map_id QoS map id. 134 * 135 * \retval SHR_E_NONE No errors. 136 * \retval !SHR_E_NONE Failure. 137 */ 138 typedef int (*qos_map_delete_f)( 139 int unit, 140 uint32_t flags, 141 bcm_qos_map_t *map, 142 int map_id); 143 144 /*! 145 * \brief Attach QoS map to an object(Gport). 146 * 147 * \param [in] unit Unit Number. 148 * \param [in] port Port/Gport id. 149 * \param [in] ing_map Ingress map id. 150 * \param [in] egr_map Egress map id. 151 * 152 * \retval SHR_E_NONE No errors. 153 * \retval !SHR_E_NONE Failure. 154 */ 155 typedef int (*qos_port_map_set_f)( 156 int unit, 157 bcm_gport_t port, 158 int ing_map, 159 int egr_map); 160 161 /*! 162 * \brief Retrieve the configured QoS mapping matching a type for the given GPORT. 163 * 164 * \param [in] unit Unit Number. 165 * \param [in] port Port/Gport id. 166 * \param [in] flags QoS flags. 167 * \param [out] map_id QoS map id. 168 * 169 * \retval SHR_E_NONE No errors. 170 * \retval !SHR_E_NONE Failure. 171 */ 172 typedef int (*qos_port_map_type_get_f)( 173 int unit, 174 bcm_gport_t port, 175 uint32_t flags, 176 int *map_id); 177 178 /*! 179 * \brief Get an entire QoS mapping for the given QoS Map ID. 180 * 181 * \param [in] unit Unit Number. 182 * \param [in] flags QoS flags. 183 * \param [in] map_id QoS map id. 184 * \param [in] array_size Size of allocated entries in array. 185 * \param [out] array QoS map array. 186 * \param [out] count Actual number of QoS map entries. 187 * 188 * \retval SHR_E_NONE No errors. 189 * \retval !SHR_E_NONE Failure. 190 */ 191 typedef int (*qos_map_multi_get_f)( 192 int unit, 193 uint32_t flags, 194 int map_id, 195 int array_size, 196 bcm_qos_map_t *array, 197 int *count); 198 199 /*! 200 * \brief Get the list of all QoS Map IDs. 201 * 202 * \param [in] unit Unit Number. 203 * \param [in] array_size Size of allocated entries in map_id array. 204 * \param [out] map_id QoS map id array. 205 * \param [out] flags QoS flags array. 206 * \param [out] count Actual number of QoS map id. 207 * 208 * \retval SHR_E_NONE No errors. 209 * \retval !SHR_E_NONE Failure. 210 */ 211 typedef int (*qos_multi_get_f)( 212 int unit, 213 int array_size, 214 int *map_id, 215 int *flags, 216 int *count); 217 218 /*! 219 * \brief Set ingress and egress VLAN port based related QoS setting. 220 * 221 * \param [in] unit Unit Number. 222 * \param [in] port Ingress port. 223 * \param [in] vid Vlan domain. 224 * \param [in] ing_map Ingress QoS id. 225 * \param [in] egr_map Egress QoS id. 226 * 227 * \retval SHR_E_NONE No errors. 228 * \retval !SHR_E_NONE Failure. 229 */ 230 typedef int (*qos_port_vlan_map_set_f)( 231 int unit, 232 bcm_port_t port, 233 bcm_vlan_t vid, 234 int ing_map, 235 int egr_map); 236 237 /*! 238 * \brief Get ingress and egress VLAN port based related QoS setting. 239 * 240 * \param [in] unit Unit Number. 241 * \param [in] port Ingress port. 242 * \param [in] vid Vlan domain. 243 * \param [out] ing_map Ingress QoS id. 244 * \param [out] egr_map Egress QoS id. 245 * 246 * \retval SHR_E_NONE No errors. 247 * \retval !SHR_E_NONE Failure. 248 */ 249 typedef int (*qos_port_vlan_map_get_f)( 250 int unit, 251 bcm_port_t port, 252 bcm_vlan_t vid, 253 int *ing_map, 254 int *egr_map); 255 256 /*! 257 * \brief Resolve QoS map id into mapping pointer and QoS map type. 258 * 259 * \param [in] unit Unit Number. 260 * \param [in] map_id QoS map id. 261 * \param [out] type QoS map type. NULL indicates not care. 262 * \param [out] ptr Mapping pointer. NULL indicates not care. 263 * 264 * \retval SHR_E_NONE No errors. 265 * \retval !SHR_E_NONE Failure. 266 */ 267 typedef int (*qos_map_id_resolve_f)( 268 int unit, 269 int map_id, 270 bcmi_ltsw_qos_map_type_t *type, 271 int *ptr); 272 273 /*! 274 * \brief Construct QoS map id with mapping pointer and QoS map type. 275 * 276 * \param [in] unit Unit Number. 277 * \param [in] ptr Mapping pointer. 278 * \param [in] type QoS map type. 279 * \param [out] map_id QoS map id. 280 * 281 * \retval SHR_E_NONE No errors. 282 * \retval !SHR_E_NONE Failure. 283 */ 284 typedef int (*qos_map_id_construct_f)( 285 int unit, 286 int ptr, 287 bcmi_ltsw_qos_map_type_t type, 288 int *map_id); 289 290 /*! 291 * \brief Get default mapping pointer. 292 * 293 * \param [in] unit Unit Number. 294 * \param [in] type QoS map type. 295 * \param [out] ptr Mapping pointer. 296 * 297 * \retval SHR_E_NONE No errors. 298 * \retval !SHR_E_NONE Failure. 299 */ 300 typedef int (*qos_default_ptr_get_f)( 301 int unit, 302 bcmi_ltsw_qos_map_type_t type, 303 int *ptr); 304 305 /*! 306 * \brief Get dummy operation pointer. The pointer indicates QoS remarking will do nothing with int_cn/int_pri/cng. 307 * 308 * \param [in] unit Unit Number. 309 * \param [in] type QoS map type. 310 * \param [out] ptr Mapping pointer. 311 * 312 * \retval SHR_E_NONE No errors. 313 * \retval !SHR_E_NONE Failure. 314 */ 315 typedef int (*qos_dummy_ptr_get_f)( 316 int unit, 317 bcmi_ltsw_qos_map_type_t type, 318 int *ptr); 319 320 /*! 321 * \brief Dump QoS module software bookkeepings. 322 * 323 * \param [in] unit Unit Number. 324 */ 325 typedef void (*qos_sw_dump_f)(int unit); 326 327 /*! 328 * \brief Set egress L2 map on a port based on egress VLAN priority source. 329 * 330 * \param [in] unit Unit Number. 331 * \param [in] port Port id. 332 * \param [in] src Source of egress VLAN priority. 333 * 334 * \retval SHR_E_NONE No errors. 335 * \retval !SHR_E_NONE Failure. 336 */ 337 typedef int (*qos_port_egr_l2_map_set_f)( 338 int unit, 339 bcm_port_t port, 340 int src); 341 342 /*! 343 * \brief Get egress VLAN priority source on a port based on egress L2 map. 344 * 345 * \param [in] unit Unit Number. 346 * \param [in] port Port id. 347 * \param [out] src Source of egress VLAN priority. 348 * 349 * \retval SHR_E_NONE No errors. 350 * \retval !SHR_E_NONE Failure. 351 */ 352 typedef int (*qos_port_egr_l2_map_get_f)( 353 int unit, 354 bcm_port_t port, 355 int *src); 356 357 /*! 358 * \brief Restore default QoS setting on a new port during flex port. 359 * 360 * \param [in] unit Unit Number. 361 * \param [in] port Port id. 362 * 363 * \retval SHR_E_NONE No errors. 364 * \retval !SHR_E_NONE Failure. 365 */ 366 typedef int (*qos_port_attach_f)( 367 int unit, 368 bcm_port_t port); 369 370 /*! 371 * \brief Clear default QoS setting on a to-be-removed port during flex port. 372 * 373 * \param [in] unit Unit Number. 374 * \param [in] port Port id. 375 * 376 * \retval SHR_E_NONE No errors. 377 * \retval !SHR_E_NONE Failure. 378 */ 379 typedef int (*qos_port_detach_f)( 380 int unit, 381 bcm_port_t port); 382 383 /*! 384 * \brief Initialize chip-specific QoS control info. 385 * 386 * \param [in] unit Unit Number. 387 * \param [in|out] ctrl_info QoS control info pointer. 388 * 389 * \retval SHR_E_NONE No errors. 390 * \retval !SHR_E_NONE Failure. 391 */ 392 typedef int (*qos_ctrl_info_init_f)( 393 int unit, 394 const bcmint_qos_ctrl_info_t **ctrl_info); 395 396 /*! 397 * \brief Get mapping pointer for Vxlan G/BUM flags remarking. 398 * 399 * \param [in] unit Unit Number. 400 * \param [in] g_ena Enable G flag remarking. 401 * \param [in] bum_ena Enable BUM flag remarking. 402 * \param [out] ptr Mapping pointer. 403 * 404 * \retval SHR_E_NONE No errors. 405 * \retval !SHR_E_NONE Failure. 406 */ 407 typedef int (*qos_vxlan_flags_map_ptr_get_f)( 408 int unit, 409 int g_ena, 410 int bum_ena, 411 int *ptr); 412 413 /*! 414 * \brief Qos driver structure. 415 */ 416 typedef struct mbcm_ltsw_qos_drv_s { 417 418 /*! Initialize QoS module. */ 419 qos_init_f qos_init; 420 421 /*! Detach QoS module. */ 422 qos_detach_f qos_detach; 423 424 /*! Clear all QoS tables. */ 425 qos_table_clear_all_f qos_table_clear_all; 426 427 /*! Set QoS controls. */ 428 qos_control_set_f qos_control_set; 429 430 /*! Get QoS controls. */ 431 qos_control_get_f qos_control_get; 432 433 /*! Create a QoS map. */ 434 qos_map_create_f qos_map_create; 435 436 /*! Destroy a QoS map. */ 437 qos_map_destroy_f qos_map_destroy; 438 439 /*! Add an entry into a QoS map. */ 440 qos_map_add_f qos_map_add; 441 442 /*! Delete an entry from a QoS map. */ 443 qos_map_delete_f qos_map_delete; 444 445 /*! Attach QoS map to an object(Gport). */ 446 qos_port_map_set_f qos_port_map_set; 447 448 /*! Retrieve the configured QoS mapping matching a type for the given GPORT. */ 449 qos_port_map_type_get_f qos_port_map_type_get; 450 451 /*! Get an entire QoS mapping for the given QoS Map ID. */ 452 qos_map_multi_get_f qos_map_multi_get; 453 454 /*! Get the list of all QoS Map IDs. */ 455 qos_multi_get_f qos_multi_get; 456 457 /*! Set ingress and egress VLAN port based related QoS setting. */ 458 qos_port_vlan_map_set_f qos_port_vlan_map_set; 459 460 /*! Get ingress and egress VLAN port based related QoS setting. */ 461 qos_port_vlan_map_get_f qos_port_vlan_map_get; 462 463 /*! Resolve QoS map id into mapping pointer and QoS map type. */ 464 qos_map_id_resolve_f qos_map_id_resolve; 465 466 /*! Construct QoS map id with mapping pointer and QoS map type. */ 467 qos_map_id_construct_f qos_map_id_construct; 468 469 /*! Get default mapping pointer. */ 470 qos_default_ptr_get_f qos_default_ptr_get; 471 472 /*! Get dummy operation pointer. The pointer indicates QoS remarking will do nothing with int_cn/int_pri/cng. */ 473 qos_dummy_ptr_get_f qos_dummy_ptr_get; 474 475 /*! Dump QoS module software bookkeepings. */ 476 qos_sw_dump_f qos_sw_dump; 477 478 /*! Set egress L2 map on a port based on egress VLAN priority source. */ 479 qos_port_egr_l2_map_set_f qos_port_egr_l2_map_set; 480 481 /*! Get egress VLAN priority source on a port based on egress L2 map. */ 482 qos_port_egr_l2_map_get_f qos_port_egr_l2_map_get; 483 484 /*! Restore default QoS setting on a new port during flex port. */ 485 qos_port_attach_f qos_port_attach; 486 487 /*! Clear default QoS setting on a to-be-removed port during flex port. */ 488 qos_port_detach_f qos_port_detach; 489 490 /*! Initialize chip-specific QoS control info. */ 491 qos_ctrl_info_init_f qos_ctrl_info_init; 492 493 /*! Get mapping pointer for Vxlan G/BUM flags remarking. */ 494 qos_vxlan_flags_map_ptr_get_f qos_vxlan_flags_map_ptr_get; 495 496 } mbcm_ltsw_qos_drv_t; 497 498 /*! 499 * \brief Set the QOS driver of the device. 500 * 501 * \param [in] unit Unit Number. 502 * \param [in] drv Qos driver to set. 503 * 504 * \retval SHR_E_NONE No errors. 505 * \retval !SHR_E_NONE Failure. 506 */ 507 extern int 508 mbcm_ltsw_qos_drv_set( 509 int unit, 510 mbcm_ltsw_qos_drv_t *drv); 511 512 /*! 513 * \brief Initialize QoS module. 514 * 515 * \param [in] unit Unit Number. 516 * 517 * \retval SHR_E_NONE No errors. 518 * \retval !SHR_E_NONE Failure. 519 */ 520 extern int 521 mbcm_ltsw_qos_init(int unit); 522 523 /*! 524 * \brief Detach QoS module. 525 * 526 * \param [in] unit Unit Number. 527 * 528 * \retval SHR_E_NONE No errors. 529 * \retval !SHR_E_NONE Failure. 530 */ 531 extern int 532 mbcm_ltsw_qos_detach(int unit); 533 534 /*! 535 * \brief Clear all QoS tables. 536 * 537 * \param [in] unit Unit Number. 538 * 539 * \retval SHR_E_NONE No errors. 540 * \retval !SHR_E_NONE Failure. 541 */ 542 extern int 543 mbcm_ltsw_qos_table_clear_all(int unit); 544 545 /*! 546 * \brief Set QoS controls. 547 * 548 * \param [in] unit Unit Number. 549 * \param [in] control The desired configuration parameter to modify. 550 * \param [in] value The value with which to set the parameter. 551 * 552 * \retval SHR_E_NONE No errors. 553 * \retval !SHR_E_NONE Failure. 554 */ 555 extern int 556 mbcm_ltsw_qos_control_set( 557 int unit, 558 bcmi_ltsw_qos_control_t control, 559 uint32_t value); 560 561 /*! 562 * \brief Get QoS controls. 563 * 564 * \param [in] unit Unit Number. 565 * \param [in] control The desired configuration parameter to retrieve. 566 * \param [out] value Pointer to where the retrieved value will be written. 567 * 568 * \retval SHR_E_NONE No errors. 569 * \retval !SHR_E_NONE Failure. 570 */ 571 extern int 572 mbcm_ltsw_qos_control_get( 573 int unit, 574 bcmi_ltsw_qos_control_t control, 575 uint32_t *value); 576 577 /*! 578 * \brief Create a QoS map. 579 * 580 * \param [in] unit Unit Number. 581 * \param [in] flags QoS flags. 582 * \param [out] map_id QoS map id. 583 * 584 * \retval SHR_E_NONE No errors. 585 * \retval !SHR_E_NONE Failure. 586 */ 587 extern int 588 mbcm_ltsw_qos_map_create( 589 int unit, 590 uint32_t flags, 591 int *map_id); 592 593 /*! 594 * \brief Destroy a QoS map. 595 * 596 * \param [in] unit Unit Number. 597 * \param [in] map_id QoS map id. 598 * 599 * \retval SHR_E_NONE No errors. 600 * \retval !SHR_E_NONE Failure. 601 */ 602 extern int 603 mbcm_ltsw_qos_map_destroy( 604 int unit, 605 int map_id); 606 607 /*! 608 * \brief Add an entry into a QoS map. 609 * 610 * \param [in] unit Unit Number. 611 * \param [in] flags QoS flags. 612 * \param [in] map QoS map. 613 * \param [in] map_id QoS map id. 614 * 615 * \retval SHR_E_NONE No errors. 616 * \retval !SHR_E_NONE Failure. 617 */ 618 extern int 619 mbcm_ltsw_qos_map_add( 620 int unit, 621 uint32_t flags, 622 bcm_qos_map_t *map, 623 int map_id); 624 625 /*! 626 * \brief Delete an entry from a QoS map. 627 * 628 * \param [in] unit Unit Number. 629 * \param [in] flags QoS flags. 630 * \param [in] map QoS map. 631 * \param [in] map_id QoS map id. 632 * 633 * \retval SHR_E_NONE No errors. 634 * \retval !SHR_E_NONE Failure. 635 */ 636 extern int 637 mbcm_ltsw_qos_map_delete( 638 int unit, 639 uint32_t flags, 640 bcm_qos_map_t *map, 641 int map_id); 642 643 /*! 644 * \brief Attach QoS map to an object(Gport). 645 * 646 * \param [in] unit Unit Number. 647 * \param [in] port Port/Gport id. 648 * \param [in] ing_map Ingress map id. 649 * \param [in] egr_map Egress map id. 650 * 651 * \retval SHR_E_NONE No errors. 652 * \retval !SHR_E_NONE Failure. 653 */ 654 extern int 655 mbcm_ltsw_qos_port_map_set( 656 int unit, 657 bcm_gport_t port, 658 int ing_map, 659 int egr_map); 660 661 /*! 662 * \brief Retrieve the configured QoS mapping matching a type for the given GPORT. 663 * 664 * \param [in] unit Unit Number. 665 * \param [in] port Port/Gport id. 666 * \param [in] flags QoS flags. 667 * \param [out] map_id QoS map id. 668 * 669 * \retval SHR_E_NONE No errors. 670 * \retval !SHR_E_NONE Failure. 671 */ 672 extern int 673 mbcm_ltsw_qos_port_map_type_get( 674 int unit, 675 bcm_gport_t port, 676 uint32_t flags, 677 int *map_id); 678 679 /*! 680 * \brief Get an entire QoS mapping for the given QoS Map ID. 681 * 682 * \param [in] unit Unit Number. 683 * \param [in] flags QoS flags. 684 * \param [in] map_id QoS map id. 685 * \param [in] array_size Size of allocated entries in array. 686 * \param [out] array QoS map array. 687 * \param [out] count Actual number of QoS map entries. 688 * 689 * \retval SHR_E_NONE No errors. 690 * \retval !SHR_E_NONE Failure. 691 */ 692 extern int 693 mbcm_ltsw_qos_map_multi_get( 694 int unit, 695 uint32_t flags, 696 int map_id, 697 int array_size, 698 bcm_qos_map_t *array, 699 int *count); 700 701 /*! 702 * \brief Get the list of all QoS Map IDs. 703 * 704 * \param [in] unit Unit Number. 705 * \param [in] array_size Size of allocated entries in map_id array. 706 * \param [out] map_id QoS map id array. 707 * \param [out] flags QoS flags array. 708 * \param [out] count Actual number of QoS map id. 709 * 710 * \retval SHR_E_NONE No errors. 711 * \retval !SHR_E_NONE Failure. 712 */ 713 extern int 714 mbcm_ltsw_qos_multi_get( 715 int unit, 716 int array_size, 717 int *map_id, 718 int *flags, 719 int *count); 720 721 /*! 722 * \brief Set ingress and egress VLAN port based related QoS setting. 723 * 724 * \param [in] unit Unit Number. 725 * \param [in] port Ingress port. 726 * \param [in] vid Vlan domain. 727 * \param [in] ing_map Ingress QoS id. 728 * \param [in] egr_map Egress QoS id. 729 * 730 * \retval SHR_E_NONE No errors. 731 * \retval !SHR_E_NONE Failure. 732 */ 733 extern int 734 mbcm_ltsw_qos_port_vlan_map_set( 735 int unit, 736 bcm_port_t port, 737 bcm_vlan_t vid, 738 int ing_map, 739 int egr_map); 740 741 /*! 742 * \brief Get ingress and egress VLAN port based related QoS setting. 743 * 744 * \param [in] unit Unit Number. 745 * \param [in] port Ingress port. 746 * \param [in] vid Vlan domain. 747 * \param [out] ing_map Ingress QoS id. 748 * \param [out] egr_map Egress QoS id. 749 * 750 * \retval SHR_E_NONE No errors. 751 * \retval !SHR_E_NONE Failure. 752 */ 753 extern int 754 mbcm_ltsw_qos_port_vlan_map_get( 755 int unit, 756 bcm_port_t port, 757 bcm_vlan_t vid, 758 int *ing_map, 759 int *egr_map); 760 761 /*! 762 * \brief Resolve QoS map id into mapping pointer and QoS map type. 763 * 764 * \param [in] unit Unit Number. 765 * \param [in] map_id QoS map id. 766 * \param [out] type QoS map type. NULL indicates not care. 767 * \param [out] ptr Mapping pointer. NULL indicates not care. 768 * 769 * \retval SHR_E_NONE No errors. 770 * \retval !SHR_E_NONE Failure. 771 */ 772 extern int 773 mbcm_ltsw_qos_map_id_resolve( 774 int unit, 775 int map_id, 776 bcmi_ltsw_qos_map_type_t *type, 777 int *ptr); 778 779 /*! 780 * \brief Construct QoS map id with mapping pointer and QoS map type. 781 * 782 * \param [in] unit Unit Number. 783 * \param [in] ptr Mapping pointer. 784 * \param [in] type QoS map type. 785 * \param [out] map_id QoS map id. 786 * 787 * \retval SHR_E_NONE No errors. 788 * \retval !SHR_E_NONE Failure. 789 */ 790 extern int 791 mbcm_ltsw_qos_map_id_construct( 792 int unit, 793 int ptr, 794 bcmi_ltsw_qos_map_type_t type, 795 int *map_id); 796 797 /*! 798 * \brief Get default mapping pointer. 799 * 800 * \param [in] unit Unit Number. 801 * \param [in] type QoS map type. 802 * \param [out] ptr Mapping pointer. 803 * 804 * \retval SHR_E_NONE No errors. 805 * \retval !SHR_E_NONE Failure. 806 */ 807 extern int 808 mbcm_ltsw_qos_default_ptr_get( 809 int unit, 810 bcmi_ltsw_qos_map_type_t type, 811 int *ptr); 812 813 /*! 814 * \brief Get dummy operation pointer. The pointer indicates QoS remarking will do nothing with int_cn/int_pri/cng. 815 * 816 * \param [in] unit Unit Number. 817 * \param [in] type QoS map type. 818 * \param [out] ptr Mapping pointer. 819 * 820 * \retval SHR_E_NONE No errors. 821 * \retval !SHR_E_NONE Failure. 822 */ 823 extern int 824 mbcm_ltsw_qos_dummy_ptr_get( 825 int unit, 826 bcmi_ltsw_qos_map_type_t type, 827 int *ptr); 828 829 /*! 830 * \brief Dump QoS module software bookkeepings. 831 * 832 * \param [in] unit Unit Number. 833 */ 834 extern void 835 mbcm_ltsw_qos_sw_dump(int unit); 836 837 /*! 838 * \brief Set egress L2 map on a port based on egress VLAN priority source. 839 * 840 * \param [in] unit Unit Number. 841 * \param [in] port Port id. 842 * \param [in] src Source of egress VLAN priority. 843 * 844 * \retval SHR_E_NONE No errors. 845 * \retval !SHR_E_NONE Failure. 846 */ 847 extern int 848 mbcm_ltsw_qos_port_egr_l2_map_set( 849 int unit, 850 bcm_port_t port, 851 int src); 852 853 /*! 854 * \brief Get egress VLAN priority source on a port based on egress L2 map. 855 * 856 * \param [in] unit Unit Number. 857 * \param [in] port Port id. 858 * \param [out] src Source of egress VLAN priority. 859 * 860 * \retval SHR_E_NONE No errors. 861 * \retval !SHR_E_NONE Failure. 862 */ 863 extern int 864 mbcm_ltsw_qos_port_egr_l2_map_get( 865 int unit, 866 bcm_port_t port, 867 int *src); 868 869 /*! 870 * \brief Restore default QoS setting on a new port during flex port. 871 * 872 * \param [in] unit Unit Number. 873 * \param [in] port Port id. 874 * 875 * \retval SHR_E_NONE No errors. 876 * \retval !SHR_E_NONE Failure. 877 */ 878 extern int 879 mbcm_ltsw_qos_port_attach( 880 int unit, 881 bcm_port_t port); 882 883 /*! 884 * \brief Clear default QoS setting on a to-be-removed port during flex port. 885 * 886 * \param [in] unit Unit Number. 887 * \param [in] port Port id. 888 * 889 * \retval SHR_E_NONE No errors. 890 * \retval !SHR_E_NONE Failure. 891 */ 892 extern int 893 mbcm_ltsw_qos_port_detach( 894 int unit, 895 bcm_port_t port); 896 897 /*! 898 * \brief Initialize chip-specific QoS control info. 899 * 900 * \param [in] unit Unit Number. 901 * \param [in|out] ctrl_info QoS control info pointer. 902 * 903 * \retval SHR_E_NONE No errors. 904 * \retval !SHR_E_NONE Failure. 905 */ 906 extern int 907 mbcm_ltsw_qos_ctrl_info_init( 908 int unit, 909 const bcmint_qos_ctrl_info_t **ctrl_info); 910 911 /*! 912 * \brief Get mapping pointer for Vxlan G/BUM flags remarking. 913 * 914 * \param [in] unit Unit Number. 915 * \param [in] g_ena Enable G flag remarking. 916 * \param [in] bum_ena Enable BUM flag remarking. 917 * \param [out] ptr Mapping pointer. 918 * 919 * \retval SHR_E_NONE No errors. 920 * \retval !SHR_E_NONE Failure. 921 */ 922 extern int 923 mbcm_ltsw_qos_vxlan_flags_map_ptr_get( 924 int unit, 925 int g_ena, 926 int bum_ena, 927 int *ptr); 928 929 #endif /* BCMINT_LTSW_MBCM_QOS_H */