Skip to content

Commit 04d0b34

Browse files
[voq][chassis][generate_dump] [BCM] Dump only the relevant BCM commands for fabric cards (#2606)
Signed-off-by: Sakthivadivu Saravanaraj [email protected] What I did When we run generate_dump script in SFM cards in a Broadcom chassis, the errors were printed in syslog for all the Broadcom commands which are not supported in fabric/Ramon cards. Added a check to dump all l2, l3, fp and tm commands only if the switch_type is non fabric card since these commands are not valid for fabric cards. How I did it Get the switch_type from DEVICE_METADATA and check the switch_type before dumping these BCM commands. How to verify it Ran generate_dump script in both voq and fabric cards, (1)verified that the fabric cards don't log the errors for the BCM commands (2) verified that the commands are dumped correctly in non-fabric dnx cards. Signed-off-by: Sakthivadivu Saravanaraj <[email protected]> Signed-off-by: saksarav <[email protected]>
1 parent ff032fe commit 04d0b34

File tree

1 file changed

+37
-29
lines changed

1 file changed

+37
-29
lines changed

scripts/generate_dump

Lines changed: 37 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1226,39 +1226,47 @@ collect_broadcom() {
12261226
fi
12271227

12281228
if [ "$bcm_family" == "broadcom-dnx" ]; then
1229-
save_bcmcmd_all_ns "\"l2 show\"" "l2.summary"
1230-
save_bcmcmd_all_ns "\"field group list\"" "fpgroup.list.summary"
1231-
total_fp_groups=34
1232-
for (( fp_grp=0; fp_grp<$total_fp_groups; fp_grp++ ))
1233-
do
1234-
save_bcmcmd_all_ns "\"field group info group=$fp_grp\"" "fpgroup$fp_grp.info.summary"
1235-
done
1236-
save_bcmcmd_all_ns "\"dbal table dump table=IPV4_UNICAST_PRIVATE_LPM_FORWARD\"" "l3.ipv4.lpm.summary"
1237-
save_bcmcmd_all_ns "\"dbal table dump table=IPV6_UNICAST_PRIVATE_LPM_FORWARD\"" "l3.ipv6.lpm.summary"
1238-
save_bcmcmd_all_ns "\"dbal table dump table=IPV4_UNICAST_PRIVATE_HOST\"" "l3.ipv4.host.summary"
1239-
save_bcmcmd_all_ns "\"dbal table dump table=IPV6_UNICAST_PRIVATE_HOST\"" "l3.ipv6.host.summary"
1240-
save_bcmcmd_all_ns "\"dbal table dump table=SUPER_FEC_1ST_HIERARCHY\"" "l3.egress.fec.summary"
1241-
save_bcmcmd_all_ns "\"dbal table dump table=ECMP_TABLE\"" "ecmp.table.summary"
1242-
save_bcmcmd_all_ns "\"dbal table dump table=ECMP_GROUP_PROFILE_TABLE\"" "ecmp.group.summary"
1243-
save_bcmcmd_all_ns "\"dbal table dump table=ING_VSI_INFO_DB\"" "ing.vsi.summary"
1244-
save_bcmcmd_all_ns "\"dbal table dump table=L3_MY_MAC_DA_PREFIXES\"" "l3.mymac.summary"
1245-
save_bcmcmd_all_ns "\"dbal table dump table=INGRESS_VLAN_MEMBERSHIP\"" "ing.vlan.summary"
1246-
save_bcmcmd_all_ns "\"dbal table dump table=LOCAL_SBC_IN_LIF_MATCH_INFO_SW\"" "sbc.inlif.summary"
1247-
save_bcmcmd_all_ns "\"dbal table dump table=SNIF_COMMAND_TABLE\"" "snif.command.summary"
1248-
save_bcmcmd_all_ns "\"port mgmt dump full\"" "port.mgmt.summary"
1249-
save_bcmcmd_all_ns "\"tm lag\"" "tm.lag.summary"
1250-
save_bcmcmd_all_ns "\"pp info fec\"" "pp.fec.summary"
1251-
save_bcmcmd_all_ns "\"nif sts\"" "nif.sts.summary"
1229+
supervisor=0
1230+
PLATFORM_ENV_CONF=/usr/share/sonic/device/${platform}/platform_env.conf
1231+
if [ -f "$PLATFORM_ENV_CONF" ]; then
1232+
source $PLATFORM_ENV_CONF
1233+
fi
1234+
if [[ x"$supervisor" != x"1" ]]; then
1235+
1236+
save_bcmcmd_all_ns "\"l2 show\"" "l2.summary"
1237+
save_bcmcmd_all_ns "\"field group list\"" "fpgroup.list.summary"
1238+
total_fp_groups=34
1239+
for (( fp_grp=0; fp_grp<$total_fp_groups; fp_grp++ ))
1240+
do
1241+
save_bcmcmd_all_ns "\"field group info group=$fp_grp\"" "fpgroup$fp_grp.info.summary"
1242+
done
1243+
save_bcmcmd_all_ns "\"dbal table dump table=IPV4_UNICAST_PRIVATE_LPM_FORWARD\"" "l3.ipv4.lpm.summary"
1244+
save_bcmcmd_all_ns "\"dbal table dump table=IPV6_UNICAST_PRIVATE_LPM_FORWARD\"" "l3.ipv6.lpm.summary"
1245+
save_bcmcmd_all_ns "\"dbal table dump table=IPV4_UNICAST_PRIVATE_HOST\"" "l3.ipv4.host.summary"
1246+
save_bcmcmd_all_ns "\"dbal table dump table=IPV6_UNICAST_PRIVATE_HOST\"" "l3.ipv6.host.summary"
1247+
save_bcmcmd_all_ns "\"dbal table dump table=SUPER_FEC_1ST_HIERARCHY\"" "l3.egress.fec.summary"
1248+
save_bcmcmd_all_ns "\"dbal table dump table=ECMP_TABLE\"" "ecmp.table.summary"
1249+
save_bcmcmd_all_ns "\"dbal table dump table=ECMP_GROUP_PROFILE_TABLE\"" "ecmp.group.summary"
1250+
save_bcmcmd_all_ns "\"dbal table dump table=ING_VSI_INFO_DB\"" "ing.vsi.summary"
1251+
save_bcmcmd_all_ns "\"dbal table dump table=L3_MY_MAC_DA_PREFIXES\"" "l3.mymac.summary"
1252+
save_bcmcmd_all_ns "\"dbal table dump table=INGRESS_VLAN_MEMBERSHIP\"" "ing.vlan.summary"
1253+
save_bcmcmd_all_ns "\"dbal table dump table=LOCAL_SBC_IN_LIF_MATCH_INFO_SW\"" "sbc.inlif.summary"
1254+
save_bcmcmd_all_ns "\"dbal table dump table=SNIF_COMMAND_TABLE\"" "snif.command.summary"
1255+
save_bcmcmd_all_ns "\"port mgmt dump full\"" "port.mgmt.summary"
1256+
save_bcmcmd_all_ns "\"tm lag\"" "tm.lag.summary"
1257+
save_bcmcmd_all_ns "\"pp info fec\"" "pp.fec.summary"
1258+
save_bcmcmd_all_ns "\"nif sts\"" "nif.sts.summary"
1259+
save_bcmcmd_all_ns "\"tm ing q map\"" "tm.ingress.qmap.summary"
1260+
save_bcmcmd_all_ns "\"tm ing vsq resources\"" "tm.ing.vsq.res.summary"
1261+
for group in {a..f}
1262+
do
1263+
save_bcmcmd_all_ns "\"tm ing vsq non g=$group\"" "tm.ing.vsq.non.group-$group.summary"
1264+
done
1265+
fi
12521266
save_bcmcmd_all_ns "\"port pm info\"" "port.pm.summary"
12531267
save_bcmcmd_all_ns "\"conf show\"" "conf.show.summary"
12541268
save_bcmcmd_all_ns "\"show counters\"" "show.counters.summary"
12551269
save_bcmcmd_all_ns "\"diag counter g\"" "diag.counter.summary"
1256-
save_bcmcmd_all_ns "\"tm ing q map\"" "tm.ingress.qmap.summary"
1257-
save_bcmcmd_all_ns "\"tm ing vsq resources\"" "tm.ing.vsq.res.summary"
1258-
for group in {a..f}
1259-
do
1260-
save_bcmcmd_all_ns "\"tm ing vsq non g=$group\"" "tm.ing.vsq.non.group-$group.summary"
1261-
done
12621270
save_bcmcmd_all_ns "\"fabric connectivity\"" "fabric.connect.summary"
12631271
save_bcmcmd_all_ns "\"port status\"" "port.status.summary"
12641272
else

0 commit comments

Comments
 (0)