diff --git a/device/arista/x86_64-arista_7050dx4_32s/platform_env.conf b/device/arista/x86_64-arista_7050dx4_32s/platform_env.conf index d72ffde2f2..dd7cf4fe01 100644 --- a/device/arista/x86_64-arista_7050dx4_32s/platform_env.conf +++ b/device/arista/x86_64-arista_7050dx4_32s/platform_env.conf @@ -1,2 +1,2 @@ -SYNCD_SHM_SIZE=256m +SYNCD_SHM_SIZE=512m is_ltsw_chip=1 diff --git a/device/arista/x86_64-arista_7050px4_32s/platform_env.conf b/device/arista/x86_64-arista_7050px4_32s/platform_env.conf index d72ffde2f2..dd7cf4fe01 100644 --- a/device/arista/x86_64-arista_7050px4_32s/platform_env.conf +++ b/device/arista/x86_64-arista_7050px4_32s/platform_env.conf @@ -1,2 +1,2 @@ -SYNCD_SHM_SIZE=256m +SYNCD_SHM_SIZE=512m is_ltsw_chip=1 diff --git a/device/arista/x86_64-arista_7060dx5_64s/platform_env.conf b/device/arista/x86_64-arista_7060dx5_64s/platform_env.conf index 77174634dc..dd7cf4fe01 100644 --- a/device/arista/x86_64-arista_7060dx5_64s/platform_env.conf +++ b/device/arista/x86_64-arista_7060dx5_64s/platform_env.conf @@ -1,2 +1,2 @@ -SYNCD_SHM_SIZE=128m +SYNCD_SHM_SIZE=512m is_ltsw_chip=1 diff --git a/device/arista/x86_64-arista_7060px5_64s/platform_env.conf b/device/arista/x86_64-arista_7060px5_64s/platform_env.conf index 77174634dc..dd7cf4fe01 100644 --- a/device/arista/x86_64-arista_7060px5_64s/platform_env.conf +++ b/device/arista/x86_64-arista_7060px5_64s/platform_env.conf @@ -1,2 +1,2 @@ -SYNCD_SHM_SIZE=128m +SYNCD_SHM_SIZE=512m is_ltsw_chip=1 diff --git a/device/broadcom/x86_64-broadcom_common/syncd_shm.ini b/device/broadcom/x86_64-broadcom_common/syncd_shm.ini new file mode 100644 index 0000000000..07a68ca0f3 --- /dev/null +++ b/device/broadcom/x86_64-broadcom_common/syncd_shm.ini @@ -0,0 +1,14 @@ +# This file contains the default memory size for each ASICs in broadcom platform +# Format: ASIC_ID=Memory_size +#b77->td3 +b77=256m +#b85->td2 +b85=256m +#b87->td3 +b87=512m +#b96->th +b96=256m +#b97->th2 +b97=256m +#b98->th3 +b98=300m diff --git a/files/build_templates/docker_image_ctl.j2 b/files/build_templates/docker_image_ctl.j2 index 6ba11ce650..3017565e30 100644 --- a/files/build_templates/docker_image_ctl.j2 +++ b/files/build_templates/docker_image_ctl.j2 @@ -315,6 +315,29 @@ start() { source $PLATFORM_ENV_CONF fi + {%- if sonic_asic_platform == "broadcom" %} + {%- if docker_container_name == "syncd" %} + # Set the SYNCD_SHM_SIZE if this variable not defined + BRCM_PLATFORM_COMMON_DIR=/usr/share/sonic/device/x86_64-broadcom_common + SYNCD_SHM_INI=$BRCM_PLATFORM_COMMON_DIR/syncd_shm.ini + + readline=$(grep '0x14e4' /proc/linux-kernel-bde) + bcm_chip_id=${readline#*0x14e4:0x} + bcm_chip_id=${bcm_chip_id::3} + + if [ -z "$SYNCD_SHM_SIZE" ]; then + if [ -z "$bcm_chip_id" ]; then + echo "Cannot get Broadcom Chip Id. Skip set SYNCD_SHM_SIZE." + elif [ -f "$SYNCD_SHM_INI" ] && [ "$(grep -m1 "^${bcm_chip_id}=" $SYNCD_SHM_INI)" ]; then + SYNCD_SHM_SIZE=`grep -m1 "^${bcm_chip_id}=" $SYNCD_SHM_INI | awk -F= '{print $2}'` + else + echo "Cannot get SYNCD_SHM_SIZE for chip: [${bcm_chip_id}] in $SYNCD_SHM_INI. Skip set SYNCD_SHM_SIZE." + fi + + fi + {%- endif %} + {%- endif %} + {%- if docker_container_name == "gbsyncd" %} GBSYNCD_CONF=/usr/share/sonic/device/$PLATFORM/gbsyncd.ini GBSYNCD_PLATFORM=gbsyncd-vs