Commit 626fda94 authored by Brice Goglin's avatar Brice Goglin Committed by Jeff Garzik

myri10ge: Use the pause counter to avoid a needless device reset

Use the pause counter to avoid a needless device reset, and
print a message telling the admin that our link partner is
flow controlling us down to 0 pkts/sec.
Signed-off-by: default avatarBrice Goglin <brice@myri.com>
Signed-off-by: default avatarJeff Garzik <jeff@garzik.org>
parent b47157f0
...@@ -191,6 +191,7 @@ struct myri10ge_priv { ...@@ -191,6 +191,7 @@ struct myri10ge_priv {
struct timer_list watchdog_timer; struct timer_list watchdog_timer;
int watchdog_tx_done; int watchdog_tx_done;
int watchdog_tx_req; int watchdog_tx_req;
int watchdog_pause;
int watchdog_resets; int watchdog_resets;
int tx_linearized; int tx_linearized;
int pause; int pause;
...@@ -2800,6 +2801,7 @@ static void myri10ge_watchdog(struct work_struct *work) ...@@ -2800,6 +2801,7 @@ static void myri10ge_watchdog(struct work_struct *work)
static void myri10ge_watchdog_timer(unsigned long arg) static void myri10ge_watchdog_timer(unsigned long arg)
{ {
struct myri10ge_priv *mgp; struct myri10ge_priv *mgp;
u32 rx_pause_cnt;
mgp = (struct myri10ge_priv *)arg; mgp = (struct myri10ge_priv *)arg;
...@@ -2816,19 +2818,28 @@ static void myri10ge_watchdog_timer(unsigned long arg) ...@@ -2816,19 +2818,28 @@ static void myri10ge_watchdog_timer(unsigned long arg)
myri10ge_fill_thresh) myri10ge_fill_thresh)
mgp->rx_big.watchdog_needed = 0; mgp->rx_big.watchdog_needed = 0;
} }
rx_pause_cnt = ntohl(mgp->fw_stats->dropped_pause);
if (mgp->tx.req != mgp->tx.done && if (mgp->tx.req != mgp->tx.done &&
mgp->tx.done == mgp->watchdog_tx_done && mgp->tx.done == mgp->watchdog_tx_done &&
mgp->watchdog_tx_req != mgp->watchdog_tx_done) mgp->watchdog_tx_req != mgp->watchdog_tx_done) {
/* nic seems like it might be stuck.. */ /* nic seems like it might be stuck.. */
schedule_work(&mgp->watchdog_work); if (rx_pause_cnt != mgp->watchdog_pause) {
else if (net_ratelimit())
/* rearm timer */ printk(KERN_WARNING "myri10ge %s:"
mod_timer(&mgp->watchdog_timer, "TX paused, check link partner\n",
jiffies + myri10ge_watchdog_timeout * HZ); mgp->dev->name);
} else {
schedule_work(&mgp->watchdog_work);
return;
}
}
/* rearm timer */
mod_timer(&mgp->watchdog_timer,
jiffies + myri10ge_watchdog_timeout * HZ);
mgp->watchdog_tx_done = mgp->tx.done; mgp->watchdog_tx_done = mgp->tx.done;
mgp->watchdog_tx_req = mgp->tx.req; mgp->watchdog_tx_req = mgp->tx.req;
mgp->watchdog_pause = rx_pause_cnt;
} }
static int myri10ge_probe(struct pci_dev *pdev, const struct pci_device_id *ent) static int myri10ge_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment