Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[config-engine]: Fix bug multiple ports connecting to same neighbor #1005

Merged
merged 1 commit into from
Oct 3, 2017
Merged

[config-engine]: Fix bug multiple ports connecting to same neighbor #1005

merged 1 commit into from
Oct 3, 2017

Conversation

stcheng
Copy link
Contributor

@stcheng stcheng commented Oct 3, 2017

[config-engine]: Fix bug multiple ports connecting to same neighbor

The current DEVICE_NEIGHBOR format doesn't support multiple different
ports connecting with same neighbor. Thus the lldpd.conf file is not
generated correctly, causing missing information for LAG members.

This fix reverts the data structure in the previous version of
minigraph parser - using local port as the key and remote port/device
as the value of the map. Sample format is:

DEVICE_NEIGHBOR['Ethernet124'] = {
    'name': 'ARISTA04T1',
    'port': 'Ethernet1/1'
}

The corresponding unit test in test_cfggen is updated.
Add one more unit test for lldpd.conf.j2 verification.

Signed-off-by: Shu0T1an ChenG <shuche@microsoft.com>

- What I did
See above.

- How I did it
Vim.

- How to verify it
Replace the minigraph.py file and the lldpd.conf.j2 file in the lldp docker and check the generated lldpd.conf file. This is especially the case when the topology is t1-lag.

See the output:

configure ports Ethernet124 lldp portidsubtype local fortyGigE0/124 description ARISTA16T0:Ethernet1
configure ports Ethernet104 lldp portidsubtype local fortyGigE0/104 description ARISTA11T0:Ethernet1
configure ports Ethernet100 lldp portidsubtype local fortyGigE0/100 description ARISTA10T0:Ethernet1
configure ports Ethernet40 lldp portidsubtype local fortyGigE0/40 description ARISTA11T2:Ethernet1
configure ports Ethernet44 lldp portidsubtype local fortyGigE0/44 description ARISTA11T2:Ethernet2
configure ports Ethernet32 lldp portidsubtype local fortyGigE0/32 description ARISTA09T2:Ethernet1
configure ports Ethernet36 lldp portidsubtype local fortyGigE0/36 description ARISTA09T2:Ethernet2
configure ports Ethernet96 lldp portidsubtype local fortyGigE0/96 description ARISTA09T0:Ethernet1
configure ports Ethernet84 lldp portidsubtype local fortyGigE0/84 description ARISTA06T0:Ethernet1
configure ports Ethernet92 lldp portidsubtype local fortyGigE0/92 description ARISTA08T0:Ethernet1
configure ports Ethernet88 lldp portidsubtype local fortyGigE0/88 description ARISTA07T0:Ethernet1
configure ports Ethernet24 lldp portidsubtype local fortyGigE0/24 description ARISTA07T2:Ethernet1
configure ports Ethernet28 lldp portidsubtype local fortyGigE0/28 description ARISTA07T2:Ethernet2
configure ports Ethernet0 lldp portidsubtype local fortyGigE0/0 description ARISTA01T2:Ethernet1
configure ports Ethernet4 lldp portidsubtype local fortyGigE0/4 description ARISTA01T2:Ethernet2
configure ports Ethernet64 lldp portidsubtype local fortyGigE0/64 description ARISTA01T0:Ethernet1
configure ports Ethernet16 lldp portidsubtype local fortyGigE0/16 description ARISTA05T2:Ethernet1
configure ports Ethernet20 lldp portidsubtype local fortyGigE0/20 description ARISTA05T2:Ethernet2
configure ports Ethernet80 lldp portidsubtype local fortyGigE0/80 description ARISTA05T0:Ethernet1
configure ports Ethernet68 lldp portidsubtype local fortyGigE0/68 description ARISTA02T0:Ethernet1
configure ports Ethernet72 lldp portidsubtype local fortyGigE0/72 description ARISTA03T0:Ethernet1
configure ports Ethernet8 lldp portidsubtype local fortyGigE0/8 description ARISTA03T2:Ethernet1
configure ports Ethernet12 lldp portidsubtype local fortyGigE0/12 description ARISTA03T2:Ethernet2
configure ports Ethernet76 lldp portidsubtype local fortyGigE0/76 description ARISTA04T0:Ethernet1
configure ports Ethernet120 lldp portidsubtype local fortyGigE0/120 description ARISTA15T0:Ethernet1
configure ports Ethernet56 lldp portidsubtype local fortyGigE0/56 description ARISTA15T2:Ethernet1
configure ports Ethernet60 lldp portidsubtype local fortyGigE0/60 description ARISTA15T2:Ethernet2
configure ports Ethernet116 lldp portidsubtype local fortyGigE0/116 description ARISTA14T0:Ethernet1
configure ports Ethernet108 lldp portidsubtype local fortyGigE0/108 description ARISTA12T0:Ethernet1
configure ports Ethernet48 lldp portidsubtype local fortyGigE0/48 description ARISTA13T2:Ethernet1
configure ports Ethernet52 lldp portidsubtype local fortyGigE0/52 description ARISTA13T2:Ethernet2
configure ports Ethernet112 lldp portidsubtype local fortyGigE0/112 description ARISTA13T0:Ethernet1

- A picture of a cute animal

                       m
   $m                mm            m
    "$mmmmm        m$"    mmmmmmm$"
          """$m   m$    m$""""""
        mmmmmmm$$$$$$$$$"mmmm
  mmm$$$$$$$$$$$$$$$$$$ m$$$$m  "    m  "
$$$$$$$$$$$$$$$$$$$$$$  $$$$$$"$$$
 mmmmmmbugmmmmmmmmmmmm  $$$$$$$$$$
 $$$$$$$$$$$$$$$$$$$$$  $$$$$$$"""  m
 "$$$$$$$$$$$$$$$$$$$$$ $$$$$$  "      "
     """""""$$$$$$$$$$$m """"
       mmmmmmmm"  m$   "$mmmmm
     $$""""""      "$     """"""$$
   m$"               "m           "
                       "

@stcheng stcheng requested a review from taoyl-ms October 3, 2017 08:54
@stcheng
Copy link
Contributor Author

stcheng commented Oct 3, 2017

@taoyl-ms could you help verify if the file lldpd.conf.j2 is the only place that consumes DEVICE_NEIGHBOR? Since the format is changed, (and has to be changed), it shall be cautious to find out all the potential affected places.

@taoyl-ms
Copy link
Contributor

taoyl-ms commented Oct 3, 2017

Yes, lldpd.conf.j2 is currently the only consumer.

Copy link
Contributor

@taoyl-ms taoyl-ms left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently there is no support to sync a dictionary attribute into DB. We need to reconsider the table schema design if one port per neighbor assumption is not correct.

The current DEVICE_NEIGHBOR format doesn't support multiple different
ports connecting with same neighbor. Thus the lldpd.conf file is not
generated correctly, causing missing information for LAG members.

This fix reverts the data structure in the previous version of
minigraph parser - using local port as the key and remote port/device
as the value of the map. Sample format is:

DEVICE_NEIGHBOR['Ethernet124'] = {
    'name': 'ARISTA04T1',
    'port': 'Ethernet1/1'
}

The corresponding unit test in test_cfggen is updated.
Add one more unit test for lldpd.conf.j2 verification.

Signed-off-by: Shu0T1an ChenG <shuche@microsoft.com>
@@ -26,10 +26,16 @@ def test_interfaces(self):

def test_alias_map(self):
alias_map_template = os.path.join(self.test_dir, '..', '..', '..', 'dockers', 'docker-snmp-sv2', 'alias_map.j2')
argument = '-m "' + self.t0_minigraph + '" -p "' + self.t0_port_config + '" -t "' + alias_map_template + '"'
argument = '-m ' + self.t0_minigraph + ' -p ' + self.t0_port_config + ' -t ' + alias_map_template
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why remove quotes? I think it will fail when there is space in source path.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since all the other tests do not use quotes, I just remove them to align the format.

@stcheng stcheng merged commit 72e9476 into sonic-net:master Oct 3, 2017
@stcheng stcheng deleted the neighbor branch October 3, 2017 23:23
taoyl-ms pushed a commit that referenced this pull request Oct 3, 2017
…1005)

The current DEVICE_NEIGHBOR format doesn't support multiple different
ports connecting with same neighbor. Thus the lldpd.conf file is not
generated correctly, causing missing information for LAG members.

This fix reverts the data structure in the previous version of
minigraph parser - using local port as the key and remote port/device
as the value of the map. Sample format is:

DEVICE_NEIGHBOR['Ethernet124'] = {
    'name': 'ARISTA04T1',
    'port': 'Ethernet1/1'
}

The corresponding unit test in test_cfggen is updated.
Add one more unit test for lldpd.conf.j2 verification.

Signed-off-by: Shu0T1an ChenG <shuche@microsoft.com>
lguohan pushed a commit that referenced this pull request Aug 14, 2019
[sairedis]:

ARM32 bit fixes, for 64bit printf format specifier (#490)
fix wrong API type , add cmdline parse option , remove unuseful api call (#499)
Use pointer to member function to reduce the footprint of collectCounters() (#488)
[syncd] Add support for Innovium platform (#496)
[saisdkdump]: Fix dump generation crash (#493)

[swss]:

Add scope attribute to VNET table. (#954)
[portsyncd]: Fix portsyncd restart case (#1019)
[vnet]: Enable "vnet_orch_1" VS test case (#1020)
[vlan] Add pytest cases to validate the behavior about add LAG member to vlan. (#875)
[policerorch]: Add the capability to update policer rate/size (#1017)
[aclorch]: Add MIRRORv6 support for NPS platform (#1018)
[orchagent]: Avoid crash by setting g_syncMode flag before create_switch (#1014)
[orchagent] Add support for Innovium platform (#1005)
Provide broadcast IP while configuring interface ip address (#1007)
[VLAN] Add pytest cases to validate different use-case of tagging_mode. (#860)
[vstest]: Add test_port_config.py which include breakout port test. (#866)
[vstests]: change 'test_acl_egress_table.py' to UNIX format (#1010)
[vlan] Add pytest cases to verify data in app db and state db. (#895)
[vstest]: Add the CRM tests (#1013)
[warm-reboot]: add bgp eoiu support to speed up route reconcile (#856)
[fdborch] support mac update (#877)
[vxlanorch] Fix Logic of Vxlan tunnel removal (#995)
Fix VLAN error introduced with new 4.9 kernel behavior (#1001)
Config DB manual is being moved from Wiki to SWSS repo (#1002)
Trap DHCPv6 packets for supporting ZTP over in-band interfaces using … (#997)

Signed-off-by: Andriy Kokhan <akokhan@barefootnetworks.com>
zhenggen-xu pushed a commit to zhenggen-xu/sonic-buildimage that referenced this pull request Oct 17, 2019
* msft_github/master:
  [DHCP Relay]: Support Multiple VLANs (Separate DHCP Relay Agents, One Per VLAN) (sonic-net#999)
  [build]: sonic-utilities package depends on swsssdk; build as wheel and add build dependency (sonic-net#1011)
  Make swssconfig status FATAL when it fails (sonic-net#1009)
  [swss]: Update swss-common/sairedis/swss submodules (sonic-net#1008)
  [config-engine]: Fix bug multiple ports connecting to same neighbor (sonic-net#1005)
madhanmellanox pushed a commit to madhanmellanox/sonic-buildimage that referenced this pull request Mar 23, 2020
Signed-off-by: Tony Titus ttitus@innovium.com
vdahiya12 added a commit to vdahiya12/sonic-buildimage that referenced this pull request Aug 26, 2020
[config] Update SONiC Environment Vars Whne Loading Minigraph (sonic-net#1073)
Multi asic platform changes for interface, portchannel commands (sonic-net#878)
Update Command-Reference.md (sonic-net#1075)
[filter-fdb] Fix Filter FDB With IPv6 Present in Config DB (sonic-net#1059)
[config] Remove _get_breakout_cfg_file_name helper function (sonic-net#1069)
[SHOW][BGP] support show ip(v6) bgp summary for multi asic platform (sonic-net#1064)
[fanshow] Display other fan status, such as Updating (sonic-net#1014)
Add ip_prefix len based on proxy_arp status (sonic-net#1046)
Enable the platform specific ssd firmware upgrade during reboot (sonic-net#954)
[show][cli[show interface portchannel support for Multi ASIC (sonic-net#1005)
support show interface commands for multi ASIC platforms (sonic-net#1006)

Signed-off-by: vaibhav-dahiya <vdahiya@microsoft.com>
vdahiya12 added a commit to vdahiya12/sonic-buildimage that referenced this pull request Aug 26, 2020
[show]bgp]Display the Total number of neighbors in the show ip bgp(v6) summary.  (sonic-net#1079)
[config] Update SONiC Environment Vars When Loading Minigraph (sonic-net#1073)
Multi asic platform changes for interface, portchannel commands (sonic-net#878)
Update Command-Reference.md (sonic-net#1075)
[filter-fdb] Fix Filter FDB With IPv6 Present in Config DB (sonic-net#1059)
[config] Remove _get_breakout_cfg_file_name helper function (sonic-net#1069)
[SHOW][BGP] support show ip(v6) bgp summary for multi asic platform (sonic-net#1064)
[fanshow] Display other fan status, such as Updating (sonic-net#1014)
Add ip_prefix len based on proxy_arp status (sonic-net#1046)
Enable the platform specific ssd firmware upgrade during reboot (sonic-net#954)
[show][cli[show interface portchannel support for Multi ASIC (sonic-net#1005)
support show interface commands for multi ASIC platforms (sonic-net#1006)

Signed-off-by: vaibhav-dahiya <vdahiya@microsoft.com>
vdahiya12 added a commit to vdahiya12/sonic-buildimage that referenced this pull request Aug 27, 2020
Fix pfcwd stats crash with invalid queue name (sonic-net#1077)
[show][bgp]Display the Total number of neighbors in the show ip bgp(v6) summary. (sonic-net#1079)
[config] Update SONiC Environment Vars When Loading Minigraph (sonic-net#1073)
Multi asic platform changes for interface, portchannel commands (sonic-net#878)
Update Command-Reference.md (sonic-net#1075)
[filter-fdb] Fix Filter FDB With IPv6 Present in Config DB (sonic-net#1059)
[config] Remove _get_breakout_cfg_file_name helper function (sonic-net#1069)
[SHOW][BGP] support show ip(v6) bgp summary for multi asic platform (sonic-net#1064)
[fanshow] Display other fan status, such as Updating (sonic-net#1014)
Add ip_prefix len based on proxy_arp status (sonic-net#1046)
Enable the platform specific ssd firmware upgrade during reboot (sonic-net#954)
[show][cli[show interface portchannel support for Multi ASIC (sonic-net#1005)
support show interface commands for multi ASIC platforms (sonic-net#1006)

Signed-off-by: vaibhav-dahiya <vdahiya@microsoft.com>
vdahiya12 added a commit that referenced this pull request Sep 4, 2020
… path to sonic-py-common and update sonic-utilities to comply (#5264)

* [sonic-utilities]update submodule with fix

This PR addresses fixes in sonic-py-common to imitate the behavior inside
sonic-cfggen. Essentially this is a fix for accessing the port-config file.
First check if there is a platform.json file for config generation
and then for legacy port_config.ini.
Also updating the sub-module sonic-utilities.

Fix pfcwd stats crash with invalid queue name (#1077)
[show][bgp]Display the Total number of neighbors in the show ip bgp(v6) summary. (#1079)
[config] Update SONiC Environment Vars When Loading Minigraph (#1073)
Multi asic platform changes for interface, portchannel commands (#878)
Update Command-Reference.md (#1075)
[filter-fdb] Fix Filter FDB With IPv6 Present in Config DB (#1059)
[config] Remove _get_breakout_cfg_file_name helper function (#1069)
[SHOW][BGP] support show ip(v6) bgp summary for multi asic platform (#1064)
[fanshow] Display other fan status, such as Updating (#1014)
Add ip_prefix len based on proxy_arp status (#1046)
Enable the platform specific ssd firmware upgrade during reboot (#954)
[show][cli[show interface portchannel support for Multi ASIC (#1005)
support show interface commands for multi ASIC platforms (#1006)

Signed-off-by: vaibhav-dahiya <vdahiya@microsoft.com>
wangshengjun pushed a commit to wangshengjun/sonic-buildimage that referenced this pull request Nov 16, 2020
[sairedis]:

ARM32 bit fixes, for 64bit printf format specifier (sonic-net#490)
fix wrong API type , add cmdline parse option , remove unuseful api call (sonic-net#499)
Use pointer to member function to reduce the footprint of collectCounters() (sonic-net#488)
[syncd] Add support for Innovium platform (sonic-net#496)
[saisdkdump]: Fix dump generation crash (sonic-net#493)

[swss]:

Add scope attribute to VNET table. (sonic-net#954)
[portsyncd]: Fix portsyncd restart case (sonic-net#1019)
[vnet]: Enable "vnet_orch_1" VS test case (sonic-net#1020)
[vlan] Add pytest cases to validate the behavior about add LAG member to vlan. (sonic-net#875)
[policerorch]: Add the capability to update policer rate/size (sonic-net#1017)
[aclorch]: Add MIRRORv6 support for NPS platform (sonic-net#1018)
[orchagent]: Avoid crash by setting g_syncMode flag before create_switch (sonic-net#1014)
[orchagent] Add support for Innovium platform (sonic-net#1005)
Provide broadcast IP while configuring interface ip address (sonic-net#1007)
[VLAN] Add pytest cases to validate different use-case of tagging_mode. (sonic-net#860)
[vstest]: Add test_port_config.py which include breakout port test. (sonic-net#866)
[vstests]: change 'test_acl_egress_table.py' to UNIX format (sonic-net#1010)
[vlan] Add pytest cases to verify data in app db and state db. (sonic-net#895)
[vstest]: Add the CRM tests (sonic-net#1013)
[warm-reboot]: add bgp eoiu support to speed up route reconcile (sonic-net#856)
[fdborch] support mac update (sonic-net#877)
[vxlanorch] Fix Logic of Vxlan tunnel removal (sonic-net#995)
Fix VLAN error introduced with new 4.9 kernel behavior (sonic-net#1001)
Config DB manual is being moved from Wiki to SWSS repo (sonic-net#1002)
Trap DHCPv6 packets for supporting ZTP over in-band interfaces using … (sonic-net#997)

Signed-off-by: Andriy Kokhan <akokhan@barefootnetworks.com>
santhosh-kt pushed a commit to santhosh-kt/sonic-buildimage that referenced this pull request Feb 25, 2021
… path to sonic-py-common and update sonic-utilities to comply (sonic-net#5264)

* [sonic-utilities]update submodule with fix

This PR addresses fixes in sonic-py-common to imitate the behavior inside
sonic-cfggen. Essentially this is a fix for accessing the port-config file.
First check if there is a platform.json file for config generation
and then for legacy port_config.ini.
Also updating the sub-module sonic-utilities.

Fix pfcwd stats crash with invalid queue name (sonic-net#1077)
[show][bgp]Display the Total number of neighbors in the show ip bgp(v6) summary. (sonic-net#1079)
[config] Update SONiC Environment Vars When Loading Minigraph (sonic-net#1073)
Multi asic platform changes for interface, portchannel commands (sonic-net#878)
Update Command-Reference.md (sonic-net#1075)
[filter-fdb] Fix Filter FDB With IPv6 Present in Config DB (sonic-net#1059)
[config] Remove _get_breakout_cfg_file_name helper function (sonic-net#1069)
[SHOW][BGP] support show ip(v6) bgp summary for multi asic platform (sonic-net#1064)
[fanshow] Display other fan status, such as Updating (sonic-net#1014)
Add ip_prefix len based on proxy_arp status (sonic-net#1046)
Enable the platform specific ssd firmware upgrade during reboot (sonic-net#954)
[show][cli[show interface portchannel support for Multi ASIC (sonic-net#1005)
support show interface commands for multi ASIC platforms (sonic-net#1006)

Signed-off-by: vaibhav-dahiya <vdahiya@microsoft.com>
stepanblyschak pushed a commit to stepanblyschak/sonic-buildimage that referenced this pull request May 10, 2021
…et#1005)

Add the multi ASIC specific options for the command show interface portchannel
Change the teamshow script to get the port channel information from all the Namespaces
- Add support for -n and -d options
- This new options are ignored for single ASIC platforms

Signed-off-by: Arvindsrinivasan Lakshmi Narasimhan <arlakshm@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants