[dpdk-dev] net/bnxt: fix setting the auto link speed mask

Message ID 20180208173629.43841-1-ajit.khaparde@broadcom.com (mailing list archive)
State Accepted, archived
Delegated to: Ferruh Yigit
Headers

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Ajit Khaparde Feb. 8, 2018, 5:36 p.m. UTC
  Set the auto link speed only when force speed is not desired.
Fixes: fe017534dfd4 ("net/bnxt: fix link speed setting with autoneg off")

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
 drivers/net/bnxt/bnxt_hwrm.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
  

Comments

Ferruh Yigit Feb. 8, 2018, 5:43 p.m. UTC | #1
On 2/8/2018 5:36 PM, Ajit Khaparde wrote:
> Set the auto link speed only when force speed is not desired.
> Fixes: fe017534dfd4 ("net/bnxt: fix link speed setting with autoneg off")
> 
> Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>

Squashed into relevant commit in next-net, thanks.
  

Patch

diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c
index 4dcdf36a5..b7843afe6 100644
--- a/drivers/net/bnxt/bnxt_hwrm.c
+++ b/drivers/net/bnxt/bnxt_hwrm.c
@@ -831,7 +831,8 @@  static int bnxt_hwrm_port_phy_cfg(struct bnxt *bp, struct bnxt_link_info *conf)
 				HWRM_PORT_PHY_CFG_INPUT_AUTO_MODE_ALL_SPEEDS;
 		}
 		/* AutoNeg - Advertise speeds specified. */
-		if (conf->auto_link_speed_mask) {
+		if (conf->auto_link_speed_mask &&
+		    !(conf->phy_flags & HWRM_PORT_PHY_CFG_INPUT_FLAGS_FORCE)) {
 			req.auto_mode =
 				HWRM_PORT_PHY_CFG_INPUT_AUTO_MODE_SPEED_MASK;
 			req.auto_link_speed_mask =