public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
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 11:55:35 +0100	[thread overview]
Message-ID: <473982A7.6040409@cosmosbay.com> (raw)
In-Reply-To: <2cbbd8de0711130239j67127e1cxf312033aee1ddd5a@mail.gmail.com>

Antoine Zen-Ruffinen a écrit :
> This is exactly my problem : The driver of the network card I am using
> (see rt2x00.serialmonkey.com) do the minimum in the hardware interrupt
> (not filling skb->tstamp). Then netif_rx() is called later using a
> tasklet (also not filling skb->tstamp). As it seem to me (maybe I am
> wrong, if so please tell), the elapse time between the actual frame
> arrival and the time where netif_rx() do net_timestamp(skb) is not
> predicable !?
>
> Else, I would like to thank you to spend time helping me.
>
>
>   
A tasklet could process the skb much later than corresponding IRQ, 
depending on various things
(other tasks/softirqs on system with higher priorities). So yes, it is 
not predictable at all.

Usually it doesnt matter, but if your business depends on precise tstamps,
then just do skb->tstamp = ktime_get_real(); in IRQ handler (but it will 
slow it a bit,
depending on how fast is ktime_get_real() on the target machine)
netif_rx() wont overwrite it.

skb = dev_alloc_skb(desc.size + NET_IP_ALIGN);
if (!skb)
    return;
skb->tstamp = ktime_get_real(); /* do it before other copies */
skb_reserve(skb, NET_IP_ALIGN);
skb_put(skb, desc.size);
memcpy(skb->data, entry->data_addr, desc.size);

...






  parent reply	other threads:[~2007-11-13 10:55 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 [this message]
2007-11-13 12:34           ` Antoine Zen-Ruffinen
2007-11-13 13:13             ` Eric Dumazet
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=473982A7.6040409@cosmosbay.com \
    --to=dada1@cosmosbay$(echo .)com \
    --cc=antoine.zen@gmail$(echo .)com \
    --cc=linux-net@vger$(echo .)kernel.org \
    --cc=netdev@vger$(echo .)kernel.org \
    --cc=netfilter-devel@vger$(echo .)kernel.org \
    --cc=patrik.arlos@bth$(echo .)se \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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