[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <18584.14183.573224.16934@robur.slu.se>
Date: Tue, 5 Aug 2008 13:20:07 +0200
From: Robert Olsson <robert@...ur.slu.se>
To: David Miller <davem@...emloft.net>
Cc: netdev@...r.kernel.org, robert@...ur.slu.se
Subject: [PATCH] pktgen random flow
Hello,
Random flow generation has not worked. This fixes it.
Signed-off-by: Robert Olsson <robert.olsson@....uu.se>
Cheers.
--ro
diff --git a/net/core/pktgen.c b/net/core/pktgen.c
index 3284605..755d08f 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)
- pkt_dev->flows[flow].count = 0;
+ 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;
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists