From: Beilei Xing Date: Thu, 10 May 2018 02:26:29 +0000 (+0800) Subject: net/i40e: fix link status update X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=b5f6272c242f12fa3403b0d7e9da18fb83da17d4;p=dpdk.git net/i40e: fix link status update 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: stable@dpdk.org Signed-off-by: Keith Wiles Signed-off-by: Beilei Xing --- diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c index 92ac137c6e..267bdf07a7 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);