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

* Re: [PATCH,pktgen] account for preamble and inter-packet gap
  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
  1 sibling, 1 reply; 5+ messages in thread
From: Ben Greear @ 2004-11-29  3:21 UTC (permalink / raw)
  To: Lennert Buytenhek; +Cc: robert.olsson, netdev

Lennert Buytenhek wrote:
> 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.

a) When an ethernet NIC claims 100Mbps, does this count the preamble and IPG?

b) Or, can send and receive 100Mbps of data by only counting
    the ethernet header + payload + CRC?

If b is true, then I definately would not want to see the IPG and preamble
counted.  If a is true, then I still don't want it counted, but I would
agree that it is worth considering :)

Ben

-- 
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc  http://www.candelatech.com

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

* Re: [PATCH,pktgen] account for preamble and inter-packet gap
  2004-11-29  3:21 ` Ben Greear
@ 2004-11-29  6:37   ` Lennert Buytenhek
  0 siblings, 0 replies; 5+ messages in thread
From: Lennert Buytenhek @ 2004-11-29  6:37 UTC (permalink / raw)
  To: Ben Greear; +Cc: robert.olsson, netdev

On Sun, Nov 28, 2004 at 07:21:31PM -0800, Ben Greear wrote:

> >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.
> 
> a) When an ethernet NIC claims 100Mbps, does this count the preamble and 
> IPG?

Yes.  That's how we arrive at the 148kpps 'max pps for fast ethernet'
figure -- 100000000 bits per second, each packet taking 8*(8+60+4+12)
bits on the wire.

Another person suggested in private that what I'm after is properly
called '% utilization'.  It might not be possible to determine the
speed of the physical medium though.

In either case, it seems wrong to count the FCS but not the preamble/IPG.
Maybe it's more appropriate to remove the FCS from the calculations.


--L

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

* [PATCH,pktgen] account for preamble and inter-packet gap
  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 16:16 ` Robert Olsson
  2004-12-01 21:59   ` Lennert Buytenhek
  1 sibling, 1 reply; 5+ messages in thread
From: Robert Olsson @ 2004-11-29 16:16 UTC (permalink / raw)
  To: Lennert Buytenhek; +Cc: robert.olsson, netdev


Lennert Buytenhek writes:

 > 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.

 Well from pktgen TX view we don't know what the layer under us will do. 
 We simply deliver packets and hope those get transmitted but we are not
 100% sure neither about ipg or preample. We don't even know that packets 
 are seen on the wire. We use to verify this in our specific HW setup. 
 So what trusted statistics can we give? 

 I've heard some boxes that didn't do the ipg correctly. Don't know what NIC 
 this was. We can only estimate stats at the point where we are delivering 
 packets. Other devices has "true" L2 stats.
 
 OK. Adding FCS yes kinda compromise and maybe was wrong in this aspect.

 Also we should think of calculation should work with link other link
 link layers not only ethernet.
 
 The only solution I can think of is of having a selectable option in 
 the config for output stats. To support different L2 layers and with  
 warning if we are "predicting" L2 statistics. Feel free to extend your
 patch.

						--ro
 
 

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

* Re: [PATCH,pktgen] account for preamble and inter-packet gap
  2004-11-29 16:16 ` Robert Olsson
@ 2004-12-01 21:59   ` Lennert Buytenhek
  0 siblings, 0 replies; 5+ messages in thread
From: Lennert Buytenhek @ 2004-12-01 21:59 UTC (permalink / raw)
  To: Robert Olsson; +Cc: netdev

On Mon, Nov 29, 2004 at 05:16:13PM +0100, Robert Olsson wrote:

>  I've heard some boxes that didn't do the ipg correctly. Don't know what NIC 
>  this was. We can only estimate stats at the point where we are delivering 
>  packets. Other devices has "true" L2 stats.

Just found out the other day that via-rhine appears to do this.


>  OK. Adding FCS yes kinda compromise and maybe was wrong in this aspect.

Let's remove it then?


>  The only solution I can think of is of having a selectable option in 
>  the config for output stats. To support different L2 layers and with  
>  warning if we are "predicting" L2 statistics. Feel free to extend your
>  patch.

At that point it might be easier to just do it in userspace, no?


--L

^ 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).