Skip to content

Commit

Permalink
[install.sh] Fix CPU cstates configuration. (sonic-net#7222)
Browse files Browse the repository at this point in the history
The motivation of these changes is to fix (sonic-net#6051):

- Why I did it
To fix CPU cstates configuration

- How I did it
Updated code to be POSIX compatible

- How to verify it
root@sonic:/home/admin# sonic_installer install sonic-mellanox.bin

Signed-off-by: Nazarii Hnydyn <nazariig@nvidia.com>
  • Loading branch information
nazariig committed Apr 4, 2021
1 parent 9fa5a61 commit 01b0330
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions installer/x86_64/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -562,9 +562,10 @@ trap_push "rm $grub_cfg || true"
[ -r ./platform.conf ] && . ./platform.conf
# Check if the CPU vendor is 'Intel' and disable c-states if True
CPUVENDOR=$(cat /proc/cpuinfo | grep -m 1 vendor_id | awk '{print $3}')
CPUVENDOR="$(cat /proc/cpuinfo | grep -m 1 vendor_id | awk '{print $3}')"
echo "Switch CPU vendor is: $CPUVENDOR"
if [[ $(echo $CPUVENDOR | grep -i "Intel") ]] ; then
if echo "$CPUVENDOR" | grep -i 'Intel' >/dev/null 2>&1; then
echo "Switch CPU cstates are: disabled"
CSTATES="intel_idle.max_cstate=0"
else
CSTATES=""
Expand Down

0 comments on commit 01b0330

Please sign in to comment.