summaryrefslogtreecommitdiffstats
path: root/net/core
diff options
context:
space:
mode:
authorRobert Olsson <robert.olsson@its.uu.se>2008-08-06 03:44:26 +0200
committerDavid S. Miller <davem@davemloft.net>2008-08-06 03:44:26 +0200
commit1211a64554065316e02b3c62b320088ad4f63260 (patch)
tree58522cdfcd5ee11409f39f32135234a28c883095 /net/core
parentbridge: Eliminate unnecessary forward delay (diff)
downloadlinux-1211a64554065316e02b3c62b320088ad4f63260.tar.xz
linux-1211a64554065316e02b3c62b320088ad4f63260.zip
pktgen: random flow
Random flow generation has not worked. This fixes it. Signed-off-by: Robert Olsson <robert.olsson@its.uu.se> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core')
-rw-r--r--net/core/pktgen.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/net/core/pktgen.c b/net/core/pktgen.c
index 3284605f2ec7..9c87320fdf3f 100644
--- a/net/core/pktgen.c
+++ b/net/core/pktgen.c
@@ -2085,15 +2085,19 @@ static inline int f_pick(struct pktgen_dev *pkt_dev)
if (pkt_dev->flows[flow].count >= pkt_dev->lflow) {
/* reset time */
pkt_dev->flows[flow].count = 0;
+ pkt_dev->flows[flow].flags = 0;
pkt_dev->curfl += 1;
if (pkt_dev->curfl >= pkt_dev->cflows)
pkt_dev->curfl = 0; /*reset */
}
} else {
flow = random32() % pkt_dev->cflows;
+ pkt_dev->curfl = flow;
- if (pkt_dev->flows[flow].count > pkt_dev->lflow)
+ if (pkt_dev->flows[flow].count > pkt_dev->lflow) {
pkt_dev->flows[flow].count = 0;
+ pkt_dev->flows[flow].flags = 0;
+ }
}
return pkt_dev->curfl;