Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 175607
b: refs/heads/master
c: 7227909
h: refs/heads/master
i:
  175605: 94f1709
  175603: 7e45303
  175599: f9cfe1b
v: v3
  • Loading branch information
Alexander Duyck authored and David S. Miller committed Dec 12, 2009
1 parent 20b7671 commit ce23bb4
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: fef45f4ce221fc110f70716a00f40be697c5b254
refs/heads/master: 7227909340477c1e5225bb2df76cdcc95b5e1da1
1 change: 1 addition & 0 deletions trunk/drivers/net/igbvf/igbvf.h
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,7 @@ struct igbvf_adapter {
unsigned long led_status;

unsigned int flags;
unsigned long last_reset;
};

struct igbvf_info {
Expand Down
8 changes: 7 additions & 1 deletion trunk/drivers/net/igbvf/netdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit ce23bb4

Please sign in to comment.