Skip to content

Commit

Permalink
[broadcom]: Check for broadcom platform sdk init ready during syncd s…
Browse files Browse the repository at this point in the history
…tart. (#2931)

- What I did
During boot/reload time, wait in a loop to check for bcm initialization.
Break the loop, once sdk is ready to process the 'bcmcmd' request (or) loop count reached the maximum value.

- How I did it
In the existing implementation during syncd start process will sleep for a fixed time (3 secs)
for sdk initialization to happen. But the time taken for sdk initialization is varying for different platforms.
To fix this issue, the syncd start process wait in a loop and check whether sdk is ready to process 'bcmcmd' command.

- How to verify it
Check for syncd process status and interface status.
Check for syslogs and no failures related to syncd should be present.
  • Loading branch information
ramachandrareddygaddam authored and lguohan committed Jun 19, 2019
1 parent 1854453 commit 6370d64
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion platform/broadcom/docker-syncd-brcm/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,20 @@ wait_syncd() {
done

# wait until bcm sdk is ready to get a request
sleep 3
counter=0
while true; do
/usr/bin/bcmcmd -t 1 "show unit" | grep BCM >/dev/null 2>&1
rv=$?
if [ $rv -eq 0 ]; then
break
fi
counter=$((counter+1))
if [ $counter -ge 60 ]; then
echo "syncd is not ready to take commands after $counter re-tries; Exiting!"
break
fi
sleep 1
done
}


Expand Down

0 comments on commit 6370d64

Please sign in to comment.