summaryrefslogtreecommitdiffstats
path: root/net/core
diff options
context:
space:
mode:
authorStephen Hemminger <shemminger@vyatta.com>2009-08-27 13:55:18 +0000
committerDavid S. Miller <davem@davemloft.net>2009-08-28 23:41:36 -0700
commit64e8ff5ef2a798cae2e3bede75644173aae98e08 (patch)
treee139a7ceca9d0c859d6e1afdae13b710fb0654da /net/core
parent2bc481cf433879f0e6cdd4d899fc21ee05dcea23 (diff)
downloadop-kernel-dev-64e8ff5ef2a798cae2e3bede75644173aae98e08.zip
op-kernel-dev-64e8ff5ef2a798cae2e3bede75644173aae98e08.tar.gz
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.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/net/core/pktgen.c b/net/core/pktgen.c
index 3045dd1..ad41f06 100644
--- a/net/core/pktgen.c
+++ b/net/core/pktgen.c
@@ -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 != 0) && (pkt_dev->sofar >= pkt_dev->count)) {
- if (atomic_read(&(pkt_dev->skb->users)) != 1) {
- ktime_t idle_start = ktime_now();
- while (atomic_read(&(pkt_dev->skb->users)) != 1) {
- if (signal_pending(current)) {
- break;
- }
- schedule();
- }
- pkt_dev->idle_acc += ktime_to_ns(ktime_sub(ktime_now(),
- idle_start));
+ while (atomic_read(&(pkt_dev->skb->users)) != 1) {
+ if (signal_pending(current))
+ break;
+ idle(pkt_dev);
}
/* Done with this */
OpenPOWER on IntegriCloud