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

[sonic-cfggen][FRR] Support T2 chassis frontend #3100

Merged
merged 15 commits into from
Jul 9, 2019

Conversation

baiwei0427
Copy link
Collaborator

@baiwei0427 baiwei0427 commented Jun 29, 2019

- What I did

Support new role: T2 chassis frontend switch (SpineChassisFrontendRouter). The chassis frontend switch needs BGP-EVPN, Vxlan and Vnet support.

- How I did it

  • Modify minigraph parser to add Vnet and Vxlan informration for T2 chassis frontend

  • Add new bgpd and zebra j2 templates to support BGP-EVPN

  • Add new tests to sonic-cfggen unit test scripts

- How to verify it

Run load_minigraph and verify entries in config DB and FRR configuration.

In config DB, you should be able to see the following entries:

"VNET|VnetFE"
"VXLAN_TUNNEL|TunnelInt"

In FRR docker, you should be able to see BGP-EVPN configuration like follows:

router bgp 4000 vrf VnetFE
  no bgp default ipv4-unicast
  bgp log-neighbor-changes
  bgp bestpath as-path multipath-relax
  no bgp default ipv4-unicast
  bgp graceful-restart restart-time 240
  bgp graceful-restart
  bgp router-id 4.0.0.0
  neighbor 192.168.0.1 remote-as 3000
  neighbor 192.168.0.1 description Leaf01
  neighbor 192.168.0.1 timers 3 10
  address-family ipv4 unicast
    neighbor 192.168.0.1 activate
    neighbor 192.168.0.1 soft-reconfiguration inbound
    maximum-paths 64
  exit-address-family
  address-family l2vpn evpn
    advertise ipv4 unicast
  exit-address-family

!
! bgp multiple-instance
!
route-map FROM_BGP_SPEAKER_V4 permit 10
!
route-map TO_BGP_SPEAKER_V4 deny 10
!
router bgp 4000
  bgp log-neighbor-changes
  bgp bestpath as-path multipath-relax
  no bgp default ipv4-unicast
  bgp graceful-restart restart-time 240
  bgp graceful-restart
  bgp router-id 4.0.0.0
  network 4.0.0.0/32
  neighbor 4.0.0.1 remote-as 4000
  neighbor 4.0.0.1 description SpineFront02
  neighbor 4.0.0.1 timers 3 10
  address-family l2vpn evpn
    neighbor 4.0.0.1 activate
    advertise-all-vni
  exit-address-family
  neighbor 172.16.0.2 remote-as 5000
  neighbor 172.16.0.2 description SpineBack01
  neighbor 172.16.0.2 timers 3 10
  address-family ipv4 unicast
    neighbor 172.16.0.2 allowas-in 1
    neighbor 172.16.0.2 activate
    neighbor 172.16.0.2 soft-reconfiguration inbound
    maximum-paths 64
  exit-address-family
  neighbor 172.16.0.10 remote-as 5000
  neighbor 172.16.0.10 description SpineBack02
  neighbor 172.16.0.10 timers 3 10
  address-family ipv4 unicast
    neighbor 172.16.0.10 allowas-in 1
    neighbor 172.16.0.10 activate
    neighbor 172.16.0.10 soft-reconfiguration inbound
    maximum-paths 64
  exit-address-family
!
maximum-paths 64
!
route-map ISOLATE permit 10
set as-path prepend 4000
!
route-map set-next-hop-global-v6 permit 10
set ipv6 next-hop prefer-global
!

- Description for the changelog

- A picture of a cute animal (not mandatory but encouraged)

Signed-off-by: Wei Bai baiwei0427@gmail.com and Ze Gan ganze718@gmail.com

@baiwei0427 baiwei0427 changed the title [FRR][sonic-cfggen] Support T2 chassis frontend [sonic-cfggen] Support T2 chassis frontend Jun 29, 2019
@baiwei0427 baiwei0427 changed the title [sonic-cfggen] Support T2 chassis frontend [sonic-cfggen][FRR] Support T2 chassis frontend Jun 30, 2019

# Find physical L3 interfaces that should be enslaved to Vnet
for intf in phyport_intfs:
if isinstance(intf, tuple) == False:
Copy link
Collaborator

Choose a reason for hiding this comment

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

isinstance [](start = 11, length = 10)

use this function.

def is_ip_prefix_in_key(self, key):
    '''
    Function to check if IP address is present in the key. If it
    is present, then the key would be a tuple or else, it shall be
    be string
    '''
    return (isinstance(key, tuple))

Copy link
Collaborator

Choose a reason for hiding this comment

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

for better code readability, we need to directly understand the intention of the code without guessing.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@lguohan Fixed

# Get an interface that is enslaved to this port channel
intf_name = None
for pc_member in pc_members:
if isinstance(pc_member, tuple) and pc_member[0] == pc_intf_name:
Copy link
Collaborator

Choose a reason for hiding this comment

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

why do we need to check if pc_member is a tuple or not?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@lguohan I check https://github.com/Azure/SONiC/wiki/Configuration#port-channel-member. It seems that pc_member must be a tuple (port channel, physical interface). So I remove check here.

@@ -13,8 +13,12 @@ def setUp(self):
self.sample_graph_metadata = os.path.join(self.test_dir, 'simple-sample-graph-metadata.xml')
self.sample_graph_pc_test = os.path.join(self.test_dir, 'pc-test-graph.xml')
self.sample_graph_bgp_speaker = os.path.join(self.test_dir, 't0-sample-bgp-speaker.xml')
self.sample_graph_t2_chassis_fe = os.path.join(self.test_dir, 't2-chassis-fe-graph.xml')
Copy link
Contributor

Choose a reason for hiding this comment

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

i'd suppose it is better to separate the t2 chassis tests into one separate test file since it introduces many new features

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@stcheng Fixed

for better code readability
@baiwei0427
Copy link
Collaborator Author

retest this please

1 similar comment
@baiwei0427
Copy link
Collaborator Author

retest this please

Copy link
Contributor

@stcheng stcheng left a comment

Choose a reason for hiding this comment

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

thanks!

@lguohan lguohan merged commit 0ed8c81 into sonic-net:master Jul 9, 2019
@baiwei0427 baiwei0427 deleted the t2-chassis-fe branch July 13, 2019 10:02
yxieca added a commit to yxieca/sonic-buildimage that referenced this pull request Jan 13, 2024
Old format: version_a_b_c
New format: version_<branch>_<nn>

sonic-utilities:
* 371d62a2 2024-01-13 | Revert "Enhanced route_check.py for multi_asic platforms (sonic-net#3077)" (HEAD -> master, github/ying-test-submodule-advance) [Ying Xie]
* 7ddc709a 2024-01-13 | Revert "route_check: Skip route checks if bgp feature is not enabled (sonic-net#3075)" [Ying Xie]
* 1489c727 2024-01-12 | [Techsupport]Adding more FRR and BGP dumps (sonic-net#3118) (github/master) [Sudharsan Dhamal Gopalarathnam]
* 359e6925 2024-01-11 | Disable Key Validation feature during sonic-installation for Cisco Platforms (sonic-net#3115) [selvipal]
* 9515c642 2024-01-04 | [chassis]: Support show ip bgp summary to display without error when no external neighbors are configured on chassis LC (sonic-net#3099) [Arvindsrinivasan Lakshmi Narasimhan]
* 9400691c 2023-12-25 | Fix database initialization for db_migrator (sonic-net#3100) [ganglv]
* 56dafb07 2023-12-25 | Support disable/enable syslog rate limit feature (sonic-net#3072) [Junchao-Mellanox]
* 529bb96b 2023-12-23 | route_check: Skip route checks if bgp feature is not enabled (sonic-net#3075) [anamehra]
* bcb10f18 2023-12-23 | Support golden config in db migrator (sonic-net#3076) [ganglv]
* 20d1495b 2023-12-21 | [db_migrator] add db migrator version space for 202305/202311 branch (sonic-net#3081) [Ying Xie]
* a68d3d3a 2023-12-20 | Collect module EEPROM data in dump (sonic-net#3009) [Junchao-Mellanox]
* e7a8def6 2023-12-19 | Enhanced route_check.py for multi_asic platforms (sonic-net#3077) [Deepak Singhal]

Signed-off-by: Ying Xie <ying.xie@microsoft.com>
mssonicbld added a commit that referenced this pull request Jan 15, 2024
…atically (#17573)

#### Why I did it
src/sonic-utilities
```
* 942a7c9e - (HEAD -> master, origin/master, origin/HEAD) Revert "Enhanced route_check.py for multi_asic platforms" (#3122) (2 minutes ago) [Ying Xie]
* 01ee98ec - Revert "route_check: Skip route checks if bgp feature is not enabled" (#3121) (3 minutes ago) [Ying Xie]
* 1489c727 - [Techsupport]Adding more FRR and BGP dumps (#3118) (2 days ago) [Sudharsan Dhamal Gopalarathnam]
* 359e6925 - Disable Key Validation feature during sonic-installation for Cisco Platforms (#3115) (4 days ago) [selvipal]
* 9515c642 - [chassis]: Support show ip bgp summary to display without error when no external neighbors are configured on chassis LC (#3099) (10 days ago) [Arvindsrinivasan Lakshmi Narasimhan]
* 9400691c - Fix database initialization for db_migrator (#3100) (3 weeks ago) [ganglv]
* 56dafb07 - Support disable/enable syslog rate limit feature (#3072) (3 weeks ago) [Junchao-Mellanox]
* 529bb96b - route_check: Skip route checks if bgp feature is not enabled (#3075) (3 weeks ago) [anamehra]
* bcb10f18 - Support golden config in db migrator (#3076) (3 weeks ago) [ganglv]
* 20d1495b - [db_migrator] add db migrator version space for 202305/202311 branch (#3081) (4 weeks ago) [Ying Xie]
* a68d3d3a - Collect module EEPROM data in dump (#3009) (4 weeks ago) [Junchao-Mellanox]
* e7a8def6 - Enhanced route_check.py for multi_asic platforms (#3077) (4 weeks ago) [Deepak Singhal]
```
#### How I did it
#### How to verify it
#### Description for the changelog
mssonicbld added a commit that referenced this pull request Jan 31, 2024
…atically (#17954)

#### Why I did it
src/sonic-utilities
```
* 9c1d489c - (HEAD -> 202311, origin/202311) Fix database initialization for db_migrator (#3100) (10 hours ago) [ganglv]
* e9ae14d2 - Support golden config in db migrator (#3076) (16 hours ago) [ganglv]
```
#### How I did it
#### How to verify it
#### Description for the changelog
mssonicbld added a commit that referenced this pull request Apr 10, 2024
…lly (#18613)

#### Why I did it
src/sonic-swss
```
* 8fd34c1f - (HEAD -> 202311, origin/202311) Fix oper FEC retrieval after warmboot (#3100) (22 hours ago) [Sudharsan Dhamal Gopalarathnam]
```
#### How I did it
#### How to verify it
#### Description for the changelog
mssonicbld added a commit that referenced this pull request Apr 19, 2024
…lly (#18334)

#### Why I did it
src/sonic-swss
```
* 9e183a65 - (HEAD -> master, origin/master, origin/HEAD) Add bookworm build to the PR checkers (#3114) (2 days ago) [Saikrishna Arcot]
* ec463953 - [twamporch] Explicitly initialize local variable (#3115) (2 days ago) [xiaodong hu]
* 19410232 - Add force option for fabric port unisolate command (#3089) (7 days ago) [jfeng-arista]
* 774973d9 - [dash] fix ENI admin state update (#3081) (8 days ago) [Yakiv Huryk]
* 56ba6de3 - [p4orch] Clang format change. (#3096) (10 days ago) [mint570]
* f6dd9caa - Introduce a new role for DPU-NPU Interconnect (10 days ago) [Vivek]
* 0f707757 - [portsorch] Handle TRANSCEIVER_INFO table on warm boot (#3087) (10 days ago) [Stepan Blyshchak]
* cbc263a1 - [EVPN]Fix fpmsyncd crash when EVPN type5 is received with bgp fib suppression enabled (#3101) (13 days ago) [Sudharsan Dhamal Gopalarathnam]
* 4af61167 - Fix oper FEC retrieval after warmboot (#3100) (13 days ago) [Sudharsan Dhamal Gopalarathnam]
* 2a586154 - [Fdbsyncd] Adding extern_learn flag with fdb entry so Kernel doesn't age out (#2985) (2 weeks ago) [KISHORE KUNAL]
* 465399e9 - T2-VOQ-VS: Fix iBGP bringup issue (#3053) (2 weeks ago) [Deepak Singhal]
* dc9eae87 - Clang format change. (#3080) (2 weeks ago) [mint570]
* 95a74750 - [orchagent] TWAMP Light orchagent implementation (#2927) (2 weeks ago) [xiaodong hu]
```
#### How I did it
#### How to verify it
#### Description for the changelog
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants