Topic Text   Topic Comments (1)   Topic Properties   Topic Information thoang@len...
Topic title: Multi--level ECMP code change Thursday September 14, 2017 07:02:03

Download topic text | View in monospace font | Tab width set to 8 (change to 4)

Files in topic:  
[Jump to] /vobs/nosx/zebos/hsl/broadcom/bcm/hsl_bcm_sdk_l3.c  /main/r_nosx_10.x.0.0_int/submit_nosx_9491/0   {+245,-22}
[Jump to] /vobs/nosx/zebos/hsl/broadcom/hsl_bcm_wrapper.h  /main/r_nosx_10.x.0.0_int/submit_nosx_9491/0   {+36,-0}

[Add General Comment] to topic.

File /vobs/nosx/zebos/hsl/broadcom/bcm/hsl_bcm_sdk_l3.c (Revision /main/r_nosx_10.x.0.0_int/submit_nosx_9491/0) [Add File Comment] [Top] [>>]
 
Line 23 Line 23
 
 
Line 416 Line 415
415 /*--------------------------------------------------
416 * Note about current hsl_bcm_l3_egress_multipath_xxx APIs:
417 * - These APIs should be used only for underlay nexthop.
418
419 * New hsl_bcm_l3_egress_ecmp_xxx APIs:
420 * - These APIs should be used for newer ASIC and should work for
421 * both underlay and overlay networks and new new features such as
422 * multi-level ECMP, etc.
423 *
424 * This is designed this way to minimize impact to the applications
425 * which currently use hsl_bcm_l3_egress_multipath_xxx() and need
426 * only to work on underlay.
427 *
428 * When flag HAVE_MULTI_LEVEL_ECMP is defined, the current APIs
429 * xxx_multipath_xxx() call xxx_ecmp_xxx() APIs with BCM_L3_ECMP_UNDERLAY.
430 *
431 *--------------------------------------------------
432 */
433
434 #if defined(HAVE_MULTI_LEVEL_ECMP)
435 int
436 hsl_bcm_l3_egress_ecmp_find(int intf_count, bcm_if_t *intf_array,
437 bcm_l3_egress_ecmp_t *ecmp_info)
438 {
439
440 int ret = 0, unit;
441 HSL_FN_ENTER();
442
443 HSL_BCM_UNIT_ITER(unit, hsl_max_bcm_unit)
444 {
445 ret = bcm_l3_egress_ecmp_find(unit, intf_count, intf_array, ecmp_info);
446 if (ret != BCM_E_NONE) {
447 HSL_FN_EXIT(ret);
448 }
449 }
450 HSL_FN_EXIT(ret);
451 }
452
453 int
454 hsl_bcm_l3_egress_ecmp_create (int intf_count,
455 bcm_if_t *intf_array,
456 bcm_l3_egress_ecmp_t *l3_ecmp)
457 {
458 int ret = 0, unit;
459 HSL_FN_ENTER();
460
461 HSL_BCM_UNIT_ITER(unit, hsl_max_bcm_unit)
462 {
463 ret = bcm_l3_egress_ecmp_create(unit, l3_ecmp, intf_count,
464 intf_array);
465 if (ret != BCM_E_NONE)
466 HSL_FN_EXIT(ret);
467 }
468
469 HSL_FN_EXIT(ret);
470 }
471
472 int
473 hsl_bcm_l3_egress_ecmp_get (bcm_l3_egress_ecmp_t *ecmp,
474 int intf_size,
475 bcm_if_t *intf_array,
476 int *intf_count)
477 {
478 int ret = 0, unit;
479 HSL_FN_ENTER();
480
481 HSL_BCM_UNIT_ITER(unit, hsl_max_bcm_unit)
482 {
483 ret = bcm_l3_egress_ecmp_get(unit, ecmp, intf_size, intf_array, intf_count);
484 if (ret != BCM_E_NONE)
485 HSL_FN_EXIT(ret);
486 }
487 HSL_FN_EXIT(ret);
488 }
489
490 int
491 hsl_bcm_l3_egress_ecmp_add (bcm_l3_egress_ecmp_t *ecmp, bcm_if_t intf)
492 {
493 int ret = 0, unit;
494 HSL_FN_ENTER();
495
496 HSL_BCM_UNIT_ITER(unit, hsl_max_bcm_unit)
497 {
498 ret = bcm_l3_egress_ecmp_add(unit, ecmp, intf);
499 if (ret != BCM_E_NONE)
500 HSL_FN_EXIT(ret);
501 }
502
503 HSL_FN_EXIT(ret);
504 }
505
506 int
507 hsl_bcm_l3_egress_ecmp_delete(bcm_l3_egress_ecmp_t *ecmp, bcm_if_t intf)
508 {
509 int ret = 0, unit;
510 HSL_FN_ENTER();
511
512 HSL_BCM_UNIT_ITER(unit, hsl_max_bcm_unit)
513 {
514 ret = bcm_l3_egress_ecmp_delete(unit, ecmp, intf);
515 if (ret != BCM_E_NONE)
516 HSL_FN_EXIT(ret);
517 }
518
519 HSL_FN_EXIT(ret);
520 }
521
522 int
523 hsl_bcm_l3_egress_ecmp_destroy(bcm_l3_egress_ecmp_t *ecmp)
524 {
525 int ret = 0, unit;
526 HSL_FN_ENTER();
527
528 HSL_BCM_UNIT_ITER(unit, hsl_max_bcm_unit)
529 {
530 ret = bcm_l3_egress_ecmp_destroy(unit, ecmp);
531 if (ret != BCM_E_NONE)
532 HSL_FN_EXIT(ret);
533 }
534
535 HSL_FN_EXIT(ret);
536
537 }
538
539 #endif /* defined(HAVE_MULTI_LEVEL_ECMP) */
 
 
Line 421 Line 546
421 int ret = 0, unit; 546 int ret = 0;
422 HSL_FN_ENTER(); 547 HSL_FN_ENTER();
548
549 #if defined(HAVE_MULTI_LEVEL_ECMP)
550
551 bcm_l3_egress_ecmp_t ecmp_info;
552 bcm_l3_egress_ecmp_t_init(&ecmp_info);
553 ecmp_info.ecmp_group_flags = BCM_L3_ECMP_UNDERLAY;
554
555 ret = hsl_bcm_l3_egress_ecmp_find(intf_count, intf_array, &ecmp_info);
556 if (ret == BCM_E_NONE && mpintf) {
557 *mpintf = ecmp_info.ecmp_intf;
558 }
559
560 #else /* defined(HAVE_MULTI_LEVEL_ECMP) */
561
562 int unit = 0;
 
 
Line 427 Line 567
427 HSL_FN_EXIT(ret); 567 HSL_FN_EXIT(ret);
428 } 568 }
569
570 #endif /* defined(HAVE_MULTI_LEVEL_ECMP) */
 
 
Line 438 Line 581
438 int ret = 0, unit; 581 int ret = 0;
439 HSL_FN_ENTER(); 582 HSL_FN_ENTER();
440 HSL_BCM_UNIT_ITER(unit, hsl_max_bcm_unit) 583
441 { 584 #if defined(HAVE_MULTI_LEVEL_ECMP)
442 ret = bcm_l3_egress_multipath_create(unit, flags, intf_count, 585
443 intf_array, mpintf); 586 {
444 if (ret != BCM_E_NONE) 587 bcm_l3_egress_ecmp_t l3_ecmp;
445 HSL_FN_EXIT(ret); 588
446 } 589 bcm_l3_egress_ecmp_t_init(&l3_ecmp);
590 l3_ecmp.ecmp_group_flags = flags | BCM_L3_ECMP_UNDERLAY;
591
592 ret = hsl_bcm_l3_egress_ecmp_create(intf_count, intf_array, &l3_ecmp);
593 if (mpintf)
594 *mpintf = l3_ecmp.ecmp_intf;
595 }
596
597 #else /* defined(HAVE_MULTI_LEVEL_ECMP) */
598
599 int unit = 0;
600 HSL_BCM_UNIT_ITER(unit, hsl_max_bcm_unit)
601 {
602 ret = bcm_l3_egress_multipath_create(unit, flags, intf_count,
603 intf_array, mpintf);
604 if (ret != BCM_E_NONE)
605 HSL_FN_EXIT(ret);
606
607 }
608 #endif /* defined(HAVE_MULTI_LEVEL_ECMP) */
 
 
Line 456 Line 619
456 int ret = 0, unit; 619 int ret = 0;
457 HSL_FN_ENTER(); 620 HSL_FN_ENTER();
621
622 #if defined(HAVE_MULTI_LEVEL_ECMP)
623 bcm_l3_egress_ecmp_t ecmp;
624 bcm_l3_egress_ecmp_t_init(&ecmp);
625
626 ecmp.ecmp_intf = mpintf;
627 ecmp.ecmp_group_flags = BCM_L3_ECMP_UNDERLAY;
628
629 ret = hsl_bcm_l3_egress_ecmp_get(&ecmp, intf_size, intf_array, intf_count);
630
631 #else /* defined(HAVE_MULTI_LEVEL_ECMP) */
632 int unit = 0;
 
 
Line 465 Line 640
640 #endif /* defined(HAVE_MULTI_LEVEL_ECMP) */
 
 
Line 467 Line 644
 
 
Line 471 Line 649
471 int ret = 0, unit; 649 int ret = 0;
472 HSL_FN_ENTER(); 650 HSL_FN_ENTER();
651
652 #if defined(HAVE_MULTI_LEVEL_ECMP)
653 bcm_l3_egress_ecmp_t ecmp;
654 bcm_l3_egress_ecmp_t_init(&ecmp);
655
656 ecmp.ecmp_intf = mpintf;
657 ecmp.ecmp_group_flags = BCM_L3_ECMP_UNDERLAY;
658
659 ret = hsl_bcm_l3_egress_ecmp_add (&ecmp, intf);
660
661 #else /* defined(HAVE_MULTI_LEVEL_ECMP) */
662
663 int unit = 0;
 
 
Line 479 Line 670
670 #endif /* defined(HAVE_MULTI_LEVEL_ECMP) */
 
 
Line 485 Line 678
485 int ret = 0, unit; 678 int ret = 0;
486 HSL_FN_ENTER(); 679 HSL_FN_ENTER();
680
681 #if defined(HAVE_MULTI_LEVEL_ECMP)
682 bcm_l3_egress_ecmp_t ecmp;
683 bcm_l3_egress_ecmp_t_init(&ecmp);
684
685 ecmp.ecmp_intf = mpintf;
686 ecmp.ecmp_group_flags = BCM_L3_ECMP_UNDERLAY;
687
688 ret = hsl_bcm_l3_egress_ecmp_delete(&ecmp, intf);
689
690 #else /* defined(HAVE_MULTI_LEVEL_ECMP) */
691 int unit = 0;
 
 
Line 493 Line 698
698 #endif /* defined(HAVE_MULTI_LEVEL_ECMP) */
 
 
Line 499 Line 706
499 int ret = 0, unit; 706 int ret = 0;
500 HSL_FN_ENTER(); 707 HSL_FN_ENTER();
708
709 #if defined(HAVE_MULTI_LEVEL_ECMP)
710 bcm_l3_egress_ecmp_t ecmp;
711 bcm_l3_egress_ecmp_t_init(&ecmp);
712
713 ecmp.ecmp_intf = mpintf;
714 ecmp.ecmp_group_flags = BCM_L3_ECMP_UNDERLAY;
715
716 ret = hsl_bcm_l3_egress_ecmp_destroy(&ecmp);
717
718 #else /* defined(HAVE_MULTI_LEVEL_ECMP) */
719
720 int unit = 0;
 
 
Line 507 Line 727
727
728 #endif /* defined(HAVE_MULTI_LEVEL_ECMP) */
 
File /vobs/nosx/zebos/hsl/broadcom/hsl_bcm_wrapper.h (Revision /main/r_nosx_10.x.0.0_int/submit_nosx_9491/0) [Add File Comment] [<<] [Top]
 
Line 10 Line 10
10 * Revision submit_nosx_9491/1 2017/09/14 06:49:22 thoang3
11 * Add new hsl_bcm_l3_egress_ecmp_xxx APIs and change hsl_bcm_l3_egress_multipath_xxx APIs to use new xxx_ecmp_xxx APIs when MULTI_LEVEL_ECMP flag is defined.
12 *
 
 
Line 155 Line 158
158 /*
159 * This flag should be defined when VXLAN routing enabled and
160 * for all new platform.
161 #define HAVE_MULTI_LEVEL_ECMP (1)
162 */
 
 
Line 1457 Line 1466
1466
1467 #if defined(HAVE_MULTI_LEVEL_ECMP)
1468 int
1469 hsl_bcm_l3_egress_ecmp_find(int intf_count,
1470 bcm_if_t *intf_array,
1471 bcm_l3_egress_ecmp_t *ecmp_info);
1472
1473 int
1474 hsl_bcm_l3_egress_ecmp_create (int intf_count,
1475 bcm_if_t *intf_array,
1476 bcm_l3_egress_ecmp_t *l3_ecmp);
1477
1478 int
1479 hsl_bcm_l3_egress_ecmp_get (bcm_l3_egress_ecmp_t *ecmp,
1480 int intf_size,
1481 bcm_if_t *intf_array,
1482 int *intf_count);
1483 int
1484 hsl_bcm_l3_egress_ecmp_add (bcm_l3_egress_ecmp_t *ecmp, bcm_if_t intf);
1485
1486 int
1487 hsl_bcm_l3_egress_ecmp_delete(bcm_l3_egress_ecmp_t *ecmp, bcm_if_t intf);
1488
1489 int
1490 hsl_bcm_l3_egress_ecmp_destroy(bcm_l3_egress_ecmp_t *ecmp);
1491
1492 #endif /* defined(HAVE_MULTI_LEVEL_ECMP) */
 
  
Legend:
Removed 
Changed
 Added

[Add General Comment] to topic.