[dpdk-dev] [PATCH v2 06/17] net/bnxt: fix 40G link failure for Thor

Ajit Khaparde ajit.khaparde at broadcom.com
Wed Oct 2 07:54:12 CEST 2019


From: Santoshkumar Karanappa Rastapur <santosh.rastapur at broadcom.com>

Link autonegotiation for 40G is not supported by Thor.
Hence speed needs to be forced and autoneg disabled to configure 40G speed.

Fixes: f8168ca0e690 ("net/bnxt: support thor controller")
Reviewed-by: Ajit Khaparde <ajit.khaparde at broadcom.com>
Signed-off-by: Santoshkumar Karanappa Rastapur <santosh.rastapur at broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde at broadcom.com>
---
 drivers/net/bnxt/bnxt_hwrm.c | 22 +++++++++++++++++++---
 1 file changed, 19 insertions(+), 3 deletions(-)

diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c
index b2033ea416..6e95acb89e 100644
--- a/drivers/net/bnxt/bnxt_hwrm.c
+++ b/drivers/net/bnxt/bnxt_hwrm.c
@@ -2679,11 +2679,27 @@ int bnxt_set_hwrm_link_config(struct bnxt *bp, bool link_up)
 		goto port_phy_cfg;
 
 	autoneg = bnxt_check_eth_link_autoneg(dev_conf->link_speeds);
+	if (BNXT_CHIP_THOR(bp) &&
+	    dev_conf->link_speeds == ETH_LINK_SPEED_40G) {
+		/* 40G is not supported as part of media auto detect.
+		 * The speed should be forced and autoneg disabled
+		 * to configure 40G speed.
+		 */
+		PMD_DRV_LOG(INFO, "Disabling autoneg for 40G\n");
+		autoneg = 0;
+	}
+
 	speed = bnxt_parse_eth_link_speed(dev_conf->link_speeds);
 	link_req.phy_flags = HWRM_PORT_PHY_CFG_INPUT_FLAGS_RESET_PHY;
-	/* Autoneg can be done only when the FW allows */
-	if (autoneg == 1 && !(bp->link_info.auto_link_speed ||
-				bp->link_info.force_link_speed)) {
+	/* Autoneg can be done only when the FW allows.
+	 * When user configures fixed speed of 40G and later changes to
+	 * any other speed, auto_link_speed/force_link_speed is still set
+	 * to 40G until link comes up at new speed.
+	 */
+	if (autoneg == 1 &&
+	    !(!BNXT_CHIP_THOR(bp) &&
+	      (bp->link_info.auto_link_speed ||
+	       bp->link_info.force_link_speed))) {
 		link_req.phy_flags |=
 				HWRM_PORT_PHY_CFG_INPUT_FLAGS_RESTART_AUTONEG;
 		link_req.auto_link_speed_mask =
-- 
2.20.1 (Apple Git-117)



More information about the dev mailing list