commit 9fad7fbbd7c0a91a3f669618d373294eb1204457
parent d61c63d6b2e290c96505ac111611bfcf1590f5b4
Author: Broadcom SDK Release <sdk.releases@broadcom.com>
Date: Mon, 11 Mar 2019 14:11:00 -0700
SDK-173397: For PM8x50, check the max speed for the current configuration byt...
Devices: 56980_A0,56980_B0
Module: PortMod
Symptom:
Autoneg advertisement of 100G returns failure
For PM8x50, check the max speed for the current configuration byt
calling bcmi_esw_portctrl_speed_ability_local_max, which fetches the all
the abilities from portmod and returns the maximum speed. Don't allow
speeds beyond the value returned.
Diffstat:
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/sdk-6.5.16/src/bcm/esw/portctrl.c b/sdk-6.5.16/src/bcm/esw/portctrl.c
@@ -3187,7 +3187,6 @@ bcmi_esw_portctrl_speed_get(int unit, bcm_gport_t port, int *speed)
#endif /* PORTMOD_SUPPORT */
}
-#ifdef PORTMOD_PM8X50_SUPPORT
STATIC int
bcmi_esw_portctrl_speed_ability_local_max(int unit, bcm_gport_t port,
int *speed_max)
@@ -3230,7 +3229,6 @@ cleanup:
return BCM_E_UNAVAIL;
#endif /* Portmod Support */
}
-#endif /* PORTMOD_PM8X50_SUPPORT */
/*
* Function:
@@ -3369,6 +3367,7 @@ _bcm_esw_portctrl_speed_validate(int unit, bcm_gport_t port, int speed)
bcm_port_ability_t port_ability, requested_ability;
int mode = -1;
int rv;
+ int max_speed;
/* PM8x50 ports will have their speed config checked in portmod */
if (IS_CD_PORT(unit, port)) {
@@ -3382,6 +3381,14 @@ _bcm_esw_portctrl_speed_validate(int unit, bcm_gport_t port, int speed)
}
}
}
+
+ /* On a speed change validate, don't allow higher speed than
+ * port_speed_max. User needs to flex up */
+ BCM_IF_ERROR_RETURN(bcmi_esw_portctrl_speed_ability_local_max(
+ unit, port, &max_speed));
+ if (speed > max_speed) {
+ return BCM_E_CONFIG;
+ }
return BCM_E_NONE;
}