Switchport Modes Port & Port Channel Config-Engine Support#17632
Switchport Modes Port & Port Channel Config-Engine Support#17632ridahanif96 wants to merge 11 commits intosonic-net:masterfrom
Conversation
|
I think we need to merge #13580 at first, and make sure PR checker can pass. |
Agree, waiting for PR#13580 to get merged so we can pass failures |
|
Could you merge the latest master? #Closed |
Let's me rerun this latest push to pass these failures. Thanks |
|
@ganglyu can you please review this PR. All failures has been passed. |
src/sonic-config-engine/minigraph.py
Outdated
| del pc_members[pc_mbr_del_key] | ||
|
|
||
| # set default port channel MTU as 9100 and admin status up and default TPID 0x8100 | ||
| # set default port channel MTU as 9100 and admin status up and default TPID 0x8100 |
| "mode": "routed" | ||
| } | ||
| } | ||
| } No newline at end of file |
| Ethernet124 101,102,103,104 fortyGigE0/124 on | ||
| # name lanes alias autoneg mode | ||
| Ethernet0 29,30,31,32 fortyGigE0/0 off routed | ||
| Ethernet4 25,26,27,28 fortyGigE0/4 off trunk |
| Ethernet0 29,30,31,32 fortyGigE0/0 off routed | ||
| Ethernet4 25,26,27,28 fortyGigE0/4 off trunk | ||
| Ethernet8 37,38,39,40 fortyGigE0/8 off trunk | ||
| Ethernet12 33,34,35,36 fortyGigE0/12 off trunk |
| Ethernet12 33,34,35,36 fortyGigE0/12 off trunk | ||
| Ethernet16 41,42,43,44 fortyGigE0/16 off trunk | ||
| Ethernet20 45,46,47,48 fortyGigE0/20 off trunk | ||
| Ethernet24 5,6,7,8 fortyGigE0/24 off trunk |
| Ethernet28 1,2,3,4 fortyGigE0/28 trunk | ||
| Ethernet32 9,10,11,12 fortyGigE0/32 trunk | ||
| Ethernet36 13,14,15,16 fortyGigE0/36 trunk | ||
| Ethernet40 21,22,23,24 fortyGigE0/40 trunk |
| Ethernet52 53,54,55,56 fortyGigE0/52 trunk | ||
| Ethernet56 61,62,63,64 fortyGigE0/56 trunk | ||
| Ethernet60 57,58,59,60 fortyGigE0/60 trunk | ||
| Ethernet64 65,66,67,68 fortyGigE0/64 trunk |
| Ethernet60 57,58,59,60 fortyGigE0/60 trunk | ||
| Ethernet64 65,66,67,68 fortyGigE0/64 trunk | ||
| Ethernet68 69,70,71,72 fortyGigE0/68 trunk | ||
| Ethernet72 77,78,79,80 fortyGigE0/72 trunk |
| Ethernet92 113,114,115,116 fortyGigE0/92 trunk | ||
| Ethernet96 121,122,123,124 fortyGigE0/96 trunk | ||
| Ethernet100 125,126,127,128 fortyGigE0/100 trunk | ||
| Ethernet104 85,86,87,88 fortyGigE0/104 trunk |
| ) | ||
|
|
||
| def test_minigraph_neighbor_interfaces(self): | ||
| argument = ['-m', self.sample_graph_simple_case, '-p', self.port_config, '-v', "PORT"] | ||
| output = self.run_script(argument) | ||
|
|
||
| self.maxDiff = None |
There was a problem hiding this comment.
why do you need this change?
There was a problem hiding this comment.
Removed this change
| ) | ||
| ) | ||
|
|
||
| def test_minigraph_neighbor_interfaces_config_db(self): | ||
| # test to check if PORT table is retrieved from config_db | ||
| argument = ['-m', self.sample_graph_simple_case, '-p', self.port_config, '-v', "PORT"] | ||
| output = self.run_script(argument) | ||
|
|
||
| self.maxDiff = None |
There was a problem hiding this comment.
why do you need this change?
There was a problem hiding this comment.
Removed this change
| ) | ||
| ) | ||
|
|
||
| def test_minigraph_extra_ethernet_interfaces(self, **kwargs): | ||
| graph_file = kwargs.get('graph_file', self.sample_graph_simple) | ||
| argument = ['-m', graph_file, '-p', self.port_config, '-v', "PORT"] | ||
| output = self.run_script(argument) | ||
| self.maxDiff = None |
There was a problem hiding this comment.
why do you need this change?
There was a problem hiding this comment.
Removed this change
| @@ -970,6 +969,7 @@ def test_minigraph_voq_inband_port(self): | |||
| argument = ["-j", self.macsec_profile, "-m", self.sample_graph_voq, "-p", self.voq_port_config, "--var-json", "PORT"] | |||
| output = self.run_script(argument) | |||
| output_dict = utils.to_dict(output.strip()) | |||
| self.maxDiff = None | |||
There was a problem hiding this comment.
Removed this change
| @@ -1084,52 +1085,51 @@ def test_minigraph_packet_chassis_400g_zr_port_config(self): | |||
| def test_minigraph_400g_to_100G_speed(self): | |||
| argument = ["-j", self.macsec_profile, "-m", self.voq_sample_masic_graph, "-p", self.voq_port_config_400g, "-n", "asic0", "-v", "PORT"] | |||
| output = self.run_script(argument) | |||
| self.maxDiff = None | |||
There was a problem hiding this comment.
Removed this change
| def test_minigraph_cisco_400g_to_100G_speed(self): | ||
| argument = ["-m", self.sample_cisco_100_graph, "-p", self.sample_cisco_port_config_400g, "-v", "PORT"] | ||
| self.assertTrue(self.yang.validate(argument)) | ||
| output = self.run_script(argument) | ||
| self.maxDiff = None |
There was a problem hiding this comment.
Removed this change
| def test_minigraph_cisco_400G_to_400G_speed(self): | ||
| argument = ["-m", self.sample_cisco_400_graph, "-p", self.sample_cisco_port_config_400g, "-v", "PORT"] | ||
| output = self.run_script(argument) | ||
| self.maxDiff = None |
There was a problem hiding this comment.
Removed this change
| @@ -1138,10 +1138,11 @@ def test_minigraph_cisco_400g_to_100G_speed_no_lane_change(self): | |||
| argument = ["-m", self.sample_cisco_8111_graph, "-p", self.sample_cisco_8111_port_config, "-v", "PORT"] | |||
| self.assertTrue(self.yang.validate(argument)) | |||
| output = self.run_script(argument) | |||
| self.maxDiff = None | |||
There was a problem hiding this comment.
Removed this change
| output = self.run_script(argument) | ||
| self.assertEqual( | ||
| utils.liststr_to_dict(output.strip()), | ||
|
|
| ) | ||
|
|
||
| def test_minigraph_neighbor_interfaces(self): | ||
| argument = ['-m', self.sample_graph_simple_case, '-p', self.port_config, '-v', "PORT"] | ||
| output = self.run_script(argument) | ||
|
|
||
| "'Ethernet116': {'alias': 'fortyGigE0/116', 'pfc_asym': 'off', 'lanes': '93,94,95,96', 'description': 'fortyGigE0/116', 'mtu': '9100', 'tpid': '0x8100', 'fec': 'rs', 'speed': '100000'}, " | ||
| "'Ethernet120': {'alias': 'fortyGigE0/120', 'pfc_asym': 'off', 'lanes': '97,98,99,100', 'description': 'fortyGigE0/120', 'mtu': '9100', 'tpid': '0x8100', 'fec': 'rs', 'speed': '100000'}, " | ||
| "'Ethernet124': {'alias': 'fortyGigE0/124', 'pfc_asym': 'off', 'lanes': '101,102,103,104', 'description': 'fortyGigE0/124', 'mtu': '9100', 'tpid': '0x8100', 'fec': 'rs', 'speed': '100000'}}" | ||
| utils.to_dict( |
| {'PortChannel0002': {'admin_status': 'up', 'min_links': '2', 'mtu': '9100', 'tpid': '0x8100', 'lacp_key': 'auto'}, | ||
| 'PortChannel4001': {'admin_status': 'up', 'min_links': '2', 'mtu': '9100', 'tpid': '0x8100', 'lacp_key': 'auto'}, | ||
| 'PortChannel4002': {'admin_status': 'up', 'min_links': '2', 'mtu': '9100', 'tpid': '0x8100', 'lacp_key': 'auto'}}) | ||
| {'PortChannel0002': {'admin_status': 'up', 'min_links': '2', 'mtu': '9100', 'tpid': '0x8100', 'mode': 'routed', 'lacp_key': 'auto' }, |
|
@venkatmahalingam can you please help review this PR, thanks |
|
@qiluo-msft can you pls help merge this PR. Thanks |
|
@qiluo-msft Can you please help merge this PR! Thanks |
|
@qiluo-msft @zhangyanzhao can you please help to merge this PR, thanks. |
|
@qiluo-msft can you also please help review this one, meanwhile i am fixing with other default disruptive change. |
src/sonic-config-engine/minigraph.py
Outdated
| for port in ports.values(): | ||
| port['mtu'] = '9100' | ||
| port['tpid'] = '0x8100' | ||
| # mode check for vlan membership in PORT table default mode is routed and for vlan membership it is trunk |
There was a problem hiding this comment.
mode check for vlan membership in PORT table default mode is routed and for vlan membership it is trunk
Since you can implement a conditional default value in relevant consuming component, no need to add explicit attribute during load_minigraph. We try to prevent any minigraph.py behavior change now. #Closed
There was a problem hiding this comment.
Here in minigraph .py, we implemented conditional default value in relevant consuming component.
Do we need to remove all this conditional change as well from minigraph.py
qiluo-msft
left a comment
There was a problem hiding this comment.
Block any minigraph.py behavior change. Feel free to reach me if any questions.
We have added conditional change in minigraph.py and relevant changes in other files, do we need to also remove this conditional change in minigraph.py |
| port['mtu'] = '9100' | ||
| port['tpid'] = '0x8100' | ||
|
|
||
| # asymmetric PFC is disabled by default |
There was a problem hiding this comment.
you do not need remove empty line.
Unblocked. However I see PR checkers fail. Is this PR still needed?
|
@ridahanif96 will double check and close this PR. |
This PR is not required any more as we will not be using sonic-config-Engine changes for Switchport Modes Port HLD. Therefore i am closing this PR. |
Why I did it
This PR is created in reference to add Switchport Modes Port & Port Channel config-engine changes
How I did it
I have added changes in sonic-config-engine related files.
Added support of mode attribute "routed or trunk" in minigraph.py. Default value will be routed and vlan membership for port and portchannel will have trunk
How to verify it
Port & Portchannel with vlan membership will have mode attribute with value trunk else it will be routed by default.
Description for the changelog
This PR is added to provide support for Switchport Modes Port & Port Channel Config-Engine changes
Link to config_db schema for YANG module changes
This PR is linked with PR which has YANG model support