Commit 64e8ff5e authored by Stephen Hemminger's avatar Stephen Hemminger Committed by David S. Miller

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: default avatarStephen Hemminger <shemminger@vyatta.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 2bc481cf
...@@ -3458,16 +3458,10 @@ static void pktgen_xmit(struct pktgen_dev *pkt_dev) ...@@ -3458,16 +3458,10 @@ static void pktgen_xmit(struct pktgen_dev *pkt_dev)
/* If pkt_dev->count is zero, then run forever */ /* If pkt_dev->count is zero, then run forever */
if ((pkt_dev->count != 0) && (pkt_dev->sofar >= pkt_dev->count)) { if ((pkt_dev->count != 0) && (pkt_dev->sofar >= pkt_dev->count)) {
if (atomic_read(&(pkt_dev->skb->users)) != 1) { while (atomic_read(&(pkt_dev->skb->users)) != 1) {
ktime_t idle_start = ktime_now(); if (signal_pending(current))
while (atomic_read(&(pkt_dev->skb->users)) != 1) { break;
if (signal_pending(current)) { idle(pkt_dev);
break;
}
schedule();
}
pkt_dev->idle_acc += ktime_to_ns(ktime_sub(ktime_now(),
idle_start));
} }
/* Done with this */ /* Done with this */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment