Skip to content

Commit

Permalink
use ipv4+ipv6
Browse files Browse the repository at this point in the history
  • Loading branch information
JunhongMao committed Sep 19, 2023
1 parent 9c02cd4 commit ce38d0b
Showing 1 changed file with 15 additions and 8 deletions.
23 changes: 15 additions & 8 deletions scripts/generate_dump
Original file line number Diff line number Diff line change
Expand Up @@ -874,7 +874,7 @@ save_redis() {
# Returns:
# route
###############################################################################
get_route_table_size_by_asic_id() {
get_route_table_size_by_asic_id_and_ipver() {
local asic_id="$1"
local ip_ver="$2"
local filepath="/tmp/route_summary.txt"
Expand Down Expand Up @@ -930,21 +930,27 @@ save_saidump_by_route_size() {

for (( i=0; i<$NUM_ASICS; i++ ))
do
route_size_ipv4=`get_route_table_size_by_asic_id $i ipv4`
route_size_ipv4=`get_route_table_size_by_asic_id_and_ipver $i ipv4`
ret=$?

if [ $ret -ne 0 ]; then
echo "get_route_table_size_by_asic_id $i ipv4 failed."
echo "Get route table's size by asicid $i and ipv4 failed."
return $ret
fi
route_size_ipv6=`get_route_table_size_by_asic_id $i ipv6`

route_size_ipv6=`get_route_table_size_by_asic_id_and_ipver $i ipv6`
ret=$?

if [ $ret -ne 0 ]; then
echo "get_route_table_size_by_asic_id $i ipv6 failed."
echo "Get route table's size by asicid $i and ipv6 failed."
return $ret
fi
if [[ $route_size_ipv4 -gt $ROUTE_TAB_LIMIT_DIRECT_ITERATION ||
$route_size_ipv6 -gt $ROUTE_TAB_LIMIT_DIRECT_ITERATION ]]; then
echo "dump by using Redis save"

route_size=`expr $route_size_ipv4 + $route_size_ipv6`
echo "The route table's size is $route_size(ipv4 $route_size_ipv4, ipv6 $route_size_ipv6)"

if [[ $route_size -gt $ROUTE_TAB_LIMIT_DIRECT_ITERATION ]]; then
echo "Dump by using Redis SAVE."

if [[ ( "$NUM_ASICS" == 1 ) ]] ; then
save_cmd "saidump.sh" "saidump"
Expand All @@ -953,6 +959,7 @@ save_saidump_by_route_size() {
fi
else
echo "dump by using direct iteration"

if [[ ( "$NUM_ASICS" == 1 ) ]] ; then
save_cmd "docker exec syncd saidump" "saidump"
else
Expand Down

0 comments on commit ce38d0b

Please sign in to comment.