net/bnxt: fix autoneg on 10GBase-T links
authorAjit Khaparde <ajit.khaparde@broadcom.com>
Fri, 30 Jun 2017 14:20:19 +0000 (09:20 -0500)
committerFerruh Yigit <ferruh.yigit@intel.com>
Thu, 6 Jul 2017 13:00:57 +0000 (15:00 +0200)
We are not passing proper speed mask causing autoneg to not work
properly on 10GBase-T links. Use supported speeds from phy_qcfg
for auto mask to fix this.

Fixes: 7bc8e9a227cc ("net/bnxt: support async link notification")
Cc: stable@dpdk.org
Signed-off-by: Stephen Hurd <stephen.hurd@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
drivers/net/bnxt/bnxt_hwrm.c

index 9b00b60..85ef0e3 100644 (file)
@@ -1787,12 +1787,16 @@ static int bnxt_valid_link_speed(uint32_t link_speed, uint8_t port_id)
        return 0;
 }
 
-static uint16_t bnxt_parse_eth_link_speed_mask(uint32_t link_speed)
+static uint16_t
+bnxt_parse_eth_link_speed_mask(struct bnxt *bp, uint32_t link_speed)
 {
        uint16_t ret = 0;
 
-       if (link_speed == ETH_LINK_SPEED_AUTONEG)
+       if (link_speed == ETH_LINK_SPEED_AUTONEG) {
+               if (bp->link_info.support_speeds)
+                       return bp->link_info.support_speeds;
                link_speed = BNXT_SUPPORTED_SPEEDS;
+       }
 
        if (link_speed & ETH_LINK_SPEED_100M)
                ret |= HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_100MB;
@@ -1926,7 +1930,8 @@ int bnxt_set_hwrm_link_config(struct bnxt *bp, bool link_up)
                link_req.auto_mode =
                                HWRM_PORT_PHY_CFG_INPUT_AUTO_MODE_SPEED_MASK;
                link_req.auto_link_speed_mask =
-                       bnxt_parse_eth_link_speed_mask(dev_conf->link_speeds);
+                       bnxt_parse_eth_link_speed_mask(bp,
+                                                      dev_conf->link_speeds);
        } else {
                link_req.phy_flags |= HWRM_PORT_PHY_CFG_INPUT_FLAGS_FORCE;
                link_req.link_speed = speed;