DPDK patches and discussions
 help / color / mirror / Atom feed
* Re: [dpdk-dev] net/ixgbe:fix wrong link status
  2019-09-02 11:52 [dpdk-dev] net/ixgbe:fix wrong link status Zhang Xiao
@ 2019-09-02  3:28 ` Zhao1, Wei
  2019-09-02  9:00 ` Ye Xiaolong
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: Zhao1, Wei @ 2019-09-02  3:28 UTC (permalink / raw)
  To: Zhang, Xiao, dev; +Cc: stable

Reviewed-by: Wei Zhao <wei.zhao1@intel.com>

> -----Original Message-----
> From: Zhang, Xiao
> Sent: Monday, September 2, 2019 7:52 PM
> To: dev@dpdk.org
> Cc: Zhao1, Wei <wei.zhao1@intel.com>; Zhang, Xiao <xiao.zhang@intel.com>;
> stable@dpdk.org
> Subject: net/ixgbe:fix wrong link status
> 
> The link status for 82599eb got from link status register was not correct, check
> the enable/disable flag of tx laser when getting the link status, set the link
> status down if tx laser disabled since the tx laser flag could be set correctly
> when up/down the link status.
> 
> Fixes: dc66e5fd01b9 ("net/ixgbe: improve link state check on VF")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Zhang Xiao <xiao.zhang@intel.com>
> ---
>  drivers/net/ixgbe/ixgbe_ethdev.c | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c
> b/drivers/net/ixgbe/ixgbe_ethdev.c
> index 87d2ad0..fc06a1a 100644
> --- a/drivers/net/ixgbe/ixgbe_ethdev.c
> +++ b/drivers/net/ixgbe/ixgbe_ethdev.c
> @@ -2864,6 +2864,7 @@ ixgbe_dev_set_link_up(struct rte_eth_dev *dev)
>  	} else {
>  		/* Turn on the laser */
>  		ixgbe_enable_tx_laser(hw);
> +		ixgbe_dev_link_update(dev, 0);
>  	}
> 
>  	return 0;
> @@ -2894,6 +2895,7 @@ ixgbe_dev_set_link_down(struct rte_eth_dev *dev)
>  	} else {
>  		/* Turn off the laser */
>  		ixgbe_disable_tx_laser(hw);
> +		ixgbe_dev_link_update(dev, 0);
>  	}
> 
>  	return 0;
> @@ -3967,6 +3969,7 @@ ixgbe_dev_link_update_share(struct rte_eth_dev
> *dev,
>  	u32 speed = 0;
>  	int wait = 1;
>  	bool autoneg = false;
> +	u32 esdp_reg;
> 
>  	memset(&link, 0, sizeof(link));
>  	link.link_status = ETH_LINK_DOWN;
> @@ -3999,6 +4002,10 @@ ixgbe_dev_link_update_share(struct rte_eth_dev
> *dev,
>  		return rte_eth_linkstatus_set(dev, &link);
>  	}
> 
> +	esdp_reg = IXGBE_READ_REG(hw, IXGBE_ESDP);
> +	if ((esdp_reg & IXGBE_ESDP_SDP3))
> +		link_up = 0;
> +
>  	if (link_up == 0) {
>  		intr->flags |= IXGBE_FLAG_NEED_LINK_CONFIG;
>  		return rte_eth_linkstatus_set(dev, &link);
> --
> 2.7.4


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [dpdk-dev] net/ixgbe:fix wrong link status
  2019-09-02 11:52 [dpdk-dev] net/ixgbe:fix wrong link status Zhang Xiao
  2019-09-02  3:28 ` Zhao1, Wei
@ 2019-09-02  9:00 ` Ye Xiaolong
  2019-09-02  9:54 ` Ye Xiaolong
  2019-10-29  5:33 ` [dpdk-dev] [v2] " Xiao Zhang
  3 siblings, 0 replies; 6+ messages in thread
From: Ye Xiaolong @ 2019-09-02  9:00 UTC (permalink / raw)
  To: Zhang Xiao; +Cc: dev, wei.zhao1, stable

Hi, Xiao

On 09/02, Zhang Xiao wrote:
>The link status for 82599eb got from link status register was not correct,

So there is a HW issue, right?

Thanks,
Xiaolong

>check the enable/disable flag of tx laser when getting the link status,
>set the link status down if tx laser disabled since the tx laser flag
>could be set correctly when up/down the link status.
>
>Fixes: dc66e5fd01b9 ("net/ixgbe: improve link state check on VF")
>Cc: stable@dpdk.org
>
>Signed-off-by: Zhang Xiao <xiao.zhang@intel.com>
>---
> drivers/net/ixgbe/ixgbe_ethdev.c | 7 +++++++
> 1 file changed, 7 insertions(+)
>
>diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
>index 87d2ad0..fc06a1a 100644
>--- a/drivers/net/ixgbe/ixgbe_ethdev.c
>+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
>@@ -2864,6 +2864,7 @@ ixgbe_dev_set_link_up(struct rte_eth_dev *dev)
> 	} else {
> 		/* Turn on the laser */
> 		ixgbe_enable_tx_laser(hw);
>+		ixgbe_dev_link_update(dev, 0);
> 	}
> 
> 	return 0;
>@@ -2894,6 +2895,7 @@ ixgbe_dev_set_link_down(struct rte_eth_dev *dev)
> 	} else {
> 		/* Turn off the laser */
> 		ixgbe_disable_tx_laser(hw);
>+		ixgbe_dev_link_update(dev, 0);
> 	}
> 
> 	return 0;
>@@ -3967,6 +3969,7 @@ ixgbe_dev_link_update_share(struct rte_eth_dev *dev,
> 	u32 speed = 0;
> 	int wait = 1;
> 	bool autoneg = false;
>+	u32 esdp_reg;
> 
> 	memset(&link, 0, sizeof(link));
> 	link.link_status = ETH_LINK_DOWN;
>@@ -3999,6 +4002,10 @@ ixgbe_dev_link_update_share(struct rte_eth_dev *dev,
> 		return rte_eth_linkstatus_set(dev, &link);
> 	}
> 
>+	esdp_reg = IXGBE_READ_REG(hw, IXGBE_ESDP);
>+	if ((esdp_reg & IXGBE_ESDP_SDP3))
>+		link_up = 0;
>+
> 	if (link_up == 0) {
> 		intr->flags |= IXGBE_FLAG_NEED_LINK_CONFIG;
> 		return rte_eth_linkstatus_set(dev, &link);
>-- 
>2.7.4
>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [dpdk-dev] net/ixgbe:fix wrong link status
  2019-09-02 11:52 [dpdk-dev] net/ixgbe:fix wrong link status Zhang Xiao
  2019-09-02  3:28 ` Zhao1, Wei
  2019-09-02  9:00 ` Ye Xiaolong
@ 2019-09-02  9:54 ` Ye Xiaolong
  2019-10-29  5:33 ` [dpdk-dev] [v2] " Xiao Zhang
  3 siblings, 0 replies; 6+ messages in thread
From: Ye Xiaolong @ 2019-09-02  9:54 UTC (permalink / raw)
  To: Zhang Xiao; +Cc: dev, wei.zhao1, stable

Hi, Xiao

This patch failed to apply on top of dpdk-next-net-intel/for-next-net, could
you help to do a rebase?

Thanks,
Xiaolong

On 09/02, Zhang Xiao wrote:
>The link status for 82599eb got from link status register was not correct,
>check the enable/disable flag of tx laser when getting the link status,
>set the link status down if tx laser disabled since the tx laser flag
>could be set correctly when up/down the link status.
>
>Fixes: dc66e5fd01b9 ("net/ixgbe: improve link state check on VF")
>Cc: stable@dpdk.org
>
>Signed-off-by: Zhang Xiao <xiao.zhang@intel.com>
>---
> drivers/net/ixgbe/ixgbe_ethdev.c | 7 +++++++
> 1 file changed, 7 insertions(+)
>
>diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
>index 87d2ad0..fc06a1a 100644
>--- a/drivers/net/ixgbe/ixgbe_ethdev.c
>+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
>@@ -2864,6 +2864,7 @@ ixgbe_dev_set_link_up(struct rte_eth_dev *dev)
> 	} else {
> 		/* Turn on the laser */
> 		ixgbe_enable_tx_laser(hw);
>+		ixgbe_dev_link_update(dev, 0);
> 	}
> 
> 	return 0;
>@@ -2894,6 +2895,7 @@ ixgbe_dev_set_link_down(struct rte_eth_dev *dev)
> 	} else {
> 		/* Turn off the laser */
> 		ixgbe_disable_tx_laser(hw);
>+		ixgbe_dev_link_update(dev, 0);
> 	}
> 
> 	return 0;
>@@ -3967,6 +3969,7 @@ ixgbe_dev_link_update_share(struct rte_eth_dev *dev,
> 	u32 speed = 0;
> 	int wait = 1;
> 	bool autoneg = false;
>+	u32 esdp_reg;
> 
> 	memset(&link, 0, sizeof(link));
> 	link.link_status = ETH_LINK_DOWN;
>@@ -3999,6 +4002,10 @@ ixgbe_dev_link_update_share(struct rte_eth_dev *dev,
> 		return rte_eth_linkstatus_set(dev, &link);
> 	}
> 
>+	esdp_reg = IXGBE_READ_REG(hw, IXGBE_ESDP);
>+	if ((esdp_reg & IXGBE_ESDP_SDP3))
>+		link_up = 0;
>+
> 	if (link_up == 0) {
> 		intr->flags |= IXGBE_FLAG_NEED_LINK_CONFIG;
> 		return rte_eth_linkstatus_set(dev, &link);
>-- 
>2.7.4
>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [dpdk-dev] net/ixgbe:fix wrong link status
@ 2019-09-02 11:52 Zhang Xiao
  2019-09-02  3:28 ` Zhao1, Wei
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Zhang Xiao @ 2019-09-02 11:52 UTC (permalink / raw)
  To: dev; +Cc: wei.zhao1, Zhang Xiao, stable

The link status for 82599eb got from link status register was not correct,
check the enable/disable flag of tx laser when getting the link status,
set the link status down if tx laser disabled since the tx laser flag
could be set correctly when up/down the link status.

Fixes: dc66e5fd01b9 ("net/ixgbe: improve link state check on VF")
Cc: stable@dpdk.org

Signed-off-by: Zhang Xiao <xiao.zhang@intel.com>
---
 drivers/net/ixgbe/ixgbe_ethdev.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index 87d2ad0..fc06a1a 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -2864,6 +2864,7 @@ ixgbe_dev_set_link_up(struct rte_eth_dev *dev)
 	} else {
 		/* Turn on the laser */
 		ixgbe_enable_tx_laser(hw);
+		ixgbe_dev_link_update(dev, 0);
 	}
 
 	return 0;
@@ -2894,6 +2895,7 @@ ixgbe_dev_set_link_down(struct rte_eth_dev *dev)
 	} else {
 		/* Turn off the laser */
 		ixgbe_disable_tx_laser(hw);
+		ixgbe_dev_link_update(dev, 0);
 	}
 
 	return 0;
@@ -3967,6 +3969,7 @@ ixgbe_dev_link_update_share(struct rte_eth_dev *dev,
 	u32 speed = 0;
 	int wait = 1;
 	bool autoneg = false;
+	u32 esdp_reg;
 
 	memset(&link, 0, sizeof(link));
 	link.link_status = ETH_LINK_DOWN;
@@ -3999,6 +4002,10 @@ ixgbe_dev_link_update_share(struct rte_eth_dev *dev,
 		return rte_eth_linkstatus_set(dev, &link);
 	}
 
+	esdp_reg = IXGBE_READ_REG(hw, IXGBE_ESDP);
+	if ((esdp_reg & IXGBE_ESDP_SDP3))
+		link_up = 0;
+
 	if (link_up == 0) {
 		intr->flags |= IXGBE_FLAG_NEED_LINK_CONFIG;
 		return rte_eth_linkstatus_set(dev, &link);
-- 
2.7.4


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [dpdk-dev] [v2] net/ixgbe:fix wrong link status
  2019-09-02 11:52 [dpdk-dev] net/ixgbe:fix wrong link status Zhang Xiao
                   ` (2 preceding siblings ...)
  2019-09-02  9:54 ` Ye Xiaolong
@ 2019-10-29  5:33 ` Xiao Zhang
  2019-11-04  5:32   ` Ye Xiaolong
  3 siblings, 1 reply; 6+ messages in thread
From: Xiao Zhang @ 2019-10-29  5:33 UTC (permalink / raw)
  To: dev; +Cc: wei.zhao1, xiaolong.ye, Xiao Zhang, stable

The link status for 82599eb got from link status register was not correct,
check the enable/disable flag of tx laser when getting the link status,
set the link status down if tx laser disabled since the tx laser flag
could be set correctly when up/down the link status.

Fixes: dc66e5fd01b9 ("net/ixgbe: improve link state check on VF")
Cc: stable@dpdk.org

Signed-off-by: Xiao Zhang <xiao.zhang@intel.com>
Reviewed-by: Wei Zhao <wei.zhao1@intel.com>
---
v2
Rebase the patch to latest master code.
---
 drivers/net/ixgbe/ixgbe_ethdev.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index dbce7a8..3202c28 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -2904,6 +2904,7 @@ ixgbe_dev_set_link_up(struct rte_eth_dev *dev)
 	} else {
 		/* Turn on the laser */
 		ixgbe_enable_tx_laser(hw);
+		ixgbe_dev_link_update(dev, 0);
 	}
 
 	return 0;
@@ -2934,6 +2935,7 @@ ixgbe_dev_set_link_down(struct rte_eth_dev *dev)
 	} else {
 		/* Turn off the laser */
 		ixgbe_disable_tx_laser(hw);
+		ixgbe_dev_link_update(dev, 0);
 	}
 
 	return 0;
@@ -4108,6 +4110,7 @@ ixgbe_dev_link_update_share(struct rte_eth_dev *dev,
 	int link_up;
 	int diag;
 	int wait = 1;
+	u32 esdp_reg;
 
 	memset(&link, 0, sizeof(link));
 	link.link_status = ETH_LINK_DOWN;
@@ -4135,6 +4138,10 @@ ixgbe_dev_link_update_share(struct rte_eth_dev *dev,
 		return rte_eth_linkstatus_set(dev, &link);
 	}
 
+	esdp_reg = IXGBE_READ_REG(hw, IXGBE_ESDP);
+	if ((esdp_reg & IXGBE_ESDP_SDP3))
+		link_up = 0;
+
 	if (link_up == 0) {
 		if (ixgbe_get_media_type(hw) == ixgbe_media_type_fiber) {
 			intr->flags |= IXGBE_FLAG_NEED_LINK_CONFIG;
-- 
2.7.4


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [dpdk-dev] [v2] net/ixgbe:fix wrong link status
  2019-10-29  5:33 ` [dpdk-dev] [v2] " Xiao Zhang
@ 2019-11-04  5:32   ` Ye Xiaolong
  0 siblings, 0 replies; 6+ messages in thread
From: Ye Xiaolong @ 2019-11-04  5:32 UTC (permalink / raw)
  To: Xiao Zhang; +Cc: dev, wei.zhao1, stable

On 10/29, Xiao Zhang wrote:
>The link status for 82599eb got from link status register was not correct,
>check the enable/disable flag of tx laser when getting the link status,
>set the link status down if tx laser disabled since the tx laser flag
>could be set correctly when up/down the link status.
>
>Fixes: dc66e5fd01b9 ("net/ixgbe: improve link state check on VF")
>Cc: stable@dpdk.org
>
>Signed-off-by: Xiao Zhang <xiao.zhang@intel.com>
>Reviewed-by: Wei Zhao <wei.zhao1@intel.com>
>---
>v2
>Rebase the patch to latest master code.
>---
> drivers/net/ixgbe/ixgbe_ethdev.c | 7 +++++++
> 1 file changed, 7 insertions(+)
>
>diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
>index dbce7a8..3202c28 100644
>--- a/drivers/net/ixgbe/ixgbe_ethdev.c
>+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
>@@ -2904,6 +2904,7 @@ ixgbe_dev_set_link_up(struct rte_eth_dev *dev)
> 	} else {
> 		/* Turn on the laser */
> 		ixgbe_enable_tx_laser(hw);
>+		ixgbe_dev_link_update(dev, 0);
> 	}
> 
> 	return 0;
>@@ -2934,6 +2935,7 @@ ixgbe_dev_set_link_down(struct rte_eth_dev *dev)
> 	} else {
> 		/* Turn off the laser */
> 		ixgbe_disable_tx_laser(hw);
>+		ixgbe_dev_link_update(dev, 0);
> 	}
> 
> 	return 0;
>@@ -4108,6 +4110,7 @@ ixgbe_dev_link_update_share(struct rte_eth_dev *dev,
> 	int link_up;
> 	int diag;
> 	int wait = 1;
>+	u32 esdp_reg;
> 
> 	memset(&link, 0, sizeof(link));
> 	link.link_status = ETH_LINK_DOWN;
>@@ -4135,6 +4138,10 @@ ixgbe_dev_link_update_share(struct rte_eth_dev *dev,
> 		return rte_eth_linkstatus_set(dev, &link);
> 	}
> 
>+	esdp_reg = IXGBE_READ_REG(hw, IXGBE_ESDP);
>+	if ((esdp_reg & IXGBE_ESDP_SDP3))
>+		link_up = 0;
>+
> 	if (link_up == 0) {
> 		if (ixgbe_get_media_type(hw) == ixgbe_media_type_fiber) {
> 			intr->flags |= IXGBE_FLAG_NEED_LINK_CONFIG;
>-- 
>2.7.4
>

Acked-by: Xiaolong Ye <xiaolong.ye@intel.com>

Applied to dpdk-next-net-intel. Thanks.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2019-11-04  5:36 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-02 11:52 [dpdk-dev] net/ixgbe:fix wrong link status Zhang Xiao
2019-09-02  3:28 ` Zhao1, Wei
2019-09-02  9:00 ` Ye Xiaolong
2019-09-02  9:54 ` Ye Xiaolong
2019-10-29  5:33 ` [dpdk-dev] [v2] " Xiao Zhang
2019-11-04  5:32   ` Ye Xiaolong

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).