lkml.org 
[lkml]   [2002]   [Jan]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
Subjecthigh resolution timer for packet timestamping
This topic has been brought up before, but I'm wondering where the current
state of affairs is on this.

I have a need to perform high resolution timestamping on received packets
(traffic measurement). I realize that interrupt latency may prevent me
from getting a truly accurate timestamp, but best effort here seems to be
better than not-so-best effort.

In the netif_rx() function of net/core/dev.c, the lines:

if (skb->stamp.tv_sec == 0)
get_fast_time(&skb->stamp);

could be replaced with something like:

if (hires_rx_timestamp)
do_gettimeofday(&skb->stamp);
else
get_fast_time(&skb->stamp);

where, say, "hires_rx_timestamp" is a sysctl tunable variable exposed via
/proc/sys/net/core/hires_rx_timestamp.

One of the drawbacks of this approach (I think) is that the runtime
configurable parameter has system level performance implications rather
than socket specific performance implications.

Alternatively, the high res timestamp can be done in the protocol layer,
but this makes it even further away from the device driver.

I'm at a bit of a loss regarding what the best approach is. Would like
some feedback. I'd be happy to submit a proper patch.

Thanks.

PS. I'm having some trouble successfully subscribing to the list, so for
the time being, please cc my email address.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

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