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 f6c24f2f508aeea306a2e9f5ba93f476367d9010
parent 7c3d3a5e4d69009d175d7596148afbe0355bfeff
Author: Broadcom SDK Release <sdk.releases@broadcom.com>
Date:   Mon,  8 Jul 2019 15:54:46 -0700

SDK-184250: Added code to parse NH fields from IFP_ACTIONS view for TH3.

Devices: 56980_A0
Module: L3

Symptom:
bcm_l3_egress_find returns -7 when the egress object is created with
BCM_L3_FLAGS2_FIELD_ONLY

Diffstat:
Msdk-6.5.16/src/bcm/esw/firebolt/l3.c | 42++++++++++++++++++++++++++++++++++++++++++
1 file changed, 42 insertions(+), 0 deletions(-)

diff --git a/sdk-6.5.16/src/bcm/esw/firebolt/l3.c b/sdk-6.5.16/src/bcm/esw/firebolt/l3.c @@ -29096,6 +29096,7 @@ _bcm_xgs3_th3_nh_entry_parse(int unit, uint32 *ing_entry_ptr, th3_mem_ING_L3_NEXT_HOP_t *ing_ent; th3_mem_EGR_L3_NEXT_HOP_t *egr_ent; th3_mem_EGR_L3_NEXT_HOP_2_t *egr2_ent; + soc_mem_t mem; /* Table location memory. */ ing_ent = (th3_mem_ING_L3_NEXT_HOP_t *)ing_entry_ptr; egr_ent = (th3_mem_EGR_L3_NEXT_HOP_t *)egr_entry_ptr; @@ -29264,6 +29265,47 @@ _bcm_xgs3_th3_nh_entry_parse(int unit, uint32 *ing_entry_ptr, nh_entry->intf_class = egr_ent->L3__CLASS_ID; + /* Get next hop table memory location. */ + mem = BCM_XGS3_L3_MEM(unit, nh); + + if (soc_feature(unit, soc_feature_nh_for_ifp_actions) && + (0x2 == ent_type) && _BCM_L3_FIELD_ONLY == + BCM_XGS3_L3_ENT_FLAG(BCM_XGS3_L3_TBL_PTR(unit, next_hop), index)) { + + /* Get mac address. */ + soc_mem_mac_addr_get(unit, EGR_L3_NEXT_HOPm, egr_entry_ptr, + IFP_ACTIONS__MAC_ADDRESSf, nh_entry->mac_addr); + + + nh_entry->flags2 |= BCM_L3_FLAGS2_FIELD_ONLY; + + if (SOC_MEM_FIELD_VALID(unit, mem, IFP_ACTIONS__L3_UC_VLAN_DISABLEf)) { + if (soc_mem_field32_get(unit, mem, egr_entry_ptr, + IFP_ACTIONS__L3_UC_VLAN_DISABLEf)) { + nh_entry->flags |= BCM_L3_KEEP_VLAN; + } + } + + if (SOC_MEM_FIELD_VALID(unit, mem, IFP_ACTIONS__L3_UC_TTL_DISABLEf)) { + if (soc_mem_field32_get(unit, mem, egr_entry_ptr, + IFP_ACTIONS__L3_UC_TTL_DISABLEf)) { + nh_entry->flags |= BCM_L3_KEEP_TTL; + } + } + + if (SOC_MEM_FIELD_VALID(unit, mem, IFP_ACTIONS__L3_UC_DA_DISABLEf)) { + if (soc_mem_field32_get(unit, mem, egr_entry_ptr, + IFP_ACTIONS__L3_UC_DA_DISABLEf)) { + nh_entry->flags |= BCM_L3_KEEP_DSTMAC; + } + } + if (SOC_MEM_FIELD_VALID(unit, mem, IFP_ACTIONS__L3_UC_SA_DISABLEf)) { + if (soc_mem_field32_get(unit, mem, egr_entry_ptr, + IFP_ACTIONS__L3_UC_SA_DISABLEf)) { + nh_entry->flags |= BCM_L3_KEEP_SRCMAC; + } + } + } return (BCM_E_NONE); }