blob: 67a6a6a42210ab154a1481b96a19247bf5b9fb3d [file] [log] [blame]
Matthew Smith0860b2e2020-01-31 15:39:21 -06001From 0b12d6f9be7fe4101223491716d291ad1bf6ec33 Mon Sep 17 00:00:00 2001
2From: Matthew Smith <mgsmith@netgate.com>
3Date: Fri, 31 Jan 2020 11:36:21 -0600
4Subject: [PATCH] ixgbe: fix link state timing issue on fiber ports
5
6With some models of fiber ports (e.g. X552 device ID 0x15ac), it
7is possible when a port is started to experience a timing issue
8which prevents the link from ever being fully set up.
9
10In ixgbe_dev_link_update_share(), if the media type is fiber and the
11link is down, a flag (IXGBE_FLAG_NEED_LINK_CONFIG) is set. A callback
12to ixgbe_dev_setup_link_alarm_handler() is scheduled for 10us later
13which should try to set up the link and clear the flag afterwards.
14
15If the device is started before the flag is cleared, the scheduled
16callback is canceled. This causes the flag to remain set and
17subsequent calls to ixgbe_dev_link_update_share() return
18without trying to retrieve the link state because the flag is set.
19
20In ixgbe_dev_start(), after cancelling the callback, unset the flag
21on the device to avoid this condition.
22---
23 drivers/net/ixgbe/ixgbe_ethdev.c | 3 +++
24 1 file changed, 3 insertions(+)
25
26diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
27index 03fc1f7..3c2936d 100644
28--- a/drivers/net/ixgbe/ixgbe_ethdev.c
29+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
30@@ -2598,6 +2598,8 @@ static int eth_ixgbevf_pci_remove(struct rte_pci_device *pci_dev)
31 uint32_t *link_speeds;
32 struct ixgbe_tm_conf *tm_conf =
33 IXGBE_DEV_PRIVATE_TO_TM_CONF(dev->data->dev_private);
34+ struct ixgbe_interrupt *intr =
35+ IXGBE_DEV_PRIVATE_TO_INTR(dev->data->dev_private);
36
37 PMD_INIT_FUNC_TRACE();
38
39@@ -2614,6 +2616,7 @@ static int eth_ixgbevf_pci_remove(struct rte_pci_device *pci_dev)
40
41 /* Stop the link setup handler before resetting the HW. */
42 rte_eal_alarm_cancel(ixgbe_dev_setup_link_alarm_handler, dev);
43+ intr->flags &= ~IXGBE_FLAG_NEED_LINK_CONFIG;
44
45 /* disable uio/vfio intr/eventfd mapping */
46 rte_intr_disable(intr_handle);
47--
481.8.3.1
49