Skip to content

Commit a096363

Browse files
authored
[broadcom]: Set default SYNCD_SHM_SIZE for Broadcom XGS devices (sonic-net#13297)
After upgrade to brcmsai 8.1, the sdk running environment (container) recommended with mininum memory size as below TH4/TD4(ltsw) uses 512MB TH3 used 300MB Helix4/TD2/TD3/TH/TH 256 MB Base on this requirement, adjust the default syncd share memory size and set the memory size for special ACISs in platform_env.conf file for different types of Broadcom ASICs. How I did it Add the platform_env.conf file if none of it for broadcom platform (base on platform_asic file) Add the 'SYNCD_SHM_SIZE' and set the value for ltsw(TD4/TH4) devices set to 512M at least (update the platform_env.conf) for Td2/TH2/TH devices set to 256M for TH3 set to 300M verify How to verify it verify the image with code fix Check with UT Check on lab devices On a problematic device which cannot start successfully Run with the command $ cat /proc/linux-kernel-bde Broadcom Device Enumerator (linux-kernel-bde) Module parameters: maxpayload=128 usemsi=0 dmasize=32M himem=(null) himemaddr=(null) DMA Memory (kernel): 33554432 bytes, 0 used, 33554432 free, local mmap No devices found $ docker rm -f syncd syncd $ sudo /usr/bin/syncd.sh start Cannot get Broadcom Chip Id. Skip set SYNCD_SHM_SIZE. Creating new syncd container with HWSKU Force10-S6000 a4862129a7fea04f00ed71a88715eac65a41cdae51c3158f9cdd7de3ccc3dd31 $ docker inspect syncd | grep -i shm "ShmSize": 67108864, "Tag": "fix_8.1_shm_issue.67873427-9f7ca60a0e", On Normal device $ docker inspect syncd | grep -i shm "ShmSize": 268435456, "Tag": "fix_8.1_shm_issue.67873427-9f7ca60a0e" change the config syncd_shm.ini to b85=128m $ docker rm -f syncd syncd $ sudo /usr/bin/syncd.sh start Creating new syncd container with HWSKU Force10-S6000 3209ffc1e5a7224b99640eb9a286c4c7aa66a2e6a322be32fb7fe2113bb9524c $ docker inspect syncd | grep -i shm "ShmSize": 134217728, "Tag": "fix_8.1_shm_issue.67873427-9f7ca60a0e", change the config under /usr/share/sonic/device/x86_64-dell_s6000_s1220-r0/Force10-S6000/platform_env.conf and run command $ cat /usr/share/sonic/device/x86_64-dell_s6000_s1220-r0/platform_env.conf SYNCD_SHM_SIZE=300m $ sudo /usr/bin/syncd.sh start Creating new syncd container with HWSKU Force10-S6000 897f6fcde1f669ad2caab7da4326079abd7e811bf73f018c6dacc24cf24bfda5 $ docker inspect syncd | grep -i shm "ShmSize": 314572800, "Tag": "fix_8.1_shm_issue.67873427-9f7ca60a0e", Signed-off-by: richardyu-ms <[email protected]>
1 parent bb48ee9 commit a096363

File tree

6 files changed

+41
-4
lines changed

6 files changed

+41
-4
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
SYNCD_SHM_SIZE=256m
1+
SYNCD_SHM_SIZE=512m
22
is_ltsw_chip=1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
SYNCD_SHM_SIZE=256m
1+
SYNCD_SHM_SIZE=512m
22
is_ltsw_chip=1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
SYNCD_SHM_SIZE=128m
1+
SYNCD_SHM_SIZE=512m
22
is_ltsw_chip=1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
SYNCD_SHM_SIZE=128m
1+
SYNCD_SHM_SIZE=512m
22
is_ltsw_chip=1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# This file contains the default memory size for each ASICs in broadcom platform
2+
# Format: ASIC_ID=Memory_size
3+
#b77->td3
4+
b77=256m
5+
#b85->td2
6+
b85=256m
7+
#b87->td3
8+
b87=512m
9+
#b96->th
10+
b96=256m
11+
#b97->th2
12+
b97=256m
13+
#b98->th3
14+
b98=300m

files/build_templates/docker_image_ctl.j2

+23
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,29 @@ start() {
315315
source $PLATFORM_ENV_CONF
316316
fi
317317

318+
{%- if sonic_asic_platform == "broadcom" %}
319+
{%- if docker_container_name == "syncd" %}
320+
# Set the SYNCD_SHM_SIZE if this variable not defined
321+
BRCM_PLATFORM_COMMON_DIR=/usr/share/sonic/device/x86_64-broadcom_common
322+
SYNCD_SHM_INI=$BRCM_PLATFORM_COMMON_DIR/syncd_shm.ini
323+
324+
readline=$(grep '0x14e4' /proc/linux-kernel-bde)
325+
bcm_chip_id=${readline#*0x14e4:0x}
326+
bcm_chip_id=${bcm_chip_id::3}
327+
328+
if [ -z "$SYNCD_SHM_SIZE" ]; then
329+
if [ -z "$bcm_chip_id" ]; then
330+
echo "Cannot get Broadcom Chip Id. Skip set SYNCD_SHM_SIZE."
331+
elif [ -f "$SYNCD_SHM_INI" ] && [ "$(grep -m1 "^${bcm_chip_id}=" $SYNCD_SHM_INI)" ]; then
332+
SYNCD_SHM_SIZE=`grep -m1 "^${bcm_chip_id}=" $SYNCD_SHM_INI | awk -F= '{print $2}'`
333+
else
334+
echo "Cannot get SYNCD_SHM_SIZE for chip: [${bcm_chip_id}] in $SYNCD_SHM_INI. Skip set SYNCD_SHM_SIZE."
335+
fi
336+
337+
fi
338+
{%- endif %}
339+
{%- endif %}
340+
318341
{%- if docker_container_name == "gbsyncd" %}
319342
GBSYNCD_CONF=/usr/share/sonic/device/$PLATFORM/gbsyncd.ini
320343
GBSYNCD_PLATFORM=gbsyncd-vs

0 commit comments

Comments
 (0)