net/ixgbe: fix link status

Message ID 20191113125555.88840-1-lunyuanx.cui@intel.com (mailing list archive)
State Superseded, archived
Delegated to: xiaolong ye
Headers
Series net/ixgbe: fix link status |

Checks

Context Check Description
ci/checkpatch warning coding style issues
ci/travis-robot success Travis build: passed
ci/Intel-compilation success Compilation OK

Commit Message

Cui, LunyuanX Nov. 13, 2019, 12:55 p.m. UTC
  After ports reset, tx laser register will be reset. The link
status for 82599eb got from link status register was not correct.
Set tx laser disable after ports reset.

Fixes: 0408f47ba4d6 ("net/ixgbe: fix busy polling while fiber link update")
Cc: stable@dpdk.org

Signed-off-by: Lunyuan Cui <lunyuanx.cui@intel.com>
---
 drivers/net/ixgbe/ixgbe_ethdev.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)
  

Comments

Xiaolong Ye Nov. 13, 2019, 7:17 a.m. UTC | #1
On 11/13, Cui LunyuanX wrote:
>After ports reset, tx laser register will be reset. The link
>status for 82599eb got from link status register was not correct.
>Set tx laser disable after ports reset.
>
>Fixes: 0408f47ba4d6 ("net/ixgbe: fix busy polling while fiber link update")
>Cc: stable@dpdk.org
>
>Signed-off-by: Lunyuan Cui <lunyuanx.cui@intel.com>
>---
> drivers/net/ixgbe/ixgbe_ethdev.c | 7 ++-----
> 1 file changed, 2 insertions(+), 5 deletions(-)
>
>diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
>index 8c1caac18..5e516599c 100644
>--- a/drivers/net/ixgbe/ixgbe_ethdev.c
>+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
>@@ -1298,6 +1298,8 @@ eth_ixgbe_dev_init(struct rte_eth_dev *eth_dev, void *init_params __rte_unused)
> 	/* enable support intr */
> 	ixgbe_enable_intr(eth_dev);
> 
>+	ixgbe_dev_set_link_down(eth_dev);
>+
> 	/* initialize filter info */
> 	memset(filter_info, 0,
> 	       sizeof(struct ixgbe_filter_info));
>@@ -4154,11 +4156,6 @@ ixgbe_dev_link_update_share(struct rte_eth_dev *dev,
> 		link_up = 0;
> 
> 	if (link_up == 0) {
>-		if (ixgbe_get_media_type(hw) == ixgbe_media_type_fiber) {
>-			intr->flags |= IXGBE_FLAG_NEED_LINK_CONFIG;
>-			rte_eal_alarm_set(10,
>-				ixgbe_dev_setup_link_alarm_handler, dev);
>-		}

why do we need this change?

Thanks,
Xiaolong

> 		return rte_eth_linkstatus_set(dev, &link);
> 	}
> 
>-- 
>2.17.1
>
  

Patch

diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index 8c1caac18..5e516599c 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -1298,6 +1298,8 @@  eth_ixgbe_dev_init(struct rte_eth_dev *eth_dev, void *init_params __rte_unused)
 	/* enable support intr */
 	ixgbe_enable_intr(eth_dev);
 
+	ixgbe_dev_set_link_down(eth_dev);
+
 	/* initialize filter info */
 	memset(filter_info, 0,
 	       sizeof(struct ixgbe_filter_info));
@@ -4154,11 +4156,6 @@  ixgbe_dev_link_update_share(struct rte_eth_dev *dev,
 		link_up = 0;
 
 	if (link_up == 0) {
-		if (ixgbe_get_media_type(hw) == ixgbe_media_type_fiber) {
-			intr->flags |= IXGBE_FLAG_NEED_LINK_CONFIG;
-			rte_eal_alarm_set(10,
-				ixgbe_dev_setup_link_alarm_handler, dev);
-		}
 		return rte_eth_linkstatus_set(dev, &link);
 	}