netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Lennert Buytenhek <buytenh@wantstofly.org>
To: robert.olsson@data.slu.se
Cc: netdev@oss.sgi.com
Subject: [PATCH,pktgen] account for preamble and inter-packet gap
Date: Sun, 28 Nov 2004 22:32:51 +0100	[thread overview]
Message-ID: <20041128213251.GA9330@xi.wantstofly.org> (raw)

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)) {

             reply	other threads:[~2004-11-28 21:32 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-11-28 21:32 Lennert Buytenhek [this message]
2004-11-29  3:21 ` [PATCH,pktgen] account for preamble and inter-packet gap Ben Greear
2004-11-29  6:37   ` Lennert Buytenhek
2004-11-29 16:16 ` Robert Olsson
2004-12-01 21:59   ` Lennert Buytenhek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20041128213251.GA9330@xi.wantstofly.org \
    --to=buytenh@wantstofly.org \
    --cc=netdev@oss.sgi.com \
    --cc=robert.olsson@data.slu.se \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).