commit bc7d49568c53dbd730c517f47331c00ec35b8bc4
parent 96c788e80e42083538be34922249e9dc5f1055b9
Author: Broadcom SDK Release <sdk.releases@broadcom.com>
Date: Mon, 20 Jan 2020 16:05:23 -0800
SDK-180514: Added cos map profile accounting in port_attach and port_detach
Devices: 56980_A0,56980_B0
Module: cosq
Symptom:
bcm_cosq_gport_mapping_set is returning -7 during flex port operations
and changing the default cos map from default to non default.
Diffstat:
1 file changed, 15 insertions(+), 3 deletions(-)
diff --git a/sdk-6.5.16/src/bcm/tomahawk3/cosq.c b/sdk-6.5.16/src/bcm/tomahawk3/cosq.c
@@ -9344,6 +9344,8 @@ bcm_th3_cosq_port_detach(int unit, bcm_port_t port)
{
soc_info_t *si = &SOC_INFO(unit);
_bcm_th3_cosq_port_info_t *port_info = NULL;
+ uint32 profile_index;
+ uint32 entry[SOC_MAX_MEM_WORDS];
if (IS_CPU_PORT(unit, port) || IS_LB_PORT(unit, port) ||
IS_MANAGEMENT_PORT(unit, port)) {
@@ -9367,6 +9369,14 @@ bcm_th3_cosq_port_detach(int unit, bcm_port_t port)
/* Reset soc gport tree on port */
BCM_IF_ERROR_RETURN(soc_tomahawk3_cosq_port_info_init(unit, port));
+ /* Decrease the reference of COS_MAP_PROFILE */
+ SOC_IF_ERROR_RETURN
+ (soc_mem_read(unit, COS_MAP_SELm, MEM_BLOCK_ALL, port, &entry));
+ profile_index = soc_mem_field32_get(unit, COS_MAP_SELm, &entry, SELECTf);
+ SOC_IF_ERROR_RETURN
+ (soc_profile_mem_delete(unit, _bcm_th3_cos_map_profile[unit],
+ profile_index * 16));
+
/* Clear cosq */
si->port_num_cosq[port] = 0;
si->port_cosq_base[port] = 0;
@@ -9420,9 +9430,11 @@ bcm_th3_cosq_port_attach(int unit, bcm_port_t port)
"bcm_th3_cosq_port_attach port %d\n"),
port));
- /* Increase the reference of defalt PRIO2COS_PROFILE */
-
- /* update PORT_LLFC_CFG as default profile might not be 0 */
+ /* Increase the reference of default COS_MAP_PROFILE */
+ BCM_IF_ERROR_RETURN
+ (soc_mem_field32_modify(unit, COS_MAP_SELm, port, SELECTf, 0));
+ BCM_IF_ERROR_RETURN
+ (soc_profile_mem_reference(unit, _bcm_th3_cos_map_profile[unit], 0, 0));
/* set scheduler profile to port 0 */
reg = MMU_PPSCH_SCHQ_MMUQ_PROFILEr;