netdev
[Top] [All Lists]

Re: [6/9][PATCH 2.6] Fix Tx engine race for good

To: Roger Luethi <rl@xxxxxxxxxxx>
Subject: Re: [6/9][PATCH 2.6] Fix Tx engine race for good
From: Jeff Garzik <jgarzik@xxxxxxxxx>
Date: Sat, 19 Jun 2004 17:22:44 -0400
Cc: Andrew Morton <akpm@xxxxxxxx>, netdev@xxxxxxxxxxx
In-reply-to: <20040615174933.GA11294@xxxxxxxxxxxxxx>
References: <20040615174933.GA11294@xxxxxxxxxxxxxx>
Sender: netdev-bounce@xxxxxxxxxxx
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040510
Roger Luethi wrote:
+#define RHINE_WAIT_FOR(condition) do {                                 \
+       int i=1024;                                                     \
+       while (!(condition) && --i)                                     \
+               ;                                                       \
+       if (debug > 1 && i < 512)                                 \
+               printk(KERN_INFO "%s: %4d cycles used @ %s:%d\n",     \
+                               DRV_NAME, 1024-i, __func__, __LINE__);  \
+} while(0)

empty loops need at least a cpu_relax(), if not a true delay to guarantee the timing you desire.

Also, it would be nice to change the name, since there isn't anything rhine-specific about this macro.

        Jeff

<Prev in Thread] Current Thread [Next in Thread>