[Click] kernel click - packet timestamps

Alastair McKinley amckinley03 at qub.ac.uk
Tue Mar 28 19:59:51 EST 2006


Hi everyone,

I figured this out so I thought I would let the list know.

I had a look at the source for my ethernet driver, a via_rhine chipset.
Well it looked like the timestamp should have been set, but I discovered
that it wasn't being set by the driver:

rhine_interrupt() 
{
	calls rhine_rx()
	{
		struct sk_buff *skb; 
		calls netif_rx(skb)
		{
			if(!skb->stamp.tv_sec)
			calls net_timestamp(&skb->stamp)
			{         
				if (atomic_read(&netstamp_needed))
                			do_gettimeofday(stamp);
        
				else {
                			stamp->tv_sec = 0;
                			stamp->tv_usec = 0;
        			}
 
			}
		}

	}	
}

The problem was, netstamp_needed was not set.  So I stuck in a call to
net_enable_timestamp() in the initialisation of the driver.

Problem solved, the timestamps now get set correctly and I can see them
when I run the test case I gave below.

Best regards,

Alastair

> Hi Eddie,
> 
> Sorry for the lack of info.  The packets are just spanning tree packets
> from a switch.
> 
> I ran this config at userlevel and kernel mode to illustrate my problem:
> 
> FromDevice(eth0, PROMISC true) -> Queue() -> Print("Packet",24,TIMESTAMP
> true) -> TimedSink(0.1);
> 
> When I run this at userlevel, the packet timestamps get printed nicely.
> However, when I run this in kernel mode click, the packet timestamps all
> appear as 0.000000.
> 
> I'm not sure why this is, so I'm stuck!
> 
> Alastair
> 
> 
> On Thu, 2006-03-23 at 10:07 -0800, Eddie Kohler wrote:
> > Have you tried "Print(TIMESTAMP true)"?
> > 
> > How are you generating the packets?  Perhaps their timestamps really are 0 in 
> > the kernel.  As always we appreciate full configurations.
> > 
> > Eddie
> > 
> > 
> > Alastair McKinley wrote:
> > > Hi everyone,
> > > 
> > > I'm having a problem (another one) with packet timestamps at kernel
> > > level.  I've been trying to print packet timestamps both with the
> > > standard print element and my own element.  This works fine at userlevel
> > > with something like:
> > > 
> > > 	StringAccum sa;
> > > 	sa << p->timestamp_anno();
> > > 	click_chatter("%s",sa.c_str());
> > > 
> > > However, when I use the same element in the kernel, all the packet
> > > timestamps appear to be 0.000.  Can anyone tell me why and what to do
> > > about it? Or have I missed something?
> > > 
> > > Best regards and thanks,
> > > 
> > > Alastair
> > > 
> > > 
> > > _______________________________________________
> > > click mailing list
> > > click at amsterdam.lcs.mit.edu
> > > https://amsterdam.lcs.mit.edu/mailman/listinfo/click




More information about the click mailing list