openbcm

Git mirror of https://github.com/Broadcom-Network-Switching-Software/OpenBCM
git clone git://git.finwo.net/mirror/broadcom/openbcm
Log | Files | Refs | README

commit 4eafd715820438ebc8b48ddd6a7a721306f445ce
parent 1d7631e6129f605d7725c0a747e1eeecc01ea21c
Author: Broadcom SDK Release <sdk.releases@broadcom.com>
Date:   Fri, 29 Mar 2019 20:02:16 -0700

SDK-175386: Users will not be allowed to add VLAN ingress only port membershi...

Devices: AllChips
Module: vlan

Symptom:
Observing a "vlan add" command with operation failed. This issue is
observed in a scaled scenario such that all the PORT_BITMAP_PROFILE
table is full.

Users will not be allowed to add VLAN ingress only port membership if
the EGR VLAN port membership add fails. The API would either fail
completely or pass completely.     However, since the API failed, it
will now not show these ports as a part of the VLAN.

Diffstat:
Msdk-6.5.16/src/bcm/esw/firebolt/vlan.c | 38++++++++++++++++++++++++++------------
1 file changed, 26 insertions(+), 12 deletions(-)

diff --git a/sdk-6.5.16/src/bcm/esw/firebolt/vlan.c b/sdk-6.5.16/src/bcm/esw/firebolt/vlan.c @@ -3337,10 +3337,10 @@ _bcm_xgs3_vlan_table_port_add(int unit, bcm_vlan_t vid, pbmp_t pbmp, } else #endif /* BCM_TOMAHAWK3_SUPPORT */ { - soc_mem_pbmp_field_get(unit, table, &vt, PORT_BITMAPf, &cur_pbmp); - BCM_PBMP_OR(cur_pbmp, pbmp); - soc_mem_pbmp_field_set(unit, table, &vt, PORT_BITMAPf, &cur_pbmp); - } + soc_mem_pbmp_field_get(unit, table, &vt, PORT_BITMAPf, &cur_pbmp); + BCM_PBMP_OR(cur_pbmp, pbmp); + soc_mem_pbmp_field_set(unit, table, &vt, PORT_BITMAPf, &cur_pbmp); + } } if (TABLE_HAS_UT_BITMAP(unit, table)) { @@ -3404,10 +3404,10 @@ _bcm_xgs3_vlan_table_port_remove(int unit, bcm_vlan_t vid, pbmp_t pbmp, } else #endif /* BCM_TOMAHAWK3_SUPPORT */ { - soc_mem_pbmp_field_get(unit, table, &vt, PORT_BITMAPf, &cur_pbmp); - BCM_PBMP_REMOVE(cur_pbmp, pbmp); - soc_mem_pbmp_field_set(unit, table, &vt, PORT_BITMAPf, &cur_pbmp); - } + soc_mem_pbmp_field_get(unit, table, &vt, PORT_BITMAPf, &cur_pbmp); + BCM_PBMP_REMOVE(cur_pbmp, pbmp); + soc_mem_pbmp_field_set(unit, table, &vt, PORT_BITMAPf, &cur_pbmp); + } } if (TABLE_HAS_UT_BITMAP(unit, table)) { @@ -3989,6 +3989,8 @@ int bcm_xgs3_vlan_port_add(int unit, bcm_vlan_t vid, pbmp_t pbmp, pbmp_t ubmp, pbmp_t ing_pbmp) { + int rv = BCM_E_NONE; + if (SOC_IS_FBX(unit)) { /* Check for the presence of 'ING_PORT_BITMAPf', this could either reside in VLAN_TABm or in the 'ING_VLAN_VFI_MEMBERSHIPm' if @@ -4007,9 +4009,21 @@ bcm_xgs3_vlan_port_add(int unit, bcm_vlan_t vid, pbmp_t pbmp, pbmp_t ubmp, } if (BCM_VLAN_VALID(vid)) { - BCM_IF_ERROR_RETURN - (_bcm_xgs3_vlan_table_port_add(unit, vid, pbmp, ubmp, - ing_pbmp, VLAN_TABLE(unit))); + rv = _bcm_xgs3_vlan_table_port_add( + unit, vid, pbmp, ubmp, ing_pbmp, VLAN_TABLE(unit)); + if (BCM_FAILURE(rv)) { +#if defined(BCM_TOMAHAWK3_SUPPORT) + /* For TH3, if the add to the INGRESS VLAN table fails + * revert the add to the EGR VLAN table done before. + */ + if (SOC_IS_TOMAHAWK3(unit)) { + BCM_IF_ERROR_RETURN( + _bcm_xgs3_vlan_table_port_remove( + unit, vid, pbmp, ubmp, ing_pbmp, EGR_VLANm)); + } +#endif /* BCM_TOMAHAWK3_SUPPORT */ + return rv; + } } #if defined(BCM_TRIDENT3_SUPPORT) if (soc_feature(unit, soc_feature_vlan_vfi_untag_profile)) { @@ -4026,7 +4040,7 @@ bcm_xgs3_vlan_port_add(int unit, bcm_vlan_t vid, pbmp_t pbmp, pbmp_t ubmp, unit, vid, FALSE, TRUE, ing_pbmp)); } #endif /* BCM_TRIDENT2PLUS_SUPPORT */ - return BCM_E_NONE; + return rv; } int