Matthew Smith | 0860b2e | 2020-01-31 15:39:21 -0600 | [diff] [blame] | 1 | From 0b12d6f9be7fe4101223491716d291ad1bf6ec33 Mon Sep 17 00:00:00 2001 |
| 2 | From: Matthew Smith <mgsmith@netgate.com> |
| 3 | Date: Fri, 31 Jan 2020 11:36:21 -0600 |
| 4 | Subject: [PATCH] ixgbe: fix link state timing issue on fiber ports |
| 5 | |
| 6 | With some models of fiber ports (e.g. X552 device ID 0x15ac), it |
| 7 | is possible when a port is started to experience a timing issue |
| 8 | which prevents the link from ever being fully set up. |
| 9 | |
| 10 | In ixgbe_dev_link_update_share(), if the media type is fiber and the |
| 11 | link is down, a flag (IXGBE_FLAG_NEED_LINK_CONFIG) is set. A callback |
| 12 | to ixgbe_dev_setup_link_alarm_handler() is scheduled for 10us later |
| 13 | which should try to set up the link and clear the flag afterwards. |
| 14 | |
| 15 | If the device is started before the flag is cleared, the scheduled |
| 16 | callback is canceled. This causes the flag to remain set and |
| 17 | subsequent calls to ixgbe_dev_link_update_share() return |
| 18 | without trying to retrieve the link state because the flag is set. |
| 19 | |
| 20 | In ixgbe_dev_start(), after cancelling the callback, unset the flag |
| 21 | on the device to avoid this condition. |
| 22 | --- |
| 23 | drivers/net/ixgbe/ixgbe_ethdev.c | 3 +++ |
| 24 | 1 file changed, 3 insertions(+) |
| 25 | |
| 26 | diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c |
| 27 | index 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 | -- |
| 48 | 1.8.3.1 |
| 49 | |