netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH,pktgen] account for preamble and inter-packet gap
@ 2004-11-28 21:32 Lennert Buytenhek
  2004-11-29  3:21 ` Ben Greear
  2004-11-29 16:16 ` Robert Olsson
  0 siblings, 2 replies; 5+ messages in thread
From: Lennert Buytenhek @ 2004-11-28 21:32 UTC (permalink / raw)
  To: robert.olsson; +Cc: netdev

Hi!

If you account for the Frame Check Sequence when computing bandwidth
stats, it's only fair that you count the preamble and inter-packet gap
as well.  Suggested patch attached.


cheers,
Lennert


--- pktgen.c.orig	2004-11-28 22:27:50.008829106 +0100
+++ pktgen.c	2004-11-28 22:30:48.773867119 +0100
@@ -2564,7 +2564,7 @@
 static void show_results(struct pktgen_dev *pkt_dev, int nr_frags)
 {
        __u64 total_us, bps, mbps, pps, idle;
-       int size = pkt_dev->cur_pkt_size + 4; /* incl 32bit ethernet CRC */
+       int size = pkt_dev->cur_pkt_size + 4 + 8 + 12; /* incl 32bit ethernet CRC plus preamble plus inter-packet gap */
        char *p = pkt_dev->result;
 
        total_us = pkt_dev->stopped_at - pkt_dev->started_at;
@@ -2777,7 +2777,7 @@
 			pkt_dev->last_ok = 1;    
 			pkt_dev->sofar++;
 			pkt_dev->seq_num++;
-			pkt_dev->tx_bytes += (pkt_dev->cur_pkt_size + 4); /* count csum */
+			pkt_dev->tx_bytes += (pkt_dev->cur_pkt_size + 4 + 8 + 12); /* count csum and preamble and inter-packet gap*/
 			
 		} else if (ret == NETDEV_TX_LOCKED 
 			   && (odev->features & NETIF_F_LLTX)) {

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2004-12-01 21:59 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-11-28 21:32 [PATCH,pktgen] account for preamble and inter-packet gap Lennert Buytenhek
2004-11-29  3:21 ` Ben Greear
2004-11-29  6:37   ` Lennert Buytenhek
2004-11-29 16:16 ` Robert Olsson
2004-12-01 21:59   ` Lennert Buytenhek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).