Sorry, a couple of posts in the last couple of days have
gone astray - reposting.
> I am trying to make some measurement of the delays in the IP stack by
adding
> time values inside UDP packets received on a special port. I intend to
hack
> into the xmit function of a particular net driver, as in parts of the
> ip_input.c file. What is in your opinion the first function of ip_input
invoked
> upon reception of a packet, and the last before passing to higher
protocols? I
> thought of ip_rcv(), where incidentally iph = skb->nh.iph; is performed
twice
> (unnecessarily?), and ip_local_deliver_finish().
Yep, ip_rcv() would be the first IP function, and you might
even want to stick the measuring end at the start of
tcp_v4_rcv(), rather than at the end of ip_local_deliver_finish().
You might want to take a look at Andrew Morton's time pegs code:
http://www.uow.edu.au/~andrewm/linux/#timepegs
which allows you to measure latencies between any 2 points of code..
There is a reason for the duplicate iph = skb->nh.iph;
skb might have changed after the call to skb_share_check().
thanks,
Nivedita
|