diff options
author | Alexander Duyck <alexander.h.duyck@intel.com> | 2009-12-12 09:58:14 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-12-12 09:58:14 +0300 |
commit | 7227909340477c1e5225bb2df76cdcc95b5e1da1 (patch) | |
tree | 694e3ecd90b3bf9de6324a581ba4115d701095ee /drivers/net/igbvf/netdev.c | |
parent | fef45f4ce221fc110f70716a00f40be697c5b254 (diff) | |
download | linux-7227909340477c1e5225bb2df76cdcc95b5e1da1.tar.xz |
igbvf: avoid reset storms due to mailbox issues
From: Alexander Duyck <alexander.h.duyck@intel.com>
This change makes it so that reset/interrupt storms can be avoided when
there are mailbox issues. The new behavior is to only allow the device to
trigger mailbox related resets only once every 10 seconds.
Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/igbvf/netdev.c')
-rw-r--r-- | drivers/net/igbvf/netdev.c | 8 |
1 files changed, 7 insertions, 1 deletions
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) memcpy(netdev->perm_addr, adapter->hw.mac.addr, netdev->addr_len); } + + adapter->last_reset = jiffies; } int igbvf_up(struct igbvf_adapter *adapter) @@ -1812,11 +1814,15 @@ static bool igbvf_has_link(struct igbvf_adapter *adapter) s32 ret_val = E1000_SUCCESS; bool link_active; + /* If interface is down, stay link down */ + if (test_bit(__IGBVF_DOWN, &adapter->state)) + return false; + ret_val = hw->mac.ops.check_for_link(hw); link_active = !hw->mac.get_link_status; /* if check for link returns error we will need to reset */ - if (ret_val) + if (ret_val && time_after(jiffies, adapter->last_reset + (10 * HZ))) schedule_work(&adapter->reset_task); return link_active; |