Patchwork [1/2] pktgen: increasing transmission granularity

login
register
mail settings
Submitter Daniel Turull
Date June 10, 2010, 8:44 a.m.
Message ID <4C10A603.2080402@gmail.com>
Download mbox | patch
Permalink /patch/55165/
State Accepted
Delegated to: David Miller
Headers show

Comments

Daniel Turull - June 10, 2010, 8:44 a.m.
This patch correct a bug in the delay of pktgen. 
It makes sure the inter-packet interval is accurate.

Signed-off-by: Daniel Turull <daniel.turull@gmail.com>

---
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Robert Olsson - June 10, 2010, 3:44 p.m.
Thanks,

So the scheduling of the next transmission is based on the previous
transmission rather rather than now() + delay.


Cheers
				--ro



Signed-off-by: Robert Olsson <robert.olsson@its.uu.se>


>Daniel Turull wrote: This patch correct a bug in the delay of pktgen.
>It makes sure the inter-packet interval is accurate.
>
>Signed-off-by: Daniel Turull <daniel.turull@gmail.com>
>
>---
>diff --git a/net/core/pktgen.c b/net/core/pktgen.c index
>2ad68da..1dacd7b 100644 --- a/net/core/pktgen.c +++
>b/net/core/pktgen.c @@ -2170,7 +2170,7 @@ static void spin(struct
>pktgen_dev *pkt_dev, ktime_t spin_until)
> 	end_time = ktime_now();
> 
> 	pkt_dev->idle_acc += ktime_to_ns(ktime_sub(end_time,
> start_time));
>-	pkt_dev->next_tx = ktime_add_ns(end_time, pkt_dev->delay);
>+	pkt_dev->next_tx = ktime_add_ns(spin_until, pkt_dev->delay);
> }
> 
> static inline void set_pkt_overhead(struct pktgen_dev *pkt_dev)
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
David Miller - June 11, 2010, 6:08 a.m.
From: Robert Olsson <robert.olsson@its.uu.se>
Date: Thu, 10 Jun 2010 17:44:42 +0200

> So the scheduling of the next transmission is based on the previous
> transmission rather rather than now() + delay.
 ...
> Signed-off-by: Robert Olsson <robert.olsson@its.uu.se>
> 
> 
>>Daniel Turull wrote: This patch correct a bug in the delay of pktgen.
>>It makes sure the inter-packet interval is accurate.
>>
>>Signed-off-by: Daniel Turull <daniel.turull@gmail.com>

Applied, thanks everyone.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/net/core/pktgen.c b/net/core/pktgen.c
index 2ad68da..1dacd7b 100644
--- a/net/core/pktgen.c
+++ b/net/core/pktgen.c
@@ -2170,7 +2170,7 @@  static void spin(struct pktgen_dev *pkt_dev, ktime_t spin_until)
 	end_time = ktime_now();
 
 	pkt_dev->idle_acc += ktime_to_ns(ktime_sub(end_time, start_time));
-	pkt_dev->next_tx = ktime_add_ns(end_time, pkt_dev->delay);
+	pkt_dev->next_tx = ktime_add_ns(spin_until, pkt_dev->delay);
 }
 
 static inline void set_pkt_overhead(struct pktgen_dev *pkt_dev)