DPDK patches and discussions
 help / color / mirror / Atom feed
From: Beilei Xing <beilei.xing@intel.com>
To: roy.fan.zhang@intel.com, qi.z.zhang@intel.com
Cc: dev@dpdk.org, echaudro@redhat.com, stable@dpdk.org,
	Keith Wiles <keith.wiles@intel.com>
Subject: [dpdk-dev] [PATCH] net/i40e: fix link status update error
Date: Thu, 10 May 2018 10:26:29 +0800	[thread overview]
Message-ID: <1525919189-10017-1-git-send-email-beilei.xing@intel.com> (raw)

Link status is not updated correctly, link speed is 0
when link is up and link speed is not 0 when link is
down. This patch fixes the issue.

Fixes: eef2daf2e199 ("net/i40e: fix link update no wait")
Cc: echaudro@redhat.com
Cc: stable@dpdk.org

Signed-off-by: Keith Wiles <keith.wiles@intel.com>
Signed-off-by: Beilei Xing <beilei.xing@intel.com>
---
 drivers/net/i40e/i40e_ethdev.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index 894505f..a563561 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -2513,7 +2513,7 @@ update_link_no_wait(struct i40e_hw *hw, struct rte_eth_link *link)
 	reg_val &= I40E_REG_LINK_UP;
 	link->link_status = (reg_val == I40E_REG_LINK_UP) ? 1 : 0;
 
-	if (unlikely(link->link_status != 0))
+	if (unlikely(link->link_status == 0))
 		return;
 
 	/* Parse the link status */
@@ -2572,7 +2572,7 @@ update_link_wait(struct i40e_hw *hw, struct rte_eth_link *link,
 
 		link->link_status = link_status.link_info & I40E_AQ_LINK_UP;
 		if (unlikely(link->link_status != 0))
-			return;
+			break;
 
 		rte_delay_ms(CHECK_INTERVAL);
 	} while (--rep_cnt);
-- 
2.5.5

             reply	other threads:[~2018-05-10  2:26 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-10  2:26 Beilei Xing [this message]
2018-05-10  2:36 ` Zhang, Qi Z
2018-05-10 22:33   ` [dpdk-dev] [dpdk-stable] " 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=1525919189-10017-1-git-send-email-beilei.xing@intel.com \
    --to=beilei.xing@intel.com \
    --cc=dev@dpdk.org \
    --cc=echaudro@redhat.com \
    --cc=keith.wiles@intel.com \
    --cc=qi.z.zhang@intel.com \
    --cc=roy.fan.zhang@intel.com \
    --cc=stable@dpdk.org \
    /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).