All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/1] myri10ge update for 2.6.23
@ 2007-08-09  7:01 Brice Goglin
  2007-08-09  7:02 ` [PATCH 1/1] Use the pause counter to avoid a needless device reset Brice Goglin
  0 siblings, 1 reply; 3+ messages in thread
From: Brice Goglin @ 2007-08-09  7:01 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: netdev

Hi Jeff,

Aside from the LRO patch that DaveM queued for 2.6.24, here's a small
fix for myri10ge in 2.6.23:

1. Use the pause counter to avoid a needless device reset

Please apply, thanks,
Brice


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 1/1] Use the pause counter to avoid a needless device reset
  2007-08-09  7:01 [PATCH 0/1] myri10ge update for 2.6.23 Brice Goglin
@ 2007-08-09  7:02 ` Brice Goglin
  2007-08-14  5:28   ` Jeff Garzik
  0 siblings, 1 reply; 3+ messages in thread
From: Brice Goglin @ 2007-08-09  7:02 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: netdev

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: Brice Goglin <brice@myri.com>
---
 drivers/net/myri10ge/myri10ge.c |   25 ++++++++++++++++++-------
 1 file changed, 18 insertions(+), 7 deletions(-)

Index: linux-2.6.22/drivers/net/myri10ge/myri10ge.c
===================================================================
--- linux-2.6.22.orig/drivers/net/myri10ge/myri10ge.c	2007-08-09 08:53:40.000000000 +0200
+++ linux-2.6.22/drivers/net/myri10ge/myri10ge.c	2007-08-09 08:53:53.000000000 +0200
@@ -191,6 +191,7 @@
 	struct timer_list watchdog_timer;
 	int watchdog_tx_done;
 	int watchdog_tx_req;
+	int watchdog_pause;
 	int watchdog_resets;
 	int tx_linearized;
 	int pause;
@@ -2800,6 +2801,7 @@
 static void myri10ge_watchdog_timer(unsigned long arg)
 {
 	struct myri10ge_priv *mgp;
+	u32 rx_pause_cnt;
 
 	mgp = (struct myri10ge_priv *)arg;
 
@@ -2816,19 +2818,28 @@
 		    myri10ge_fill_thresh)
 			mgp->rx_big.watchdog_needed = 0;
 	}
+	rx_pause_cnt = ntohl(mgp->fw_stats->dropped_pause);
 
 	if (mgp->tx.req != mgp->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.. */
-		schedule_work(&mgp->watchdog_work);
-	else
-		/* rearm timer */
-		mod_timer(&mgp->watchdog_timer,
-			  jiffies + myri10ge_watchdog_timeout * HZ);
-
+		if (rx_pause_cnt != mgp->watchdog_pause) {
+			if (net_ratelimit())
+				printk(KERN_WARNING "myri10ge %s:"
+				       "TX paused, check link partner\n",
+				       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_req = mgp->tx.req;
+	mgp->watchdog_pause = rx_pause_cnt;
 }
 
 static int myri10ge_probe(struct pci_dev *pdev, const struct pci_device_id *ent)



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/1] Use the pause counter to avoid a needless device reset
  2007-08-09  7:02 ` [PATCH 1/1] Use the pause counter to avoid a needless device reset Brice Goglin
@ 2007-08-14  5:28   ` Jeff Garzik
  0 siblings, 0 replies; 3+ messages in thread
From: Jeff Garzik @ 2007-08-14  5:28 UTC (permalink / raw)
  To: Brice Goglin; +Cc: netdev

Brice Goglin wrote:
> 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: Brice Goglin <brice@myri.com>
> ---
>  drivers/net/myri10ge/myri10ge.c |   25 ++++++++++++++++++-------
>  1 file changed, 18 insertions(+), 7 deletions(-)

applied

please prefix your subject lines like this:

	[PATCH m/n] myri10ge:

so that the automated tools (git-am from the git package) properly 
provide a one-line summary for your patch.  for more info also see
http://linux.yyz.us/patch-format.html

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-08-14  5:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-08-09  7:01 [PATCH 0/1] myri10ge update for 2.6.23 Brice Goglin
2007-08-09  7:02 ` [PATCH 1/1] Use the pause counter to avoid a needless device reset Brice Goglin
2007-08-14  5:28   ` Jeff Garzik

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.