[v2] net/ixgbe: fix ixgbevf link status

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

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK
ci/mellanox-Performance-Testing success Performance Testing PASS
ci/intel-Performance-Testing success Performance Testing PASS

Commit Message

Yanglong Wu Nov. 13, 2018, 6:34 a.m. UTC
  For ixgbevf kernel driver, link status changes from down to up
will trigger vf kernel driver send IXGBE_VF_RESET message to pf
kernel driver, after this, vf kernel driver will disable and enable
it self. By these series operations, the vf kernel driver report
link up. Besides, all these operations handles in kernel thread.
For DPDK user space driver, it only gets link status changes from
down to up, but miss IXGBE_VF_RESET message sending and reset itself.
If we will add fully implementation of link status change for DPDK
user space driver, we need take much more modification. We have
aligned that for link status changes from down to up we only notify
link is up, users need to reset vf port.

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

Signed-off-by: Rosen Xu <rosen.xu@intel.com>
Signed-off-by: Yanglong Wu <yanglong.wu@intel.com>
---
v2
change as comments
---
 drivers/net/ixgbe/ixgbe_ethdev.c | 15 +--------------
 1 file changed, 1 insertion(+), 14 deletions(-)
  

Comments

Qi Zhang Nov. 13, 2018, 7:27 p.m. UTC | #1
> -----Original Message-----
> From: Wu, Yanglong
> Sent: Monday, November 12, 2018 10:35 PM
> To: dev@dpdk.org
> Cc: Zhang, Qi Z <qi.z.zhang@intel.com>; Xu, Rosen <rosen.xu@intel.com>;
> Wang, Dong1 <dong1.wang@intel.com>; Wu, Yanglong
> <yanglong.wu@intel.com>
> Subject: [PATCH v2] net/ixgbe: fix ixgbevf link status
> 
> For ixgbevf kernel driver, link status changes from down to up will trigger vf
> kernel driver send IXGBE_VF_RESET message to pf kernel driver, after this, vf
> kernel driver will disable and enable it self. By these series operations, the vf
> kernel driver report link up. Besides, all these operations handles in kernel
> thread.
> For DPDK user space driver, it only gets link status changes from down to up,
> but miss IXGBE_VF_RESET message sending and reset itself.
> If we will add fully implementation of link status change for DPDK user space
> driver, we need take much more modification. We have aligned that for link
> status changes from down to up we only notify link is up, users need to reset
> vf port.
> 
> Fixes: dc66e5fd01b9 ("net/ixgbe: improve link state check on VF")
> 
> Signed-off-by: Rosen Xu <rosen.xu@intel.com>
> Signed-off-by: Yanglong Wu <yanglong.wu@intel.com>

Acked-by: Qi Zhang <qi.z.zhang@intel.com>

Applied to dpdk-next-net-intel.

Thanks
Qi

> ---
> v2
> change as comments
> ---
>  drivers/net/ixgbe/ixgbe_ethdev.c | 15 +--------------
>  1 file changed, 1 insertion(+), 14 deletions(-)
> 
> diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c
> b/drivers/net/ixgbe/ixgbe_ethdev.c
> index 8148577f5..91ba6201d 100644
> --- a/drivers/net/ixgbe/ixgbe_ethdev.c
> +++ b/drivers/net/ixgbe/ixgbe_ethdev.c
> @@ -3880,11 +3880,6 @@ static int
>  ixgbevf_check_link(struct ixgbe_hw *hw, ixgbe_link_speed *speed,
>  		   int *link_up, int wait_to_complete)  {
> -	/**
> -	 * for a quick link status checking, wait_to_compelet == 0,
> -	 * skip PF link status checking
> -	 */
> -	bool no_pflink_check = wait_to_complete == 0;
>  	struct ixgbe_mbx_info *mbx = &hw->mbx;
>  	struct ixgbe_mac_info *mac = &hw->mac;
>  	uint32_t links_reg, in_msg;
> @@ -3945,14 +3940,6 @@ ixgbevf_check_link(struct ixgbe_hw *hw,
> ixgbe_link_speed *speed,
>  		*speed = IXGBE_LINK_SPEED_UNKNOWN;
>  	}
> 
> -	if (no_pflink_check) {
> -		if (*speed == IXGBE_LINK_SPEED_UNKNOWN)
> -			mac->get_link_status = true;
> -		else
> -			mac->get_link_status = false;
> -
> -		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
>  	 */
> @@ -3962,7 +3949,7 @@ ixgbevf_check_link(struct ixgbe_hw *hw,
> ixgbe_link_speed *speed,
>  	if (!(in_msg & IXGBE_VT_MSGTYPE_CTS)) {
>  		/* msg is not CTS and is NACK we must have lost CTS status */
>  		if (in_msg & IXGBE_VT_MSGTYPE_NACK)
> -			ret_val = -1;
> +			mac->get_link_status = false;
>  		goto out;
>  	}
> 
> --
> 2.11.0
  
Wang, Dong1 Nov. 14, 2018, 5:14 a.m. UTC | #2
-----Original Message-----
From: Wu, Yanglong 
Sent: Tuesday, November 13, 2018 14:35
To: dev@dpdk.org
Cc: Zhang, Qi Z <qi.z.zhang@intel.com>; Xu, Rosen <rosen.xu@intel.com>; Wang, Dong1 <dong1.wang@intel.com>; Wu, Yanglong <yanglong.wu@intel.com>
Subject: [PATCH v2] net/ixgbe: fix ixgbevf link status

For ixgbevf kernel driver, link status changes from down to up will trigger vf kernel driver send IXGBE_VF_RESET message to pf kernel driver, after this, vf kernel driver will disable and enable it self. By these series operations, the vf kernel driver report link up. Besides, all these operations handles in kernel thread.
For DPDK user space driver, it only gets link status changes from down to up, but miss IXGBE_VF_RESET message sending and reset itself.
If we will add fully implementation of link status change for DPDK user space driver, we need take much more modification. We have aligned that for link status changes from down to up we only notify link is up, users need to reset vf port.

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

Signed-off-by: Rosen Xu <rosen.xu@intel.com>
Signed-off-by: Yanglong Wu <yanglong.wu@intel.com>
---
v2
change as comments
---
 drivers/net/ixgbe/ixgbe_ethdev.c | 15 +--------------
 1 file changed, 1 insertion(+), 14 deletions(-)

diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index 8148577f5..91ba6201d 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -3880,11 +3880,6 @@ static int
 ixgbevf_check_link(struct ixgbe_hw *hw, ixgbe_link_speed *speed,
 		   int *link_up, int wait_to_complete)  {
-	/**
-	 * for a quick link status checking, wait_to_compelet == 0,
-	 * skip PF link status checking
-	 */
-	bool no_pflink_check = wait_to_complete == 0;
 	struct ixgbe_mbx_info *mbx = &hw->mbx;
 	struct ixgbe_mac_info *mac = &hw->mac;
 	uint32_t links_reg, in_msg;
@@ -3945,14 +3940,6 @@ ixgbevf_check_link(struct ixgbe_hw *hw, ixgbe_link_speed *speed,
 		*speed = IXGBE_LINK_SPEED_UNKNOWN;
 	}
 
-	if (no_pflink_check) {
-		if (*speed == IXGBE_LINK_SPEED_UNKNOWN)
-			mac->get_link_status = true;
-		else
-			mac->get_link_status = false;
-
-		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
 	 */
@@ -3962,7 +3949,7 @@ ixgbevf_check_link(struct ixgbe_hw *hw, ixgbe_link_speed *speed,
 	if (!(in_msg & IXGBE_VT_MSGTYPE_CTS)) {
 		/* msg is not CTS and is NACK we must have lost CTS status */
 		if (in_msg & IXGBE_VT_MSGTYPE_NACK)
-			ret_val = -1;
+			mac->get_link_status = false;
 		goto out;
 	}
 
--
2.11.0

Acked-by: Wang Dong  <dong1.wang@intel.com>
  

Patch

diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index 8148577f5..91ba6201d 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -3880,11 +3880,6 @@  static int
 ixgbevf_check_link(struct ixgbe_hw *hw, ixgbe_link_speed *speed,
 		   int *link_up, int wait_to_complete)
 {
-	/**
-	 * for a quick link status checking, wait_to_compelet == 0,
-	 * skip PF link status checking
-	 */
-	bool no_pflink_check = wait_to_complete == 0;
 	struct ixgbe_mbx_info *mbx = &hw->mbx;
 	struct ixgbe_mac_info *mac = &hw->mac;
 	uint32_t links_reg, in_msg;
@@ -3945,14 +3940,6 @@  ixgbevf_check_link(struct ixgbe_hw *hw, ixgbe_link_speed *speed,
 		*speed = IXGBE_LINK_SPEED_UNKNOWN;
 	}
 
-	if (no_pflink_check) {
-		if (*speed == IXGBE_LINK_SPEED_UNKNOWN)
-			mac->get_link_status = true;
-		else
-			mac->get_link_status = false;
-
-		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
 	 */
@@ -3962,7 +3949,7 @@  ixgbevf_check_link(struct ixgbe_hw *hw, ixgbe_link_speed *speed,
 	if (!(in_msg & IXGBE_VT_MSGTYPE_CTS)) {
 		/* msg is not CTS and is NACK we must have lost CTS status */
 		if (in_msg & IXGBE_VT_MSGTYPE_NACK)
-			ret_val = -1;
+			mac->get_link_status = false;
 		goto out;
 	}