-
Notifications
You must be signed in to change notification settings - Fork 1.8k
TSA/B/C changes for multi-asic #6510
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
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
3de11fd
TSA/B/C changes for multi-asic
judyjoseph b2fea23
Get platform from env
judyjoseph 9505af0
TSA/B/C scripts run only in BGP instances for front end ASICs.
judyjoseph 219b2e2
Update to TS common script newly added with right permissions
judyjoseph 7345412
Fix the binary name, the new script TS was incorrectly saved as TSC.
judyjoseph 0b18734
Change the format of message to its original format in case of Single…
judyjoseph e096fcd
Introduced TS common file in docker as well and moved common functions.
judyjoseph File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| #!/bin/bash | ||
|
|
||
| # Check whether the routemap is for internal BGP sessions. | ||
| function is_internal_route_map() | ||
| { | ||
| [[ "$1" =~ .*"_INTERNAL_".* ]] | ||
| } | ||
|
|
||
| function check_not_installed() | ||
| { | ||
| c=0 | ||
| config=$(vtysh -c "show run") | ||
| for route_map_name in $(echo "$config" | sed -ne 's/ neighbor \S* route-map \(\S*\) out/\1/p' | egrep 'V4|V6'); | ||
| do | ||
| is_internal_route_map $route_map_name && continue | ||
| echo "$config" | egrep -q "^route-map $route_map_name permit 20$" | ||
| c=$((c+$?)) | ||
| echo "$config" | egrep -q "^route-map $route_map_name deny 30$" | ||
| c=$((c+$?)) | ||
| done | ||
| return $c | ||
| } | ||
|
|
||
| function check_installed() | ||
| { | ||
| c=0 | ||
| e=0 | ||
| config=$(vtysh -c "show run") | ||
| for route_map_name in $(echo "$config" | sed -ne 's/ neighbor \S* route-map \(\S*\) out/\1/p' | egrep 'V4|V6'); | ||
| do | ||
| is_internal_route_map $route_map_name && continue | ||
| echo "$config" | egrep -q "^route-map $route_map_name permit 20$" | ||
| c=$((c+$?)) | ||
| e=$((e+1)) | ||
| echo "$config" | egrep -q "^route-map $route_map_name deny 30$" | ||
| c=$((c+$?)) | ||
| e=$((e+1)) | ||
| done | ||
| return $((e-c)) | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| #!/bin/bash | ||
|
|
||
| # read SONiC immutable variables | ||
| [ -f /etc/sonic/sonic-environment ] && . /etc/sonic/sonic-environment | ||
|
|
||
| PLATFORM=${PLATFORM:-`sonic-cfggen -H -v DEVICE_METADATA.localhost.platform`} | ||
|
|
||
| # Parse the device specific asic conf file, if it exists | ||
| ASIC_CONF=/usr/share/sonic/device/$PLATFORM/asic.conf | ||
| [ -f $ASIC_CONF ] && . $ASIC_CONF | ||
|
|
||
| if [[ ($NUM_ASIC -gt 1) ]]; then | ||
| asic=0 | ||
| NAMESPACE_PREFIX='asic' | ||
|
|
||
| while [ $asic -lt $NUM_ASIC ] | ||
| do | ||
| # Run TSA/TSB/TSC scripts in BGP instance for frontend ASICs. | ||
| sub_role=`sonic-cfggen -d -v "DEVICE_METADATA['localhost']['sub_role']" -n $NAMESPACE_PREFIX$asic` | ||
| if [ $sub_role == 'FrontEnd' ] | ||
| then | ||
| echo -e "BGP"$asic" : \c" | ||
| docker exec -i bgp$asic /usr/bin/$1 | ||
| fi | ||
| asic=$[$asic+1] | ||
| done | ||
| else | ||
| docker exec -i bgp /usr/bin/$1 | ||
| fi | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,3 @@ | ||
| #!/bin/bash | ||
|
|
||
| docker exec -i bgp /usr/bin/TSA | ||
| /usr/bin/TS TSA |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,3 @@ | ||
| #!/bin/bash | ||
|
|
||
| docker exec -i bgp /usr/bin/TSB | ||
| /usr/bin/TS TSB |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| #!/bin/bash | ||
|
|
||
| docker exec -i bgp /usr/bin/TSC | ||
| /usr/bin/TS TSC | ||
|
|
||
| portstat -p 5 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.