[2495] in linux-net channel archive
SNLE driver (Slow Network Link Emulating Driver)
daemon@ATHENA.MIT.EDU (Molnar Ingo)
Sun Apr 14 22:30:39 1996
Date: Sun, 14 Apr 1996 20:59:51 -0400 (EDT)
From: Molnar Ingo <mingo@kaliban.csoma.elte.hu>
To: Linus Torvalds <torvalds@cs.helsinki.fi>
cc: linux-kernel@vger.rutgers.edu, linux-net@vger.rutgers.edu
In-Reply-To: <Pine.LNX.3.91.960413165459.363I-100000@linux.cs.Helsinki.FI>
To be able to simulate slow networks (when doing timing dependent changes
to the networking code like delayed acks 8) :
---------> diff -u to loopback.c begins here -------->
--- loopback.c Mon Mar 25 07:58:21 1996
+++ slowback.c Sun Apr 14 20:16:52 1996
@@ -61,6 +61,15 @@
if (skb == NULL || dev == NULL)
return(0);
+#define BYTES_PER_SEC 1800
+ {
+ unsigned long timeout;
+
+ timeout=jiffies+skb->truesize*HZ/BYTES_PER_SEC;
+ while( jiffies < timeout ) schedule();
+ }
+#udef BYTES_PER_SEC
+
/*
* Optimise so buffers with skb->free=1 are not copied but
* instead are lobbed from tx queue to rx queue
<----- diff ended here <---------
Is this a bad idea? (i'm a bit worried about the "bh-s are disabled"
comment in loopback.c 8)).
-- mingo