Re: Problem with frame time stamping

From: Eric Dumazet
Date: Tue Nov 13 2007 - 05:27:34 EST


Antoine Zen-Ruffinen a écrit :
What does it bring me to have a nanosecond precision if it is not
related to the actual arrival of frame time ? As it seem I can feel
skb->tstamp with whatever I want, I always become something else using
ioctl(). (I'm using kernel 2.6.23).

I guess you misunderstood kernel source, because it is related to arrival time, more exactly when it was processed by network stack.
(Beware modern NICS can delay the rx interrupt by some us (ethtool -c eth0), so that an interrupt can feed more than one packet to the OS)

Check net/core/dev.c function netif_rx()

{
...
if (!skb->tstamp.tv64)
net_timestamp(skb);

}

So as soon your system as at least one socket 'asking for tsamps', netstamp_needed is not null, and net_timestamp() will call __net_timestamp()
wich does :

skb->tstamp = ktime_get_real();

So you should not 'feed' tstamp.tv64 and let it being 0, so that netif_rx() can do its job.





-
To unsubscribe from this list: send the line "unsubscribe linux-net" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html