Skip to content

Commit

Permalink
Multi-ASIC implementation (#3888)
Browse files Browse the repository at this point in the history
Changes made to support multi-asic platform. Added multi-instance support for swss, syncd, database, bgp, teamd and lldp.
  • Loading branch information
SuvarnaMeenakshi authored and abdosi committed Apr 2, 2020
1 parent a5a11f6 commit 2e87a16
Show file tree
Hide file tree
Showing 36 changed files with 586 additions and 246 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
eth1:25,26,27,28
eth2:29,30,31,32
eth3:33,34,35,36
eth4:37,38,39,40
eth5:45,46,47,48
eth6:41,42,43,44
eth7:1,2,3,4
eth8:5,6,7,8
eth9:13,14,15,16
eth10:9,10,11,12
eth11:17,18,19,20
eth12:21,22,23,24
eth13:53,54,55,56
eth14:49,50,51,52
eth15:57,58,59,60
eth16:61,62,63,64
eth17:69,70,71,72
eth18:65,66,67,68
eth19:73,74,75,76
eth20:77,78,79,80
eth21:109,110,111,112
eth22:105,106,107,108
eth23:113,114,115,116
eth24:117,118,119,120
eth25:125,126,127,128
eth26:121,122,123,124
eth27:81,82,83,84
eth28:85,86,87,88
eth29:93,94,95,96
eth30:89,90,91,92
eth31:101,102,103,104
eth32:97,98,99,100
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/td2-s6000-32x40G.config.bcm
SAI_NUM_ECMP_MEMBERS=32
SAI_WARM_BOOT_READ_FILE=/var/cache/sai_warmboot.bin
SAI_WARM_BOOT_WRITE_FILE=/var/cache/sai_warmboot.bin
SAI_VS_SWITCH_TYPE=SAI_VS_SWITCH_TYPE_BCM56850
SAI_VS_HOSTIF_USE_TAP_DEVICE=true
SAI_VS_INTERFACE_LANE_MAP_FILE=/usr/share/sonic/hwsku/lanemap.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
eth1:25,26,27,28
eth2:29,30,31,32
eth3:33,34,35,36
eth4:37,38,39,40
eth5:45,46,47,48
eth6:41,42,43,44
eth7:1,2,3,4
eth8:5,6,7,8
eth9:13,14,15,16
eth10:9,10,11,12
eth11:17,18,19,20
eth12:21,22,23,24
eth13:53,54,55,56
eth14:49,50,51,52
eth15:57,58,59,60
eth16:61,62,63,64
eth17:69,70,71,72
eth18:65,66,67,68
eth19:73,74,75,76
eth20:77,78,79,80
eth21:109,110,111,112
eth22:105,106,107,108
eth23:113,114,115,116
eth24:117,118,119,120
eth25:125,126,127,128
eth26:121,122,123,124
eth27:81,82,83,84
eth28:85,86,87,88
eth29:93,94,95,96
eth30:89,90,91,92
eth31:101,102,103,104
eth32:97,98,99,100
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/td2-s6000-32x40G.config.bcm
SAI_NUM_ECMP_MEMBERS=32
SAI_WARM_BOOT_READ_FILE=/var/cache/sai_warmboot.bin
SAI_WARM_BOOT_WRITE_FILE=/var/cache/sai_warmboot.bin
SAI_VS_SWITCH_TYPE=SAI_VS_SWITCH_TYPE_BCM56850
SAI_VS_HOSTIF_USE_TAP_DEVICE=true
SAI_VS_INTERFACE_LANE_MAP_FILE=/usr/share/sonic/hwsku/lanemap.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
eth1:25,26,27,28
eth2:29,30,31,32
eth3:33,34,35,36
eth4:37,38,39,40
eth5:45,46,47,48
eth6:41,42,43,44
eth7:1,2,3,4
eth8:5,6,7,8
eth9:13,14,15,16
eth10:9,10,11,12
eth11:17,18,19,20
eth12:21,22,23,24
eth13:53,54,55,56
eth14:49,50,51,52
eth15:57,58,59,60
eth16:61,62,63,64
eth17:69,70,71,72
eth18:65,66,67,68
eth19:73,74,75,76
eth20:77,78,79,80
eth21:109,110,111,112
eth22:105,106,107,108
eth23:113,114,115,116
eth24:117,118,119,120
eth25:125,126,127,128
eth26:121,122,123,124
eth27:81,82,83,84
eth28:85,86,87,88
eth29:93,94,95,96
eth30:89,90,91,92
eth31:101,102,103,104
eth32:97,98,99,100
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/td2-s6000-32x40G.config.bcm
SAI_NUM_ECMP_MEMBERS=32
SAI_WARM_BOOT_READ_FILE=/var/cache/sai_warmboot.bin
SAI_WARM_BOOT_WRITE_FILE=/var/cache/sai_warmboot.bin
SAI_VS_SWITCH_TYPE=SAI_VS_SWITCH_TYPE_BCM56850
SAI_VS_HOSTIF_USE_TAP_DEVICE=true
SAI_VS_INTERFACE_LANE_MAP_FILE=/usr/share/sonic/hwsku/lanemap.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
eth1:25,26,27,28
eth2:29,30,31,32
eth3:33,34,35,36
eth4:37,38,39,40
eth5:45,46,47,48
eth6:41,42,43,44
eth7:1,2,3,4
eth8:5,6,7,8
eth9:13,14,15,16
eth10:9,10,11,12
eth11:17,18,19,20
eth12:21,22,23,24
eth13:53,54,55,56
eth14:49,50,51,52
eth15:57,58,59,60
eth16:61,62,63,64
eth17:69,70,71,72
eth18:65,66,67,68
eth19:73,74,75,76
eth20:77,78,79,80
eth21:109,110,111,112
eth22:105,106,107,108
eth23:113,114,115,116
eth24:117,118,119,120
eth25:125,126,127,128
eth26:121,122,123,124
eth27:81,82,83,84
eth28:85,86,87,88
eth29:93,94,95,96
eth30:89,90,91,92
eth31:101,102,103,104
eth32:97,98,99,100
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/td2-s6000-32x40G.config.bcm
SAI_NUM_ECMP_MEMBERS=32
SAI_WARM_BOOT_READ_FILE=/var/cache/sai_warmboot.bin
SAI_WARM_BOOT_WRITE_FILE=/var/cache/sai_warmboot.bin
SAI_VS_SWITCH_TYPE=SAI_VS_SWITCH_TYPE_BCM56850
SAI_VS_HOSTIF_USE_TAP_DEVICE=true
SAI_VS_INTERFACE_LANE_MAP_FILE=/usr/share/sonic/hwsku/lanemap.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
eth1:25,26,27,28
eth2:29,30,31,32
eth3:33,34,35,36
eth4:37,38,39,40
eth5:45,46,47,48
eth6:41,42,43,44
eth7:1,2,3,4
eth8:5,6,7,8
eth9:13,14,15,16
eth10:9,10,11,12
eth11:17,18,19,20
eth12:21,22,23,24
eth13:53,54,55,56
eth14:49,50,51,52
eth15:57,58,59,60
eth16:61,62,63,64
eth17:69,70,71,72
eth18:65,66,67,68
eth19:73,74,75,76
eth20:77,78,79,80
eth21:109,110,111,112
eth22:105,106,107,108
eth23:113,114,115,116
eth24:117,118,119,120
eth25:125,126,127,128
eth26:121,122,123,124
eth27:81,82,83,84
eth28:85,86,87,88
eth29:93,94,95,96
eth30:89,90,91,92
eth31:101,102,103,104
eth32:97,98,99,100
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/td2-s6000-32x40G.config.bcm
SAI_NUM_ECMP_MEMBERS=32
SAI_WARM_BOOT_READ_FILE=/var/cache/sai_warmboot.bin
SAI_WARM_BOOT_WRITE_FILE=/var/cache/sai_warmboot.bin
SAI_VS_SWITCH_TYPE=SAI_VS_SWITCH_TYPE_BCM56850
SAI_VS_HOSTIF_USE_TAP_DEVICE=true
SAI_VS_INTERFACE_LANE_MAP_FILE=/usr/share/sonic/hwsku/lanemap.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
eth1:25,26,27,28
eth2:29,30,31,32
eth3:33,34,35,36
eth4:37,38,39,40
eth5:45,46,47,48
eth6:41,42,43,44
eth7:1,2,3,4
eth8:5,6,7,8
eth9:13,14,15,16
eth10:9,10,11,12
eth11:17,18,19,20
eth12:21,22,23,24
eth13:53,54,55,56
eth14:49,50,51,52
eth15:57,58,59,60
eth16:61,62,63,64
eth17:69,70,71,72
eth18:65,66,67,68
eth19:73,74,75,76
eth20:77,78,79,80
eth21:109,110,111,112
eth22:105,106,107,108
eth23:113,114,115,116
eth24:117,118,119,120
eth25:125,126,127,128
eth26:121,122,123,124
eth27:81,82,83,84
eth28:85,86,87,88
eth29:93,94,95,96
eth30:89,90,91,92
eth31:101,102,103,104
eth32:97,98,99,100
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/td2-s6000-32x40G.config.bcm
SAI_NUM_ECMP_MEMBERS=32
SAI_WARM_BOOT_READ_FILE=/var/cache/sai_warmboot.bin
SAI_WARM_BOOT_WRITE_FILE=/var/cache/sai_warmboot.bin
SAI_VS_SWITCH_TYPE=SAI_VS_SWITCH_TYPE_BCM56850
SAI_VS_HOSTIF_USE_TAP_DEVICE=true
SAI_VS_INTERFACE_LANE_MAP_FILE=/usr/share/sonic/hwsku/lanemap.ini
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@ start () {
# eth48 - eth63: asic5
for ASIC in `seq $FIRST_FRONTEND_ASIC $LAST_FRONTEND_ASIC`; do
for NUM in `seq 1 16`; do
ORIG="eth$((16 * $ASIC + $NUM - 1))"
ORIG="eth$((16 * $ASIC + $NUM))"
TEMP="ethTemp999"
NEW="eth$(($NUM + 16))"
NEW="eth$(($NUM))"
echo "$ASIC : $NEW old $ORIG"
ip link set dev $ORIG down
ip link set dev $ORIG name $TEMP # rename to prevent conflicts before renaming in new namespace
ip link set dev $TEMP netns asic$ASIC
Expand All @@ -29,8 +30,9 @@ start () {
for BACKEND in `seq $FIRST_BACKEND_ASIC $LAST_BACKEND_ASIC`; do
for FRONTEND in `seq $FIRST_FRONTEND_ASIC $LAST_FRONTEND_ASIC`; do
for LINK in `seq 1 8`; do
BACK_NAME="eth$((8 * $FRONTEND + $LINK))"
FRONT_NAME="eth$((8 * $(($LAST_BACKEND_ASIC - $BACKEND)) + $LINK))"
FRONT_NAME="eth$((8 * $(($BACKEND - $FIRST_BACKEND_ASIC)) + $LINK + 16))"
BACK_NAME="eth$((8 * $FRONTEND + $LINK))"
echo "$FRONTEND:$FRONT_NAME - $BACKEND:$BACK_NAME"
TEMP_BACK="ethBack999"
TEMP_FRONT="ethFront999"

Expand All @@ -52,7 +54,7 @@ stop() {
for ASIC in `seq $FIRST_FRONTEND_ASIC $LAST_FRONTEND_ASIC`; do
for NUM in `seq 1 16`; do
TEMP="eth999"
OLD="eth$(($NUM + 16))"
OLD="eth$((16 * $ASIC + $NUM))"
NAME="eth$((16 * $ASIC + $NUM - 1))"
sudo ip netns exec asic$ASIC ip link set dev $OLD down
sudo ip netns exec asic$ASIC ip link set dev $OLD name $TEMP
Expand All @@ -78,4 +80,3 @@ case "$1" in
echo "Usage: $0 {start|stop}"
;;
esac

20 changes: 20 additions & 0 deletions dockers/docker-fpm-frr/bgpd.conf.default.j2
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,20 @@ route-map TO_BGP_PEER_V4 permit 100
!
route-map TO_BGP_PEER_V6 permit 100
!
{% if DEVICE_METADATA['localhost']['type'] == 'InternalFrontend' %}
route-map HIDE_INTERNAL permit 10
set community local-AS
!
{% endif %}
{% if DEVICE_METADATA['localhost']['type'] == 'InternalBackend' %}
route-map OVERRIDE_ORIGINATOR_ID permit 10
{% for (name, prefix) in LOOPBACK_INTERFACE|pfx_filter %}
{% if prefix | ipv4 and name == 'Loopback0' %}
set originator-id {{ prefix | ip }}
{% endif %}
{% endfor %}
!
{% endif %}
{% if BGP_MONITORS is defined and BGP_MONITORS|length > 0 %}
route-map FROM_BGPMON deny 10
!
Expand All @@ -37,6 +51,9 @@ route-map set-next-hop-global-v6 permit 10
set ipv6 next-hop prefer-global
!
router bgp {{ DEVICE_METADATA['localhost']['bgp_asn'] }}
{% if DEVICE_METADATA['localhost']['type'] == 'InternalFrontend' %}
redistribute connected route-map HIDE_INTERNAL
{% endif %}
bgp log-neighbor-changes
bgp bestpath as-path multipath-relax
no bgp default ipv4-unicast
Expand Down Expand Up @@ -151,6 +168,9 @@ router bgp {{ DEVICE_METADATA['localhost']['bgp_asn'] }}
neighbor {{ neighbor_addr }} peer-group BGPMON
neighbor {{ neighbor_addr }} description {{ bgp_session['name'] }}
neighbor {{ neighbor_addr }} activate
{% if DEVICE_METADATA['localhost']['type'] == 'InternalBackend' %}
neighbor {{ neighbor_addr }} route-map OVERRIDE_ORIGINATOR_ID in
{% endif %}
address-family ipv6
neighbor {{ neighbor_addr }} activate
exit-address-family
Expand Down
1 change: 1 addition & 0 deletions files/build_templates/database.service.j2
Loading

0 comments on commit 2e87a16

Please sign in to comment.