commit 7731c69df2a9be0a293831182781822f2d0c5f65
parent b7a10731712b3dda82ab41ae85b3a38e2c5944eb
Author: Broadcom SDK Release <sdk.releases@broadcom.com>
Date: Mon, 4 Feb 2019 12:05:45 -0800
SDK-169826: strict priority setting in schedq_mapping was incorrectly being u...
Devices: 56980_A0,56980_B0
Module: MMU
Symptom:
Setting scheduler profile using API bcm_cosq_port_profile_set not
working correctly
strict priority setting in schedq_mapping was incorrectly being used to
modify scheduler policy
Diffstat:
4 files changed, 42 insertions(+), 93 deletions(-)
diff --git a/sdk-6.5.16/include/soc/tomahawk3.h b/sdk-6.5.16/include/soc/tomahawk3.h
@@ -559,11 +559,11 @@ extern int soc_tomahawk3_cosq_port_info_init(int unit, int port_num);
extern int soc_tomahawk3_scheduler_init(int unit);
extern int soc_tomahawk3_sched_update_init(int unit, int profile, int *L0, int *schedq,
- int *mmuq, int *cos, int *sp_child, int* sp_parent, int* fc_is_us_only);
+ int *mmuq, int *cos, int *strict_priority, int* fc_is_us_only);
extern int
soc_profile_port_list_get(int unit, int profile, int port_in_profile[]);
extern int
-soc_cosq_sched_policy_init(int unit, int profile, int* sp_child, int* sp_parent);
+soc_cosq_sched_policy_init(int unit, int profile);
extern int soc_tomahawk3_schduler_hier_show(int unit, int port);
extern int soc_tomahawk3_sched_update_flex_per_port(int unit, int port, int profile, int *L0, int *schedq,
int *mmuq, int *cos);
@@ -575,9 +575,9 @@ extern int soc_tomahawk3_get_sched_profile_max_cos(int unit, int profile);
/* Warmboot helper functions */
extern int soc_tomahawk3_sched_update_reinit(int unit, int profile, int *L0, int *schedq,
- int *mmuq, int *cos, int *sp_child, int* sp_parent, int* fc_is_us_only);
+ int *mmuq, int *cos, int *strict_priority, int* fc_is_us_only);
extern int
-soc_cosq_sched_policy_reinit(int unit, int profile, int* sp_child, int* sp_parent);
+soc_cosq_sched_policy_reinit(int unit, int profile);
extern int soc_tomahawk3_sched_profile_attach_reinit(int unit, soc_port_t port, int profile);
typedef enum {
@@ -1310,7 +1310,7 @@ extern int soc_tomahawk3_sched_profile_set(int unit, int profile, int L0, int sc
int mmuq);
extern int _soc_scheduler_profile_mapping_setup(int unit, _soc_mmu_cfg_scheduler_profile_t *sched_profile,
int profile_index, int *L0, int *schedq, int *mmuq,
- int *cos_list, int *sp_child, int *sp_parent, int *fc_is_uc_only);
+ int *cos_list, int *strict_priority, int *fc_is_uc_only);
extern int soc_tomahawk3_profile_exists(int unit, int profile);
extern int soc_tomahawk3_sched_profile_attach(int unit, soc_port_t port, int profile);
diff --git a/sdk-6.5.16/src/bcm/tomahawk3/cosq.c b/sdk-6.5.16/src/bcm/tomahawk3/cosq.c
@@ -6303,8 +6303,7 @@ bcm_tomahawk3_cosq_schedq_mapping_set(int unit, int profile_index,
int schedq[_BCM_TH3_COS_MAX];
int mmuq[_BCM_TH3_COS_MAX];
int cos_list[_BCM_TH3_COS_MAX];
- int sp_child[_BCM_TH3_COS_MAX];
- int sp_parent[_BCM_TH3_COS_MAX];
+ int strict_priority[_BCM_TH3_COS_MAX];
int fc_is_uc_only[_BCM_TH3_COS_MAX];
bcm_port_t port;
int rv = BCM_E_NONE;
@@ -6344,7 +6343,7 @@ bcm_tomahawk3_cosq_schedq_mapping_set(int unit, int profile_index,
rv = _soc_scheduler_profile_mapping_setup(unit,
sched_profile, profile_index, L0, schedq, mmuq, cos_list,
- sp_child, sp_parent, fc_is_uc_only);
+ strict_priority, fc_is_uc_only);
if (rv != BCM_E_NONE) {
goto exit;
}
@@ -6353,7 +6352,7 @@ bcm_tomahawk3_cosq_schedq_mapping_set(int unit, int profile_index,
LOG_INFO(BSL_LS_BCM_COSQ,
(BSL_META_U(unit, "Profile %d cos %d L0 %d schedq %d mmuq %d cos_list %d\n"),
profile_index, cosq_idx, L0[cosq_idx], schedq[cosq_idx], mmuq[cosq_idx], cos_list[cosq_idx]));
- rv = soc_tomahawk3_sched_update_init(unit, profile_index, L0, schedq, mmuq, cos_list, sp_child, sp_parent, fc_is_uc_only);
+ rv = soc_tomahawk3_sched_update_init(unit, profile_index, L0, schedq, mmuq, cos_list, strict_priority, fc_is_uc_only);
if (rv != BCM_E_NONE) {
goto exit;
}
@@ -10890,8 +10889,7 @@ _bcm_th3_cosq_scheduler_reinit(int unit)
int schedq[_BCM_TH3_COS_MAX];
int mmuq[_BCM_TH3_COS_MAX];
int cos_list[_BCM_TH3_COS_MAX];
- int sp_child[_BCM_TH3_COS_MAX];
- int sp_parent[_BCM_TH3_COS_MAX];
+ int strict_priority[_BCM_TH3_COS_MAX];
int fc_is_uc_only[_BCM_TH3_COS_MAX];
int rv = BCM_E_NONE;
@@ -10944,7 +10942,7 @@ _bcm_th3_cosq_scheduler_reinit(int unit)
rv = _soc_scheduler_profile_mapping_setup(unit,
sched_profile, profile_idx, L0, schedq, mmuq, cos_list,
- sp_child, sp_parent, fc_is_uc_only);
+ strict_priority, fc_is_uc_only);
if (rv != BCM_E_NONE) {
goto exit;
@@ -10954,7 +10952,7 @@ _bcm_th3_cosq_scheduler_reinit(int unit)
LOG_INFO(BSL_LS_BCM_COSQ,
(BSL_META_U(unit, "Profile %d cos %d L0 %d schedq %d mmuq %d cos_list %d\n"),
profile_idx, cosq_idx, L0[cosq_idx], schedq[cosq_idx], mmuq[cosq_idx], cos_list[cosq_idx]));
- rv = soc_tomahawk3_sched_update_reinit(unit, profile_idx, L0, schedq, mmuq, cos_list, sp_child, sp_parent, fc_is_uc_only);
+ rv = soc_tomahawk3_sched_update_reinit(unit, profile_idx, L0, schedq, mmuq, cos_list, strict_priority, fc_is_uc_only);
if (rv != BCM_E_NONE) {
goto exit;
}
diff --git a/sdk-6.5.16/src/soc/esw/tomahawk3/traffic_manager.c b/sdk-6.5.16/src/soc/esw/tomahawk3/traffic_manager.c
@@ -3202,7 +3202,7 @@ soc_tomahawk3_mmuq_to_schedq_profile_set_reinit(int unit, int profile, int sched
*/
int
soc_tomahawk3_sched_update_init(int unit, int profile, int *L0, int *schedq,
- int *mmuq, int *cos, int *sp_child, int* sp_parent, int* fc_is_uc_only)
+ int *mmuq, int *cos, int *strict_priority, int* fc_is_uc_only)
{
int port_in_profile[SOC_TH3_MAX_NUM_PORTS] = {0};
int port, queue;
@@ -3232,7 +3232,7 @@ soc_tomahawk3_sched_update_init(int unit, int profile, int *L0, int *schedq,
continue;
}
th3_sched_profile_info[unit][profile][cosq_index].cos = cos[queue];
- th3_sched_profile_info[unit][profile][cosq_index].strict_priority = sp_child[queue];
+ th3_sched_profile_info[unit][profile][cosq_index].strict_priority = strict_priority[queue];
th3_sched_profile_info[unit][profile][cosq_index].fc_is_uc_only = fc_is_uc_only[queue];
if (th3_sched_profile_info[unit][profile][cosq_index].mmuq[0] == -1) {
th3_sched_profile_info[unit][profile][cosq_index].mmuq[0] = mmuq[queue];
@@ -3251,7 +3251,7 @@ soc_tomahawk3_sched_update_init(int unit, int profile, int *L0, int *schedq,
}
SOC_IF_ERROR_RETURN
- (soc_cosq_sched_policy_init(unit, profile, sp_child, sp_parent));
+ (soc_cosq_sched_policy_init(unit, profile));
PBMP_ALL_ITER(unit, port) {
if (port_in_profile[port]) {
@@ -3276,7 +3276,7 @@ soc_tomahawk3_sched_update_init(int unit, int profile, int *L0, int *schedq,
*/
int
soc_tomahawk3_sched_update_reinit(int unit, int profile, int *L0, int *schedq,
- int *mmuq, int *cos, int *sp_child, int* sp_parent, int* fc_is_uc_only)
+ int *mmuq, int *cos, int *strict_priority, int* fc_is_uc_only)
{
int port_in_profile[SOC_TH3_MAX_NUM_PORTS] = {0};
int port, queue;
@@ -3309,7 +3309,7 @@ soc_tomahawk3_sched_update_reinit(int unit, int profile, int *L0, int *schedq,
}
SOC_IF_ERROR_RETURN
- (soc_cosq_sched_policy_reinit(unit, profile, sp_child, sp_parent));
+ (soc_cosq_sched_policy_reinit(unit, profile));
PBMP_ALL_ITER(unit, port) {
if (port_in_profile[port]) {
@@ -3415,8 +3415,7 @@ soc_cosq_hierarchy_init(int unit)
int schedq[SOC_TH3_NUM_GP_QUEUES];
int mmuq[SOC_TH3_NUM_GP_QUEUES];
int cos_list[SOC_TH3_NUM_GP_QUEUES];
- int sp_child[SOC_TH3_NUM_GP_QUEUES];
- int sp_parent[SOC_TH3_NUM_GP_QUEUES];
+ int strict_priority[SOC_TH3_NUM_GP_QUEUES];
int fc_is_uc_only[SOC_TH3_NUM_GP_QUEUES];
int sched_port_profile_map[SOC_TH3_MAX_NUM_PORTS];
int port_in_profile[SOC_TH3_MAX_NUM_PORTS] = {0};
@@ -3473,7 +3472,7 @@ soc_cosq_hierarchy_init(int unit)
}
rv = _soc_scheduler_profile_mapping_setup(unit, sched_profile, profile,
- L0, schedq, mmuq, cos_list, sp_child, sp_parent, fc_is_uc_only);
+ L0, schedq, mmuq, cos_list, strict_priority, fc_is_uc_only);
if (rv != SOC_E_NONE) {
goto exit;
}
@@ -3486,7 +3485,7 @@ soc_cosq_hierarchy_init(int unit)
continue;
}
th3_sched_profile_info[unit][profile][cosq_index].cos = cos_list[queue];
- th3_sched_profile_info[unit][profile][cosq_index].strict_priority = sp_child[queue];
+ th3_sched_profile_info[unit][profile][cosq_index].strict_priority = strict_priority[queue];
th3_sched_profile_info[unit][profile][cosq_index].fc_is_uc_only = fc_is_uc_only[queue];
if (th3_sched_profile_info[unit][profile][cosq_index].mmuq[0] == -1) {
th3_sched_profile_info[unit][profile][cosq_index].mmuq[0] = mmuq[queue];
@@ -3502,7 +3501,7 @@ soc_cosq_hierarchy_init(int unit)
}
L0_TO_COSQ_MAPPING[unit][profile][queue] = cos_list[queue];
}
- rv = soc_cosq_sched_policy_init(unit, profile, sp_child, sp_parent);
+ rv = soc_cosq_sched_policy_init(unit, profile);
if (rv != SOC_E_NONE) {
goto exit;
}
@@ -3554,15 +3553,13 @@ exit:
*Purpose: Initialize scheduling discipline in HW and SW structure based on config bcm
*/
int
-soc_cosq_sched_policy_init(int unit, int profile, int* sp_child, int* sp_parent)
+soc_cosq_sched_policy_init(int unit, int profile)
{
soc_reg_t reg = INVALIDr;
uint64 rval;
int queue_num;
soc_port_t port;
int port_in_profile[SOC_TH3_MAX_NUM_PORTS] = {0};
- int sp_l0_child = 0;
- int sp_l0_parent = 0;
if (profile < 0 || profile >= SOC_TH3_MAX_NUM_SCHED_PROFILE) {
return SOC_E_PARAM;
@@ -3571,17 +3568,6 @@ soc_cosq_sched_policy_init(int unit, int profile, int* sp_child, int* sp_parent)
/*check which ports is using this profile*/
soc_profile_port_list_get(unit, profile, port_in_profile);
- if ((sp_child == NULL) ||
- (sp_parent == NULL)) {
- return SOC_E_PARAM;
- }
-
- for (queue_num = 0; queue_num < SOC_TH3_NUM_GP_QUEUES; queue_num++) {
- sp_l0_child |= sp_child[queue_num] << queue_num;
- sp_l0_parent |= sp_parent[queue_num] << queue_num;
- }
-
-
PBMP_ALL_ITER(unit, port) {
/* Max number of device ports in TH3 is 160*/
if (!IS_CPU_PORT(unit, port)) {
@@ -3590,25 +3576,15 @@ soc_cosq_sched_policy_init(int unit, int profile, int* sp_child, int* sp_parent)
reg = MMU_QSCH_PORT_CONFIGr;
SOC_IF_ERROR_RETURN(soc_reg64_get(unit, reg, port, 0, &rval));
soc_reg64_field32_set(unit, reg, &rval, ENABLE_WRRf, 1);
- soc_reg64_field32_set(unit, reg, &rval, SP_L0_CHILDf, sp_l0_child);
- soc_reg64_field32_set(unit, reg, &rval, SP_L0_PARENTf, sp_l0_parent);
+ soc_reg64_field32_set(unit, reg, &rval, SP_L0_CHILDf, 0);
+ soc_reg64_field32_set(unit, reg, &rval, SP_L0_PARENTf, 0);
SOC_IF_ERROR_RETURN
(soc_reg64_set(unit, reg, port, 0, rval));
for (queue_num = 0; queue_num < SOC_TH3_NUM_GP_QUEUES; queue_num++) {
- if ((sp_l0_child & (1 << queue_num)) == 0) {
- th3_cosq_mmu_info[unit]->th3_port_info[port].L0[queue_num].
- sched_policy = SOC_TH3_SCHED_MODE_WRR;
- } else {
- th3_cosq_mmu_info[unit]->th3_port_info[port].L0[queue_num].
- sched_policy = SOC_TH3_SCHED_MODE_STRICT;
- }
- if ((sp_l0_parent & (1 << queue_num)) == 0) {
- th3_cosq_mmu_info[unit]->th3_port_info[port].L1[queue_num].
- sched_policy = SOC_TH3_SCHED_MODE_WRR;
- } else {
- th3_cosq_mmu_info[unit]->th3_port_info[port].L1[queue_num].
- sched_policy = SOC_TH3_SCHED_MODE_STRICT;
- }
+ th3_cosq_mmu_info[unit]->th3_port_info[port].L0[queue_num].
+ sched_policy = SOC_TH3_SCHED_MODE_WRR;
+ th3_cosq_mmu_info[unit]->th3_port_info[port].L1[queue_num].
+ sched_policy = SOC_TH3_SCHED_MODE_WRR;
}
} else {
reg = MMU_QSCH_CPU_PORT_CONFIGr;
@@ -3636,13 +3612,11 @@ soc_cosq_sched_policy_init(int unit, int profile, int* sp_child, int* sp_parent)
*Purpose: Initialize scheduling discipline in HW and SW structure based on config bcm
*/
int
-soc_cosq_sched_policy_reinit(int unit, int profile, int* sp_child, int* sp_parent)
+soc_cosq_sched_policy_reinit(int unit, int profile)
{
int queue_num;
soc_port_t port;
int port_in_profile[SOC_TH3_MAX_NUM_PORTS] = {0};
- int sp_l0_child = 0;
- int sp_l0_parent = 0;
if (profile < 0 || profile >= SOC_TH3_MAX_NUM_SCHED_PROFILE) {
return SOC_E_PARAM;
@@ -3651,37 +3625,16 @@ soc_cosq_sched_policy_reinit(int unit, int profile, int* sp_child, int* sp_paren
/*check which ports is using this profile*/
soc_profile_port_list_get(unit, profile, port_in_profile);
- if ((sp_child == NULL) ||
- (sp_parent == NULL)) {
- return SOC_E_PARAM;
- }
-
- for (queue_num = 0; queue_num < SOC_TH3_NUM_GP_QUEUES; queue_num++) {
- sp_l0_child |= sp_child[queue_num] << queue_num;
- sp_l0_parent |= sp_parent[queue_num] << queue_num;
- }
-
-
PBMP_ALL_ITER(unit, port) {
/* Max number of device ports in TH3 is 160*/
if (!IS_CPU_PORT(unit, port)) {
if (port_in_profile[port] == 0)
continue;
for (queue_num = 0; queue_num < SOC_TH3_NUM_GP_QUEUES; queue_num++) {
- if ((sp_l0_child & (1 << queue_num)) == 0) {
- th3_cosq_mmu_info[unit]->th3_port_info[port].L0[queue_num].
- sched_policy = SOC_TH3_SCHED_MODE_WRR;
- } else {
- th3_cosq_mmu_info[unit]->th3_port_info[port].L0[queue_num].
- sched_policy = SOC_TH3_SCHED_MODE_STRICT;
- }
- if ((sp_l0_parent & (1 << queue_num)) == 0) {
- th3_cosq_mmu_info[unit]->th3_port_info[port].L1[queue_num].
- sched_policy = SOC_TH3_SCHED_MODE_WRR;
- } else {
- th3_cosq_mmu_info[unit]->th3_port_info[port].L1[queue_num].
- sched_policy = SOC_TH3_SCHED_MODE_STRICT;
- }
+ th3_cosq_mmu_info[unit]->th3_port_info[port].L0[queue_num].
+ sched_policy = SOC_TH3_SCHED_MODE_WRR;
+ th3_cosq_mmu_info[unit]->th3_port_info[port].L1[queue_num].
+ sched_policy = SOC_TH3_SCHED_MODE_WRR;
}
} else {
for (queue_num = 0; queue_num < SOC_TH3_NUM_GP_QUEUES; queue_num++) {
diff --git a/sdk-6.5.16/src/soc/esw/tomahawk3/traffic_manager/scheduler.c b/sdk-6.5.16/src/soc/esw/tomahawk3/traffic_manager/scheduler.c
@@ -292,11 +292,11 @@ _soc_mmu_tomahawk3_scheduler_profile_check(int unit,
int _soc_scheduler_profile_mapping_setup(int unit, _soc_mmu_cfg_scheduler_profile_t *sched_profile,
int profile_index, int *L0, int *schedq, int *mmuq,
- int *cos_list, int *sp_child, int *sp_parent, int *fc_is_uc_only)
+ int *cos_list, int *strict_priority, int *fc_is_uc_only)
{
int mcq_base, ucq_base;
int total_numq, num_ucq, num_mcq;
- int strict_priority, fc_uc;
+ int sp, fc_uc;
int cosq_idx;
int current_q_pos = 0;
@@ -307,8 +307,7 @@ int _soc_scheduler_profile_mapping_setup(int unit, _soc_mmu_cfg_scheduler_profil
(L0 == NULL) ||
(schedq == NULL) ||
(cos_list == NULL) ||
- (sp_child == NULL) ||
- (sp_parent == NULL) ||
+ (strict_priority == NULL) ||
(fc_is_uc_only == NULL) ||
(mmuq == NULL)) {
return SOC_E_MEMORY;
@@ -320,8 +319,7 @@ int _soc_scheduler_profile_mapping_setup(int unit, _soc_mmu_cfg_scheduler_profil
for (cosq_idx = 0; cosq_idx < SOC_TH3_COS_MAX; cosq_idx++) {
cos_list[cosq_idx] = -1;
- sp_child[cosq_idx] = 0;
- sp_parent[cosq_idx] = 0;
+ strict_priority[cosq_idx] = 0;
fc_is_uc_only[cosq_idx] = 0;
}
@@ -338,7 +336,7 @@ int _soc_scheduler_profile_mapping_setup(int unit, _soc_mmu_cfg_scheduler_profil
sched_profile[profile_index].num_multicast_queue[cosq_idx];
num_ucq = sched_profile[profile_index].num_unicast_queue[cosq_idx];
num_mcq = sched_profile[profile_index].num_multicast_queue[cosq_idx];
- strict_priority = sched_profile[profile_index].strict_priority[cosq_idx];
+ sp = sched_profile[profile_index].strict_priority[cosq_idx];
fc_uc = sched_profile[profile_index].flow_control_only_unicast[cosq_idx];
if (total_numq == 0) {
@@ -356,8 +354,8 @@ int _soc_scheduler_profile_mapping_setup(int unit, _soc_mmu_cfg_scheduler_profil
schedq[current_q_pos+1] = current_q_pos+1;
cos_list[current_q_pos] = cosq_idx;
cos_list[current_q_pos+1] = cosq_idx;
- sp_child[current_q_pos] = strict_priority;
- sp_child[current_q_pos+1] = strict_priority;
+ strict_priority[current_q_pos] = sp;
+ strict_priority[current_q_pos+1] = sp;
fc_is_uc_only[current_q_pos] = fc_uc;
fc_is_uc_only[current_q_pos+1] = fc_uc;
if (num_ucq == 2) {
@@ -373,7 +371,7 @@ int _soc_scheduler_profile_mapping_setup(int unit, _soc_mmu_cfg_scheduler_profil
L0[current_q_pos] = current_q_pos;
schedq[current_q_pos] = current_q_pos;
cos_list[current_q_pos] = cosq_idx;
- sp_child[current_q_pos] = strict_priority;
+ strict_priority[current_q_pos] = sp;
fc_is_uc_only[current_q_pos] = fc_uc;
if (num_ucq == 1) {
mmuq[current_q_pos] = ucq_base++;
@@ -389,9 +387,9 @@ int _soc_scheduler_profile_mapping_setup(int unit, _soc_mmu_cfg_scheduler_profil
for (cosq_idx = 0; cosq_idx < SOC_TH3_COS_MAX; cosq_idx++) {
LOG_INFO(BSL_LS_SOC_COSQ,
- (BSL_META_U(unit, "Profile %d cos %d L0 %d schedq %d mmuq %d cos_list %d sp_child %d, sp_parent %d\n"),
+ (BSL_META_U(unit, "Profile %d cos %d L0 %d schedq %d mmuq %d cos_list %d strict_priority %d\n"),
profile_index, cosq_idx, L0[cosq_idx], schedq[cosq_idx],
- mmuq[cosq_idx], cos_list[cosq_idx], sp_child[cosq_idx], sp_parent[cosq_idx]));
+ mmuq[cosq_idx], cos_list[cosq_idx], strict_priority[cosq_idx]));
}
return SOC_E_NONE;
}