net/ixgbe: fix LSC interrupt
authorQi Zhang <qi.z.zhang@intel.com>
Mon, 8 May 2017 03:57:33 +0000 (23:57 -0400)
committerThomas Monjalon <thomas@monjalon.net>
Wed, 10 May 2017 15:33:07 +0000 (17:33 +0200)
There is a bug in previous fix for lsc interrupt.
lsc interrupt is not disabled before delayed handler,
that cause the delayed handler be re-entered.

Fixes: 9b667210700e ("net/ixgbe: fix blocked interrupts")
Cc: stable@dpdk.org
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
drivers/net/ixgbe/ixgbe_ethdev.c

index ed2baec..2083cde 100644 (file)
@@ -4107,14 +4107,15 @@ ixgbe_dev_interrupt_action(struct rte_eth_dev *dev,
                        timeout = IXGBE_LINK_DOWN_CHECK_TIMEOUT;
 
                ixgbe_dev_link_status_print(dev);
-               intr->mask_original = intr->mask;
-               /* only disable lsc interrupt */
-               intr->mask &= ~IXGBE_EIMS_LSC;
                if (rte_eal_alarm_set(timeout * 1000,
                                      ixgbe_dev_interrupt_delayed_handler, (void *)dev) < 0)
                        PMD_DRV_LOG(ERR, "Error setting alarm");
-               else
-                       intr->mask = intr->mask_original;
+               else {
+                       /* remember original mask */
+                       intr->mask_original = intr->mask;
+                       /* only disable lsc interrupt */
+                       intr->mask &= ~IXGBE_EIMS_LSC;
+               }
        }
 
        PMD_DRV_LOG(DEBUG, "enable intr immediately");