]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
pktgen: random flow
authorRobert Olsson <robert.olsson@its.uu.se>
Wed, 6 Aug 2008 01:44:26 +0000 (18:44 -0700)
committerDavid S. Miller <davem@davemloft.net>
Wed, 6 Aug 2008 01:44:26 +0000 (18:44 -0700)
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>
net/core/pktgen.c

index 3284605f2ec74dd5ea896b01ef24eb1712c92c9c..9c87320fdf3f3c04239f9871348f20398f984b2b 100644 (file)
@@ -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;