Re: NIC and Timing

From: Andrew Morton (morton@nortelnetworks.com)
Date: Thu Mar 16 2000 - 06:00:45 EST


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
http://www.uow.edu.au/~andrewm/linux/ - 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 majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Thu Mar 23 2000 - 21:00:18 EST