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 a7a1d30d7717ce6944c99f2cdbe2fe4532fe96b8
parent 97acd8086844444d28bc170591ff7dd057e68254
Author: Broadcom SDK Release <sdk.releases@broadcom.com>
Date:   Tue,  7 May 2019 19:47:37 -0700

SDK-178552: This change does not invoke L2 insert call if the L2 table is ful...

Devices: 56980_A0,56980_B0
Module: L2

Symptom:
SDK is raising DELETE callback notifications (BCM_L2_CALLBACK_DELETE)
whenever there is an internal hash movement due to hash multi move depth
configuration. And, it is seen that the ADD notifications are invoked
first and and then the DELETE notifications are invoked for the entries
that are internally moved. As a result, some of the MAC entries are
deleted in the application and so i could never scale more than ~7500
MAC entries

This change does not invoke L2 insert call if the L2 table is full. Only
when there is space in L2 table, we perform L2 table insertion. This
applies to both interrupt and polled modes. Any modification to L2 table
must be done through L2 APIs, or 'l2' command.

Diffstat:
Msdk-6.5.16/src/soc/esw/tomahawk3/l2x.c | 21++++++++++++++++++++-
1 file changed, 20 insertions(+), 1 deletion(-)

diff --git a/sdk-6.5.16/src/soc/esw/tomahawk3/l2x.c b/sdk-6.5.16/src/soc/esw/tomahawk3/l2x.c @@ -1034,6 +1034,12 @@ _soc_th3_learn_cache_entry_process(int unit, soc_mem_t mem; soc_l2_lrn_avl_info_t k; int invalidated = FALSE; + int curr_l2_table_entries; + int max_l2_table_entries; + int l2copyno; + + max_l2_table_entries = soc_mem_index_count(unit, L2Xm); + l2copyno = SOC_MEM_BLOCK_ANY(unit, L2Xm); mem = SOC_MEM_UNIQUE_ACC(unit, L2_LEARN_CACHEm)[pipe]; @@ -1110,7 +1116,20 @@ _soc_th3_learn_cache_entry_process(int unit, /* Insert L2 entry in h/w */ soc_mem_lock(unit, L2Xm); - rv = soc_mem_insert(unit, L2Xm, MEM_BLOCK_ALL, &l2x_entry); + curr_l2_table_entries = SOP_MEM_STATE(unit, L2Xm).count[l2copyno]; + + /* If there is no space in the L2 table, do not issue insert. Note + * that current L2 table size is dynamically changing; entries can + * be added/deleted though other sources like application thread + * (using L2 APIs), cmd shell, other internal SDK modules and so on. + * So the current table enttries is only a tentative (but closer to + * accurate) value + */ + rv = SOC_E_NONE; + if ((curr_l2_table_entries >= 0) && + (curr_l2_table_entries < max_l2_table_entries)) { + rv = soc_mem_insert(unit, L2Xm, MEM_BLOCK_ALL, &l2x_entry); + } soc_mem_unlock(unit, L2Xm); /* AVL tree will be updated through soc_th3_l2x_shadow_callback */