diff options
-rw-r--r-- | drivers/net/igbvf/igbvf.h | 1 | ||||
-rw-r--r-- | drivers/net/igbvf/netdev.c | 8 |
2 files changed, 8 insertions, 1 deletions
diff --git a/drivers/net/igbvf/igbvf.h b/drivers/net/igbvf/igbvf.h index 3d1ee7a8478e..a1774b29d222 100644 --- a/drivers/net/igbvf/igbvf.h +++ b/drivers/net/igbvf/igbvf.h | |||
@@ -276,6 +276,7 @@ struct igbvf_adapter { | |||
276 | unsigned long led_status; | 276 | unsigned long led_status; |
277 | 277 | ||
278 | unsigned int flags; | 278 | unsigned int flags; |
279 | unsigned long last_reset; | ||
279 | }; | 280 | }; |
280 | 281 | ||
281 | struct igbvf_info { | 282 | struct igbvf_info { |
diff --git a/drivers/net/igbvf/netdev.c b/drivers/net/igbvf/netdev.c index a127620dc653..e9dd95f136aa 100644 --- a/drivers/net/igbvf/netdev.c +++ b/drivers/net/igbvf/netdev.c | |||
@@ -1469,6 +1469,8 @@ static void igbvf_reset(struct igbvf_adapter *adapter) | |||
1469 | memcpy(netdev->perm_addr, adapter->hw.mac.addr, | 1469 | memcpy(netdev->perm_addr, adapter->hw.mac.addr, |
1470 | netdev->addr_len); | 1470 | netdev->addr_len); |
1471 | } | 1471 | } |
1472 | |||
1473 | adapter->last_reset = jiffies; | ||
1472 | } | 1474 | } |
1473 | 1475 | ||
1474 | int igbvf_up(struct igbvf_adapter *adapter) | 1476 | int igbvf_up(struct igbvf_adapter *adapter) |
@@ -1812,11 +1814,15 @@ static bool igbvf_has_link(struct igbvf_adapter *adapter) | |||
1812 | s32 ret_val = E1000_SUCCESS; | 1814 | s32 ret_val = E1000_SUCCESS; |
1813 | bool link_active; | 1815 | bool link_active; |
1814 | 1816 | ||
1817 | /* If interface is down, stay link down */ | ||
1818 | if (test_bit(__IGBVF_DOWN, &adapter->state)) | ||
1819 | return false; | ||
1820 | |||
1815 | ret_val = hw->mac.ops.check_for_link(hw); | 1821 | ret_val = hw->mac.ops.check_for_link(hw); |
1816 | link_active = !hw->mac.get_link_status; | 1822 | link_active = !hw->mac.get_link_status; |
1817 | 1823 | ||
1818 | /* if check for link returns error we will need to reset */ | 1824 | /* if check for link returns error we will need to reset */ |
1819 | if (ret_val) | 1825 | if (ret_val && time_after(jiffies, adapter->last_reset + (10 * HZ))) |
1820 | schedule_work(&adapter->reset_task); | 1826 | schedule_work(&adapter->reset_task); |
1821 | 1827 | ||
1822 | return link_active; | 1828 | return link_active; |