diff options
author | Stephen Hemminger <shemminger@vyatta.com> | 2009-08-27 09:55:18 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-08-29 02:41:36 -0400 |
commit | 64e8ff5ef2a798cae2e3bede75644173aae98e08 (patch) | |
tree | e139a7ceca9d0c859d6e1afdae13b710fb0654da /net/core | |
parent | 2bc481cf433879f0e6cdd4d899fc21ee05dcea23 (diff) |
pktgen: use common idle routine
Simpler to have one place that spins and accounts for delays,
this will also make the last packet be detected faster for more
repeatable timing.
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core')
-rw-r--r-- | net/core/pktgen.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/net/core/pktgen.c b/net/core/pktgen.c index 3045dd133071..ad41f06c13ca 100644 --- a/net/core/pktgen.c +++ b/net/core/pktgen.c | |||
@@ -3458,16 +3458,10 @@ static void pktgen_xmit(struct pktgen_dev *pkt_dev) | |||
3458 | 3458 | ||
3459 | /* If pkt_dev->count is zero, then run forever */ | 3459 | /* If pkt_dev->count is zero, then run forever */ |
3460 | if ((pkt_dev->count != 0) && (pkt_dev->sofar >= pkt_dev->count)) { | 3460 | if ((pkt_dev->count != 0) && (pkt_dev->sofar >= pkt_dev->count)) { |
3461 | if (atomic_read(&(pkt_dev->skb->users)) != 1) { | 3461 | while (atomic_read(&(pkt_dev->skb->users)) != 1) { |
3462 | ktime_t idle_start = ktime_now(); | 3462 | if (signal_pending(current)) |
3463 | while (atomic_read(&(pkt_dev->skb->users)) != 1) { | 3463 | break; |
3464 | if (signal_pending(current)) { | 3464 | idle(pkt_dev); |
3465 | break; | ||
3466 | } | ||
3467 | schedule(); | ||
3468 | } | ||
3469 | pkt_dev->idle_acc += ktime_to_ns(ktime_sub(ktime_now(), | ||
3470 | idle_start)); | ||
3471 | } | 3465 | } |
3472 | 3466 | ||
3473 | /* Done with this */ | 3467 | /* Done with this */ |