netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] pktgen: bug when calling ndelay in x86 architectures
@ 2011-10-18 11:08 Daniel Turull
  2011-10-18 11:56 ` Eric Dumazet
  0 siblings, 1 reply; 11+ messages in thread
From: Daniel Turull @ 2011-10-18 11:08 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, Robert Olsson, Voravit Tanyingyong, Jens Laas

The value selected to delay the transmission in pktgen with the ndelay function should be lower.
In Linux/arch/x86/include/asm/delay.h and Linux/arch/sh/include/asm/delay.h
the maximal expected value for a constant is 20000 ns.

Signed-off-by: Daniel Turull <daniel.turull@gmail.com>
---
diff --git a/net/core/pktgen.c b/net/core/pktgen.c
index 796044a..e17bd41 100644
--- a/net/core/pktgen.c
+++ b/net/core/pktgen.c
@@ -2145,7 +2145,7 @@ static void spin(struct pktgen_dev *pkt_dev, ktime_t spin_until)
 	}
 
 	start_time = ktime_now();
-	if (remaining < 100000)
+	if (remaining < 20000)
 		ndelay(remaining);	/* really small just spin */
 	else {
 		/* see do_nanosleep */

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

end of thread, other threads:[~2011-10-20 21:04 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-18 11:08 [patch] pktgen: bug when calling ndelay in x86 architectures Daniel Turull
2011-10-18 11:56 ` Eric Dumazet
2011-10-18 14:00   ` Ben Hutchings
2011-10-18 14:47     ` Eric Dumazet
     [not found]       ` <4E9E9963.7090209@gmail.com>
2011-10-19 10:13         ` Eric Dumazet
2011-10-20 13:22           ` Daniel Turull
2011-10-20 13:44             ` Eric Dumazet
2011-10-20 14:26               ` Daniel Turull
2011-10-20 20:24       ` David Miller
2011-10-20 20:55         ` Eric Dumazet
2011-10-20 21:02           ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).