commit 90066639685d6023e8ec21456bae8770814575b6
parent dae93dff2ad0ca65929aeb163eb18a188e8a312f
Author: Broadcom SDK Release <sdk.releases@broadcom.com>
Date: Wed, 3 Apr 2019 16:02:15 -0700
SDK-174695: In the previous release, ALPM sw states could be out of sync when...
Devices: 56980_A0,56980_B0
Module: ALPM
Symptom:
Inappropriate handling on alpm_bkt_add_to_npvt->alpm_bkt_insert
returning -6 causes alpm SW state corruption.
In the previous release, ALPM sw states could be out of sync when LPM
TCAM reaches full in Parallel mode, and causes mis-forwarding or bucket
split segmentation fault. In current release, this issue has been fixed.
Diffstat:
1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/sdk-6.5.16/src/bcm/esw/alpm2/alpm.c b/sdk-6.5.16/src/bcm/esw/alpm2/alpm.c
@@ -2299,9 +2299,7 @@ alpm_bkt_trie_split(int u, _alpm_cb_t *acb,
&scb_data, *max_spl_cnt);
}
ALPM_IEG(rv);
- /*
- * cli_out("The type of split_node is %s\n",
- */
+
/* Split bucket2A in non-last level could cause misplaced routes in other
* buckets in next level of current level.
* Note: bucket2A: bucketA in Level 2.
@@ -3559,6 +3557,16 @@ alpm_cb_split(int u, _alpm_cb_t *acb, _bcm_defip_cfg_t *lpm_cfg,
&PVT_BKT_INFO(npvt_node), NULL);
ALPM_IEG(rv);
+ if (!ACB_BKT_FIXED_FMT(acb, 1) && ACB_HAS_TCAM(acb)) {
+ /* Check if an extra split is required */
+ rv = alpm_bkt_ent_get(u, vrf_id, acb, npvt_node, lpm_cfg->defip_sub_len, NULL, NULL, 1);
+ if (rv == BCM_E_FULL &&
+ /* Cannot affort another split, so should return here */
+ !bcm_esw_alpm_tcam_avail(u, vrf_id, ipt, PVT_KEY_LEN(npvt_node), 0)) {
+ ALPM_IEG_PRT_EXCEPT(rv, BCM_E_FULL);
+ }
+ }
+
/* 4. HW: insert new pivot
* recursion happens here: BCM_E_FULL is expected
*/