diff options
Diffstat (limited to 'net/core')
-rw-r--r-- | net/core/pktgen.c | 6 |
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) | |||
2085 | if (pkt_dev->flows[flow].count >= pkt_dev->lflow) { | 2085 | if (pkt_dev->flows[flow].count >= pkt_dev->lflow) { |
2086 | /* reset time */ | 2086 | /* reset time */ |
2087 | pkt_dev->flows[flow].count = 0; | 2087 | pkt_dev->flows[flow].count = 0; |
2088 | pkt_dev->flows[flow].flags = 0; | ||
2088 | pkt_dev->curfl += 1; | 2089 | pkt_dev->curfl += 1; |
2089 | if (pkt_dev->curfl >= pkt_dev->cflows) | 2090 | if (pkt_dev->curfl >= pkt_dev->cflows) |
2090 | pkt_dev->curfl = 0; /*reset */ | 2091 | pkt_dev->curfl = 0; /*reset */ |
2091 | } | 2092 | } |
2092 | } else { | 2093 | } else { |
2093 | flow = random32() % pkt_dev->cflows; | 2094 | flow = random32() % pkt_dev->cflows; |
2095 | pkt_dev->curfl = flow; | ||
2094 | 2096 | ||
2095 | if (pkt_dev->flows[flow].count > pkt_dev->lflow) | 2097 | if (pkt_dev->flows[flow].count > pkt_dev->lflow) { |
2096 | pkt_dev->flows[flow].count = 0; | 2098 | pkt_dev->flows[flow].count = 0; |
2099 | pkt_dev->flows[flow].flags = 0; | ||
2100 | } | ||
2097 | } | 2101 | } |
2098 | 2102 | ||
2099 | return pkt_dev->curfl; | 2103 | return pkt_dev->curfl; |