From: Eric Dumazet <dada1@cosmosbay.com>
To: Antoine Zen-Ruffinen <antoine.zen@gmail.com>
Cc: netdev@vger.kernel.org, linux-net@vger.kernel.org,
netfilter-devel@vger.kernel.org, patrik.arlos@bth.se
Subject: Re: Problem with frame time stamping
Date: Tue, 13 Nov 2007 14:13:31 +0100 [thread overview]
Message-ID: <4739A2FB.8030800@cosmosbay.com> (raw)
In-Reply-To: <2cbbd8de0711130434s75e78c35rfda90b81686ee9e1@mail.gmail.com>
Antoine Zen-Ruffinen a écrit :
> THIS is what I did at the beginning. But is seem me to be some thing
> wrong. So I put a static value in skb->tstamp instead of
> ktime_get_real() for debug purpose. And I was still becoming the
> amount of second, microsecond since 1970. We are back to my initial
> mail ! The value of skb->tsamp doesn't seems to be returned by
> ioctl().
>
OK Antoine.
Yes, 'struct timeval' is as you discovered, ie relative to *something*,
a given event in the past. (in your case, CLOCK_REALTIME Epoch : January
1th 1970)
It is even documented (man gettimeofday)
DESCRIPTION
The gettimeofday() function shall obtain the current time,
expressed as seconds and microseconds since the Epoch, and store it in the
timeval structure pointed to by tp.
For timespec STAMPNS, see clock_gettime() description.
clock_gettime(CLOCK_REALTIME, &ts);
If in your driver you stick in tstamp.tv64 a value like 0x00010002, then
the result of ioctl(SIOCGSTAMP) will be :
tv.tv_sec = 0 (so yes, January 1th 1970)
tv.tv_usec = 65 (because 0x10002/1000 = 65)
Not counting the fact that .tv64 should not be directly set, unless for
0 value, because it is not portable.
next prev parent reply other threads:[~2007-11-13 13:13 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-11-12 15:42 Problem with frame time stamping Antoine Zen-Ruffinen
2007-11-12 16:47 ` Eric Dumazet
2007-11-13 10:07 ` Antoine Zen-Ruffinen
2007-11-13 10:27 ` Eric Dumazet
2007-11-13 10:39 ` Antoine Zen-Ruffinen
2007-11-13 10:43 ` Antoine Zen-Ruffinen
2007-11-13 10:55 ` Eric Dumazet
2007-11-13 12:34 ` Antoine Zen-Ruffinen
2007-11-13 13:13 ` Eric Dumazet [this message]
2007-11-13 14:46 ` Antoine Zen-Ruffinen
2007-11-13 10:36 ` Eric Dumazet
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4739A2FB.8030800@cosmosbay.com \
--to=dada1@cosmosbay.com \
--cc=antoine.zen@gmail.com \
--cc=linux-net@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=netfilter-devel@vger.kernel.org \
--cc=patrik.arlos@bth.se \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).