DPDK patches and discussions
 help / color / mirror / Atom feed
From: Ajit Khaparde <ajit.khaparde@broadcom.com>
To: dev@dpdk.org
Cc: ferruh.yigit@intel.com, Stephen Hurd <stephen.hurd@broadcom.com>
Subject: [dpdk-dev] [PATCH v2 7/9] net/bnxt: fix autoneg on 10GBase-T links
Date: Fri, 30 Jun 2017 09:20:19 -0500	[thread overview]
Message-ID: <20170630142021.50855-8-ajit.khaparde@broadcom.com> (raw)
In-Reply-To: <20170630142021.50855-1-ajit.khaparde@broadcom.com>

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")

Signed-off-by: Stephen Hurd <stephen.hurd@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
--
v1->v2: split the patch into relevant patches based on code review
---
 drivers/net/bnxt/bnxt_hwrm.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c
index 9b00b60..85ef0e3 100644
--- a/drivers/net/bnxt/bnxt_hwrm.c
+++ b/drivers/net/bnxt/bnxt_hwrm.c
@@ -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;
-- 
2.10.1 (Apple Git-78)

  parent reply	other threads:[~2017-06-30 14:20 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-29  2:51 [dpdk-dev] [PATCH 0/7] bnxt patch series Ajit Khaparde
2017-06-29  2:51 ` [dpdk-dev] [PATCH 1/7] net/bnxt: add support for Stratus VF device Ajit Khaparde
2017-06-29  2:51 ` [dpdk-dev] [PATCH 2/7] net/bnxt: fix mtu configuration for the function Ajit Khaparde
2017-06-29 10:55   ` Ferruh Yigit
2017-06-30  2:27     ` Ajit Khaparde
2017-06-29  2:51 ` [dpdk-dev] [PATCH 3/7] net/bnxt: fix calculation of VNICs Ajit Khaparde
2017-06-29  2:51 ` [dpdk-dev] [PATCH 4/7] net/bnxt: pass func_default flag to VNIC_ALLOC Ajit Khaparde
2017-06-29  2:51 ` [dpdk-dev] [PATCH 5/7] net/bnxt: fix automatic clearing of VF stats Ajit Khaparde
2017-06-29 10:53   ` Ferruh Yigit
2017-06-29  2:51 ` [dpdk-dev] [PATCH 6/7] net/bnxt: fix some link related issues Ajit Khaparde
2017-06-29 10:55   ` Ferruh Yigit
2017-06-30  2:27     ` Ajit Khaparde
2017-06-30 14:20     ` [dpdk-dev] [PATCH v2 0/9] bnxt patch series Ajit Khaparde
2017-06-30 14:20       ` [dpdk-dev] [PATCH v2 1/9] net/bnxt: add support for Stratus VF device Ajit Khaparde
2017-06-30 14:20       ` [dpdk-dev] [PATCH v2 2/9] net/bnxt: fix mtu configuration for the function Ajit Khaparde
2017-06-30 14:20       ` [dpdk-dev] [PATCH v2 3/9] net/bnxt: fix calculation of VNICs Ajit Khaparde
2017-06-30 14:20       ` [dpdk-dev] [PATCH v2 4/9] net/bnxt: pass func_default flag to VNIC_ALLOC Ajit Khaparde
2017-06-30 14:20       ` [dpdk-dev] [PATCH v2 5/9] net/bnxt: fix automatic clearing of VF stats Ajit Khaparde
2017-06-30 14:20       ` [dpdk-dev] [PATCH v2 6/9] net/bnxt: fix get link config Ajit Khaparde
2017-06-30 14:20       ` Ajit Khaparde [this message]
2017-06-30 14:20       ` [dpdk-dev] [PATCH v2 8/9] net/bnxt: fix set " Ajit Khaparde
2017-06-30 14:20       ` [dpdk-dev] [PATCH v2 9/9] net/bnxt: fix copy/pasted error message Ajit Khaparde
2017-07-03  9:40       ` [dpdk-dev] [PATCH v2 0/9] bnxt patch series Ferruh Yigit
2017-06-29  2:51 ` [dpdk-dev] [PATCH 7/7] net/bnxt: fix copy/pasted error message Ajit Khaparde
2017-06-29 10:56   ` Ferruh Yigit

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170630142021.50855-8-ajit.khaparde@broadcom.com \
    --to=ajit.khaparde@broadcom.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=stephen.hurd@broadcom.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).