e1000: restrict link interrupt setup scope
authorYong Liu <yong.liu@intel.com>
Thu, 29 Oct 2015 09:18:43 +0000 (17:18 +0800)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Thu, 29 Oct 2015 17:55:07 +0000 (18:55 +0100)
Only mask lsc interrupt bit when setup device interrupt.

Signed-off-by: Marvin Liu <yong.liu@intel.com>
Acked-by: Cunming Liang <cunming.liang@intel.com>
drivers/net/e1000/em_ethdev.c

index 912f5dd..4e75101 100644 (file)
@@ -1268,11 +1268,14 @@ em_intr_disable(struct e1000_hw *hw)
 static int
 eth_em_interrupt_setup(struct rte_eth_dev *dev)
 {
+       uint32_t regval;
        struct e1000_hw *hw =
                E1000_DEV_PRIVATE_TO_HW(dev->data->dev_private);
 
-       E1000_WRITE_REG(hw, E1000_IMS, E1000_ICR_LSC);
-       rte_intr_enable(&(dev->pci_dev->intr_handle));
+       /* clear interrupt */
+       E1000_READ_REG(hw, E1000_ICR);
+       regval = E1000_READ_REG(hw, E1000_IMS);
+       E1000_WRITE_REG(hw, E1000_IMS, regval | E1000_ICR_LSC);
        return (0);
 }