From 567632fd99dc583794bd59b03277be44f74aab03 Mon Sep 17 00:00:00 2001 From: Sakthivadivu Saravanaraj Date: Tue, 17 Jan 2023 15:53:28 -0500 Subject: [PATCH 1/2] [generate_dump] [BCM] Dump only the relevant BCM commands for fabric cards. Signed-off-by: Sakthivadivu Saravanaraj --- scripts/generate_dump | 61 +++++++++++++++++++++++-------------------- 1 file changed, 32 insertions(+), 29 deletions(-) diff --git a/scripts/generate_dump b/scripts/generate_dump index 4400f4e984..78d3908607 100755 --- a/scripts/generate_dump +++ b/scripts/generate_dump @@ -1211,39 +1211,42 @@ collect_broadcom() { fi if [ "$bcm_family" == "broadcom-dnx" ]; then - save_bcmcmd_all_ns "\"l2 show\"" "l2.summary" - save_bcmcmd_all_ns "\"field group list\"" "fpgroup.list.summary" - total_fp_groups=34 - for (( fp_grp=0; fp_grp<$total_fp_groups; fp_grp++ )) - do - save_bcmcmd_all_ns "\"field group info group=$fp_grp\"" "fpgroup$fp_grp.info.summary" - done - save_bcmcmd_all_ns "\"dbal table dump table=IPV4_UNICAST_PRIVATE_LPM_FORWARD\"" "l3.ipv4.lpm.summary" - save_bcmcmd_all_ns "\"dbal table dump table=IPV6_UNICAST_PRIVATE_LPM_FORWARD\"" "l3.ipv6.lpm.summary" - save_bcmcmd_all_ns "\"dbal table dump table=IPV4_UNICAST_PRIVATE_HOST\"" "l3.ipv4.host.summary" - save_bcmcmd_all_ns "\"dbal table dump table=IPV6_UNICAST_PRIVATE_HOST\"" "l3.ipv6.host.summary" - save_bcmcmd_all_ns "\"dbal table dump table=SUPER_FEC_1ST_HIERARCHY\"" "l3.egress.fec.summary" - save_bcmcmd_all_ns "\"dbal table dump table=ECMP_TABLE\"" "ecmp.table.summary" - save_bcmcmd_all_ns "\"dbal table dump table=ECMP_GROUP_PROFILE_TABLE\"" "ecmp.group.summary" - save_bcmcmd_all_ns "\"dbal table dump table=ING_VSI_INFO_DB\"" "ing.vsi.summary" - save_bcmcmd_all_ns "\"dbal table dump table=L3_MY_MAC_DA_PREFIXES\"" "l3.mymac.summary" - save_bcmcmd_all_ns "\"dbal table dump table=INGRESS_VLAN_MEMBERSHIP\"" "ing.vlan.summary" - save_bcmcmd_all_ns "\"dbal table dump table=LOCAL_SBC_IN_LIF_MATCH_INFO_SW\"" "sbc.inlif.summary" - save_bcmcmd_all_ns "\"dbal table dump table=SNIF_COMMAND_TABLE\"" "snif.command.summary" - save_bcmcmd_all_ns "\"port mgmt dump full\"" "port.mgmt.summary" - save_bcmcmd_all_ns "\"tm lag\"" "tm.lag.summary" - save_bcmcmd_all_ns "\"pp info fec\"" "pp.fec.summary" - save_bcmcmd_all_ns "\"nif sts\"" "nif.sts.summary" + switch_type=$(sonic-cfggen -d -v "DEVICE_METADATA['localhost']['switch_type']") + if [ $switch_type != "fabric" ]; then + save_bcmcmd_all_ns "\"l2 show\"" "l2.summary" + save_bcmcmd_all_ns "\"field group list\"" "fpgroup.list.summary" + total_fp_groups=34 + for (( fp_grp=0; fp_grp<$total_fp_groups; fp_grp++ )) + do + save_bcmcmd_all_ns "\"field group info group=$fp_grp\"" "fpgroup$fp_grp.info.summary" + done + save_bcmcmd_all_ns "\"dbal table dump table=IPV4_UNICAST_PRIVATE_LPM_FORWARD\"" "l3.ipv4.lpm.summary" + save_bcmcmd_all_ns "\"dbal table dump table=IPV6_UNICAST_PRIVATE_LPM_FORWARD\"" "l3.ipv6.lpm.summary" + save_bcmcmd_all_ns "\"dbal table dump table=IPV4_UNICAST_PRIVATE_HOST\"" "l3.ipv4.host.summary" + save_bcmcmd_all_ns "\"dbal table dump table=IPV6_UNICAST_PRIVATE_HOST\"" "l3.ipv6.host.summary" + save_bcmcmd_all_ns "\"dbal table dump table=SUPER_FEC_1ST_HIERARCHY\"" "l3.egress.fec.summary" + save_bcmcmd_all_ns "\"dbal table dump table=ECMP_TABLE\"" "ecmp.table.summary" + save_bcmcmd_all_ns "\"dbal table dump table=ECMP_GROUP_PROFILE_TABLE\"" "ecmp.group.summary" + save_bcmcmd_all_ns "\"dbal table dump table=ING_VSI_INFO_DB\"" "ing.vsi.summary" + save_bcmcmd_all_ns "\"dbal table dump table=L3_MY_MAC_DA_PREFIXES\"" "l3.mymac.summary" + save_bcmcmd_all_ns "\"dbal table dump table=INGRESS_VLAN_MEMBERSHIP\"" "ing.vlan.summary" + save_bcmcmd_all_ns "\"dbal table dump table=LOCAL_SBC_IN_LIF_MATCH_INFO_SW\"" "sbc.inlif.summary" + save_bcmcmd_all_ns "\"dbal table dump table=SNIF_COMMAND_TABLE\"" "snif.command.summary" + save_bcmcmd_all_ns "\"port mgmt dump full\"" "port.mgmt.summary" + save_bcmcmd_all_ns "\"tm lag\"" "tm.lag.summary" + save_bcmcmd_all_ns "\"pp info fec\"" "pp.fec.summary" + save_bcmcmd_all_ns "\"nif sts\"" "nif.sts.summary" + save_bcmcmd_all_ns "\"tm ing q map\"" "tm.ingress.qmap.summary" + save_bcmcmd_all_ns "\"tm ing vsq resources\"" "tm.ing.vsq.res.summary" + for group in {a..f} + do + save_bcmcmd_all_ns "\"tm ing vsq non g=$group\"" "tm.ing.vsq.non.group-$group.summary" + done + fi save_bcmcmd_all_ns "\"port pm info\"" "port.pm.summary" save_bcmcmd_all_ns "\"conf show\"" "conf.show.summary" save_bcmcmd_all_ns "\"show counters\"" "show.counters.summary" save_bcmcmd_all_ns "\"diag counter g\"" "diag.counter.summary" - save_bcmcmd_all_ns "\"tm ing q map\"" "tm.ingress.qmap.summary" - save_bcmcmd_all_ns "\"tm ing vsq resources\"" "tm.ing.vsq.res.summary" - for group in {a..f} - do - save_bcmcmd_all_ns "\"tm ing vsq non g=$group\"" "tm.ing.vsq.non.group-$group.summary" - done save_bcmcmd_all_ns "\"fabric connectivity\"" "fabric.connect.summary" save_bcmcmd_all_ns "\"port status\"" "port.status.summary" else From 8c742dadd287756acc6e77b6bc7e240ce3da1055 Mon Sep 17 00:00:00 2001 From: saksarav Date: Thu, 9 Feb 2023 13:44:48 -0500 Subject: [PATCH 2/2] [generate_dump] [BCM] fix the review comment - use supervisor flag from platform_env.conf instead of switch_type in DEVICE_METADATA Signed-off-by: saksarav --- scripts/generate_dump | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/scripts/generate_dump b/scripts/generate_dump index 78d3908607..bf9bafdb10 100755 --- a/scripts/generate_dump +++ b/scripts/generate_dump @@ -1211,8 +1211,13 @@ collect_broadcom() { fi if [ "$bcm_family" == "broadcom-dnx" ]; then - switch_type=$(sonic-cfggen -d -v "DEVICE_METADATA['localhost']['switch_type']") - if [ $switch_type != "fabric" ]; then + supervisor=0 + PLATFORM_ENV_CONF=/usr/share/sonic/device/${platform}/platform_env.conf + if [ -f "$PLATFORM_ENV_CONF" ]; then + source $PLATFORM_ENV_CONF + fi + if [[ x"$supervisor" != x"1" ]]; then + save_bcmcmd_all_ns "\"l2 show\"" "l2.summary" save_bcmcmd_all_ns "\"field group list\"" "fpgroup.list.summary" total_fp_groups=34