[lkml]   [2000]   [Mar]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: NIC and Timing
Ziad Sayegh wrote:
> Hi,
> I would like to get the time delay that a packet suffers from the time it is
> ready to be sent (with all the headers, TCP, IP, Ethernet...) till the time
> the first byte of it is actually sent.

If you have a Pentium you may care to look at the timepeg code at - this will provide you with the
measurement tools.

> ...
> Can somebody give me some light on how this process is actually done and
> what part of the code do I have to look at to put some timers and to get the
> delays for each step?

The network send path is quite complex. This rather depends on
precisely what you're trying to do. You could simply drop a timepeg in
(for example) sys_sendto() and then another in your driver's
hard_start_xmit() method. Or you could dive in the middle somewhere
like net/ipv4/ip_output.c:output_maybe_reroute().

> I'm also interested in the upstream way, this is, the time that takes for a
> packet which is in the network card to get into an sk_buff in the memory.
> For the code that I should look at, I'm assuming that we are using and
> ethernet card.

That's a bit tricky because there's no way that software can tell the
time interval between the hardware's interrupt assertion and the entry
to the ISR (interupts may be blocked somewhere). The best you can do is
to put a timepeg at the start of the driver's Rx ISR and others at the
various points of interest back up through netif_rx().

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
Please read the FAQ at

 \ /
  Last update: 2005-03-22 13:57    [W:0.042 / U:1.264 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site