|
28 | 28 | logger = logging.getLogger(__name__)
|
29 | 29 |
|
30 | 30 | SONIC_RES_UPDATE_TIME = 50
|
31 |
| -CISCO_8000_ADD_NEIGHBORS = 3000 |
32 | 31 | ACL_TABLE_NAME = "DATAACL"
|
33 | 32 |
|
34 | 33 | RESTORE_CMDS = {"test_crm_route": [],
|
@@ -731,6 +730,14 @@ def test_crm_neighbor(duthosts, enum_rand_one_per_hwsku_frontend_hostname,
|
731 | 730 | enum_frontend_asic_index, crm_interface, ip_ver, neighbor, host):
|
732 | 731 | duthost = duthosts[enum_rand_one_per_hwsku_frontend_hostname]
|
733 | 732 | asichost = duthost.asic_instance(enum_frontend_asic_index)
|
| 733 | + get_nexthop_stats = "{db_cli} COUNTERS_DB HMGET CRM:STATS \ |
| 734 | + crm_stats_ipv{ip_ver}_nexthop_used \ |
| 735 | + crm_stats_ipv{ip_ver}_nexthop_available"\ |
| 736 | + .format(db_cli=asichost.sonic_db_cli, |
| 737 | + ip_ver=ip_ver) |
| 738 | + nexthop_used, nexthop_available = get_crm_stats(get_nexthop_stats, duthost) |
| 739 | + if is_cisco_device(duthost): |
| 740 | + CISCO_8000_ADD_NEIGHBORS = nexthop_available |
734 | 741 | asic_type = duthost.facts['asic_type']
|
735 | 742 | skip_stats_check = True if asic_type == "vs" else False
|
736 | 743 | RESTORE_CMDS["crm_threshold_name"] = "ipv{ip_ver}_neighbor".format(ip_ver=ip_ver)
|
@@ -778,7 +785,7 @@ def test_crm_neighbor(duthosts, enum_rand_one_per_hwsku_frontend_hostname,
|
778 | 785 | new_crm_stats_neighbor_used, new_crm_stats_neighbor_available = get_crm_stats(get_neighbor_stats, duthost)
|
779 | 786 | used_percent = get_used_percent(new_crm_stats_neighbor_used, new_crm_stats_neighbor_available)
|
780 | 787 | if used_percent < 1:
|
781 |
| - # Add 3k neighbors instead of 1 percentage for Cisco-8000 devices |
| 788 | + # Add neighbors amount dynamically instead of 1 percentage for Cisco-8000 devices |
782 | 789 | neighbours_num = CISCO_8000_ADD_NEIGHBORS if is_cisco_device(duthost) \
|
783 | 790 | else get_entries_num(new_crm_stats_neighbor_used, new_crm_stats_neighbor_available)
|
784 | 791 |
|
|
0 commit comments