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 3/3] net/bnxt: fix incorrect reporting of link status
Date: Thu, 8 Jun 2017 23:24:48 -0500 [thread overview]
Message-ID: <20170609042448.8212-4-ajit.khaparde@broadcom.com> (raw)
In-Reply-To: <20170609042448.8212-1-ajit.khaparde@broadcom.com>
This patch fixes incorrect reporting of link status
1) When link is down, set speed to zero. Otherwise a wrong non-zero speed
will be displayed.
2) DAC cables can detect there is a signal, but it necessarily does not
mean link is up. Code perviously treated this as link up.
Signed-off-by: Stephen Hurd <stephen.hurd@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
drivers/net/bnxt/bnxt_hwrm.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c
index 6d98d5a..f45b883 100644
--- a/drivers/net/bnxt/bnxt_hwrm.c
+++ b/drivers/net/bnxt/bnxt_hwrm.c
@@ -630,7 +630,7 @@ static int bnxt_hwrm_port_phy_qcfg(struct bnxt *bp,
HWRM_CHECK_RESULT;
link_info->phy_link_status = resp->link;
- if (link_info->phy_link_status != HWRM_PORT_PHY_QCFG_OUTPUT_LINK_NO_LINK) {
+ if (link_info->phy_link_status == HWRM_PORT_PHY_QCFG_OUTPUT_LINK_LINK) {
link_info->link_up = 1;
link_info->link_speed = rte_le_to_cpu_16(resp->link_speed);
} else {
@@ -1831,7 +1831,7 @@ int bnxt_get_hwrm_link_config(struct bnxt *bp, struct rte_eth_link *link)
link->link_speed =
bnxt_parse_hw_link_speed(link_info->link_speed);
else
- link->link_speed = ETH_LINK_SPEED_10M;
+ link->link_speed = ETH_SPEED_NUM_NONE;
link->link_duplex = bnxt_parse_hw_link_duplex(link_info->duplex);
link->link_status = link_info->link_up;
link->link_autoneg = link_info->auto_mode ==
--
2.10.1 (Apple Git-78)
next prev parent reply other threads:[~2017-06-09 4:24 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-09 4:24 [dpdk-dev] [PATCH 0/3] bnxt patchset Ajit Khaparde
2017-06-09 4:24 ` [dpdk-dev] [PATCH 1/3] net/bnxt: move PMD specific functions Ajit Khaparde
2017-06-09 4:24 ` [dpdk-dev] [PATCH 2/3] net/bnxt: update HWRM defines Ajit Khaparde
2017-06-09 4:24 ` Ajit Khaparde [this message]
2017-06-09 11:35 ` [dpdk-dev] [PATCH 0/3] bnxt patchset 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=20170609042448.8212-4-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).