From e8cb3eb35527ff218aa22a8f6a8defe302459b91 Mon Sep 17 00:00:00 2001 From: Bhagyashree Rane Date: Wed, 6 Nov 2024 15:45:32 -0800 Subject: [PATCH 1/2] gr2_nhop_hmap: Fix gr2 mac address dictionary --- tests/ipfwd/test_nhop_group.py | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/tests/ipfwd/test_nhop_group.py b/tests/ipfwd/test_nhop_group.py index 31711c18098..3662e58f3ce 100644 --- a/tests/ipfwd/test_nhop_group.py +++ b/tests/ipfwd/test_nhop_group.py @@ -758,6 +758,36 @@ def built_and_send_tcp_ip_packet(): 45: 'c0:ff:ee:00:00:12', 46: 'c0:ff:ee:00:00:0e', 47: 'c0:ff:ee:00:00:0f', 48: 'c0:ff:ee:00:00:0b', 49: 'c0:ff:ee:00:00:12'} + gr2_asic_flow_map = {0: 'c0:ff:ee:00:00:11', 1: 'c0:ff:ee:00:00:12', + 2: 'c0:ff:ee:00:00:0c', + 3: 'c0:ff:ee:00:00:0f', 4: 'c0:ff:ee:00:00:0b', + 5: 'c0:ff:ee:00:00:10', 6: 'c0:ff:ee:00:00:12', + 7: 'c0:ff:ee:00:00:12', 8: 'c0:ff:ee:00:00:0b', + 9: 'c0:ff:ee:00:00:0e', + 10: 'c0:ff:ee:00:00:10', 11: 'c0:ff:ee:00:00:0c', + 12: 'c0:ff:ee:00:00:0c', 13: 'c0:ff:ee:00:00:11', + 14: 'c0:ff:ee:00:00:0c', + 15: 'c0:ff:ee:00:00:0f', 16: 'c0:ff:ee:00:00:10', + 17: 'c0:ff:ee:00:00:0b', 18: 'c0:ff:ee:00:00:10', + 19: 'c0:ff:ee:00:00:0f', 20: 'c0:ff:ee:00:00:0b', + 21: 'c0:ff:ee:00:00:12', 22: 'c0:ff:ee:00:00:0f', + 23: 'c0:ff:ee:00:00:0d', 24: 'c0:ff:ee:00:00:0c', + 25: 'c0:ff:ee:00:00:0c', + 26: 'c0:ff:ee:00:00:10', 27: 'c0:ff:ee:00:00:0d', + 28: 'c0:ff:ee:00:00:11', 29: 'c0:ff:ee:00:00:12', + 30: 'c0:ff:ee:00:00:0e', 31: 'c0:ff:ee:00:00:11', + 32: 'c0:ff:ee:00:00:0e', 33: 'c0:ff:ee:00:00:0b', + 34: 'c0:ff:ee:00:00:0e', + 35: 'c0:ff:ee:00:00:0b', 36: 'c0:ff:ee:00:00:11', + 37: 'c0:ff:ee:00:00:11', 38: 'c0:ff:ee:00:00:10', + 39: 'c0:ff:ee:00:00:12', + 40: 'c0:ff:ee:00:00:11', 41: 'c0:ff:ee:00:00:0f', + 42: 'c0:ff:ee:00:00:11', 43: 'c0:ff:ee:00:00:0f', + 44: 'c0:ff:ee:00:00:0f', 45: 'c0:ff:ee:00:00:0b', + 46: 'c0:ff:ee:00:00:0f', + 47: 'c0:ff:ee:00:00:0d', 48: 'c0:ff:ee:00:00:0e', + 49: 'c0:ff:ee:00:00:0e'} + # Make sure a given flow always hash to same nexthop/neighbor. This is done to try to find issue # where SAI vendor changes Hash Function across SAI releases. Please note this will not catch the issue every time # as there is always probability even after change of Hash Function same nexthop/neighbor is selected. @@ -768,7 +798,7 @@ def built_and_send_tcp_ip_packet(): "th4": th_asic_flow_map, "td3": td3_asic_flow_map, "gr": gr_asic_flow_map, "spc1": spc_asic_flow_map, "spc2": spc_asic_flow_map, "spc3": spc_asic_flow_map, - "spc4": spc_asic_flow_map} + "spc4": spc_asic_flow_map, "gr2": gr2_asic_flow_map} vendor = duthost.facts["asic_type"] hostvars = duthost.host.options['variable_manager']._hostvars[duthost.hostname] From b9e86ee5f9d594afd8319d97f9258760a1b1ba7b Mon Sep 17 00:00:00 2001 From: Bhagyashree Rane Date: Thu, 7 Nov 2024 13:06:16 -0800 Subject: [PATCH 2/2] nhop_group: Fix expected mac address dictionary for Cisco 8122 --- tests/ipfwd/test_nhop_group.py | 56 +++++++++++++++++----------------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/tests/ipfwd/test_nhop_group.py b/tests/ipfwd/test_nhop_group.py index 3662e58f3ce..abfa90d5413 100644 --- a/tests/ipfwd/test_nhop_group.py +++ b/tests/ipfwd/test_nhop_group.py @@ -759,34 +759,34 @@ def built_and_send_tcp_ip_packet(): 48: 'c0:ff:ee:00:00:0b', 49: 'c0:ff:ee:00:00:12'} gr2_asic_flow_map = {0: 'c0:ff:ee:00:00:11', 1: 'c0:ff:ee:00:00:12', - 2: 'c0:ff:ee:00:00:0c', - 3: 'c0:ff:ee:00:00:0f', 4: 'c0:ff:ee:00:00:0b', - 5: 'c0:ff:ee:00:00:10', 6: 'c0:ff:ee:00:00:12', - 7: 'c0:ff:ee:00:00:12', 8: 'c0:ff:ee:00:00:0b', - 9: 'c0:ff:ee:00:00:0e', - 10: 'c0:ff:ee:00:00:10', 11: 'c0:ff:ee:00:00:0c', - 12: 'c0:ff:ee:00:00:0c', 13: 'c0:ff:ee:00:00:11', - 14: 'c0:ff:ee:00:00:0c', - 15: 'c0:ff:ee:00:00:0f', 16: 'c0:ff:ee:00:00:10', - 17: 'c0:ff:ee:00:00:0b', 18: 'c0:ff:ee:00:00:10', - 19: 'c0:ff:ee:00:00:0f', 20: 'c0:ff:ee:00:00:0b', - 21: 'c0:ff:ee:00:00:12', 22: 'c0:ff:ee:00:00:0f', - 23: 'c0:ff:ee:00:00:0d', 24: 'c0:ff:ee:00:00:0c', - 25: 'c0:ff:ee:00:00:0c', - 26: 'c0:ff:ee:00:00:10', 27: 'c0:ff:ee:00:00:0d', - 28: 'c0:ff:ee:00:00:11', 29: 'c0:ff:ee:00:00:12', - 30: 'c0:ff:ee:00:00:0e', 31: 'c0:ff:ee:00:00:11', - 32: 'c0:ff:ee:00:00:0e', 33: 'c0:ff:ee:00:00:0b', - 34: 'c0:ff:ee:00:00:0e', - 35: 'c0:ff:ee:00:00:0b', 36: 'c0:ff:ee:00:00:11', - 37: 'c0:ff:ee:00:00:11', 38: 'c0:ff:ee:00:00:10', - 39: 'c0:ff:ee:00:00:12', - 40: 'c0:ff:ee:00:00:11', 41: 'c0:ff:ee:00:00:0f', - 42: 'c0:ff:ee:00:00:11', 43: 'c0:ff:ee:00:00:0f', - 44: 'c0:ff:ee:00:00:0f', 45: 'c0:ff:ee:00:00:0b', - 46: 'c0:ff:ee:00:00:0f', - 47: 'c0:ff:ee:00:00:0d', 48: 'c0:ff:ee:00:00:0e', - 49: 'c0:ff:ee:00:00:0e'} + 2: 'c0:ff:ee:00:00:0c', + 3: 'c0:ff:ee:00:00:0f', 4: 'c0:ff:ee:00:00:0b', + 5: 'c0:ff:ee:00:00:10', 6: 'c0:ff:ee:00:00:12', + 7: 'c0:ff:ee:00:00:12', 8: 'c0:ff:ee:00:00:0b', + 9: 'c0:ff:ee:00:00:0e', + 10: 'c0:ff:ee:00:00:10', 11: 'c0:ff:ee:00:00:0c', + 12: 'c0:ff:ee:00:00:0c', 13: 'c0:ff:ee:00:00:11', + 14: 'c0:ff:ee:00:00:0c', + 15: 'c0:ff:ee:00:00:0f', 16: 'c0:ff:ee:00:00:10', + 17: 'c0:ff:ee:00:00:0b', 18: 'c0:ff:ee:00:00:10', + 19: 'c0:ff:ee:00:00:0f', 20: 'c0:ff:ee:00:00:0b', + 21: 'c0:ff:ee:00:00:12', 22: 'c0:ff:ee:00:00:0f', + 23: 'c0:ff:ee:00:00:0d', 24: 'c0:ff:ee:00:00:0c', + 25: 'c0:ff:ee:00:00:0c', + 26: 'c0:ff:ee:00:00:10', 27: 'c0:ff:ee:00:00:0d', + 28: 'c0:ff:ee:00:00:11', 29: 'c0:ff:ee:00:00:12', + 30: 'c0:ff:ee:00:00:0e', 31: 'c0:ff:ee:00:00:11', + 32: 'c0:ff:ee:00:00:0e', 33: 'c0:ff:ee:00:00:0b', + 34: 'c0:ff:ee:00:00:0e', + 35: 'c0:ff:ee:00:00:0b', 36: 'c0:ff:ee:00:00:11', + 37: 'c0:ff:ee:00:00:11', 38: 'c0:ff:ee:00:00:10', + 39: 'c0:ff:ee:00:00:12', + 40: 'c0:ff:ee:00:00:11', 41: 'c0:ff:ee:00:00:0f', + 42: 'c0:ff:ee:00:00:11', 43: 'c0:ff:ee:00:00:0f', + 44: 'c0:ff:ee:00:00:0f', 45: 'c0:ff:ee:00:00:0b', + 46: 'c0:ff:ee:00:00:0f', + 47: 'c0:ff:ee:00:00:0d', 48: 'c0:ff:ee:00:00:0e', + 49: 'c0:ff:ee:00:00:0e'} # Make sure a given flow always hash to same nexthop/neighbor. This is done to try to find issue # where SAI vendor changes Hash Function across SAI releases. Please note this will not catch the issue every time