[v2] net/ixgbe: fix link status when link is NACK

Message ID 20180724073032.33332-1-yanglong.wu@intel.com (mailing list archive)
State Superseded, archived
Delegated to: Qi Zhang
Headers
Series [v2] net/ixgbe: fix link status when link is NACK |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Yanglong Wu July 24, 2018, 7:30 a.m. UTC
  Link status should be set as down when link is NACK.

Fixes: dc66e5fd01b9 ("net/ixgbe: improve link state check on VF")

Signed-off-by: Yanglong Wu <yanglong.wu@intel.com>

---
v2:
no need to set link status again
---
 drivers/net/ixgbe/ixgbe_ethdev.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)
  

Comments

Qi Zhang July 25, 2018, 6:02 a.m. UTC | #1
Hi Yanglang:

> -----Original Message-----
> From: Wu, Yanglong
> Sent: Tuesday, July 24, 2018 3:31 PM
> To: dev@dpdk.org
> Cc: Zhang, Qi Z <qi.z.zhang@intel.com>; Wang, Dong1
> <dong1.wang@intel.com>; Wu, Yanglong <yanglong.wu@intel.com>
> Subject: [PATCH v2] net/ixgbe: fix link status when link is NACK
> 
> Link status should be set as down when link is NACK.
> 
> Fixes: dc66e5fd01b9 ("net/ixgbe: improve link state check on VF")
> 
> Signed-off-by: Yanglong Wu <yanglong.wu@intel.com>
> 
> ---
> v2:
> no need to set link status again
> ---
>  drivers/net/ixgbe/ixgbe_ethdev.c | 8 +++-----
>  1 file changed, 3 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c
> b/drivers/net/ixgbe/ixgbe_ethdev.c
> index 997683d3b..3ffc72b40 100644
> --- a/drivers/net/ixgbe/ixgbe_ethdev.c
> +++ b/drivers/net/ixgbe/ixgbe_ethdev.c
> @@ -3933,12 +3933,10 @@ ixgbevf_check_link(struct ixgbe_hw *hw,
> ixgbe_link_speed *speed,
>  	}
> 
>  	if (no_pflink_check) {
> -		if (*speed == IXGBE_LINK_SPEED_UNKNOWN)
> +		if (*speed == IXGBE_LINK_SPEED_UNKNOWN) {
>  			mac->get_link_status = true;
> -		else
> -			mac->get_link_status = false;
> -
> -		goto out;
> +			goto out;
> +		}
>  	}

Sorry, I can't understand this change combined with your commit log, could you explain more?
Btw, no_fplink_check = 1 means wait_to_complete = 0, 
but in the case when *speed != IXGBE_LINK_SPEED_UNKNOWN , you will still go msg.read which I guess is not suppose be called in the case wait_to_complete = 0, is it right?

>  	/* if the read failed it could just be a mailbox collision, best wait
>  	 * until we are called again and don't report an error
> --
> 2.11.0
  

Patch

diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index 997683d3b..3ffc72b40 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -3933,12 +3933,10 @@  ixgbevf_check_link(struct ixgbe_hw *hw, ixgbe_link_speed *speed,
 	}
 
 	if (no_pflink_check) {
-		if (*speed == IXGBE_LINK_SPEED_UNKNOWN)
+		if (*speed == IXGBE_LINK_SPEED_UNKNOWN) {
 			mac->get_link_status = true;
-		else
-			mac->get_link_status = false;
-
-		goto out;
+			goto out;
+		}
 	}
 	/* if the read failed it could just be a mailbox collision, best wait
 	 * until we are called again and don't report an error