netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eric Dumazet <dada1@cosmosbay.com>
To: Oliver Hartkopp <oliver@hartkopp.net>
Cc: Patrick Ohly <patrick.ohly@intel.com>,
	netdev@vger.kernel.org, Octavian Purdila <opurdila@ixiacom.com>,
	Stephen Hemminger <shemminger@vyatta.com>,
	Ingo Oeser <netdev@axxeo.de>, Andi Kleen <ak@linux.intel.com>,
	"Ronciak, John" <john.ronciak@intel.com>
Subject: Re: hardware time stamps + existing time stamp usage
Date: Sat, 18 Oct 2008 10:54:18 +0200	[thread overview]
Message-ID: <48F9A43A.7070801@cosmosbay.com> (raw)
In-Reply-To: <48F99286.9050706@hartkopp.net>

Oliver Hartkopp a écrit :
> Eric Dumazet wrote:
>>
>> Interesting stuff :)
>>
> 
> Indeed.
> 
>> 1) You want hardware TX stamping on all frames sent behalf a given socket
>>  Mark a WANT_HARDWARE_TX_STAMP flag at socket level
>>   Copy this flag when generating skb for this socket.
>>     When transmitting WANT_HARDWARE_TX_STAMP tagged frame to device,
>>     dont feed it to dev_queue_xmit_nit() in dev_hard_start_xmit()
>>     In NIC driver tx completion, test skb WANT_HARDWARE_TX_STAMP flag.
>>     If set, get tstamp from hardware and copy it to skb tstamp,     
>> and call dev_queue_xmit_nit() (we might avoid cloning skb there, since
>>     nic driver doesnt need it anymore)
>>
>>  This flag could also be set at device level, for all sent frames. 
>> (tcpdump new option)
>>
>> 2) You want hardware RX stamping on a particular device, yet being 
>> able to
>>   deliver system time to legacy apps, unaware of hardware tstamps.
>>
>>   Set a global flag on device, telling linux stack this device feeds 
>> hardware stamp.
>>   In driver RX completion, set skb tstamp with hardware stamps.
>>
>>   Mark a WANT_HARDWARE_RX_STAMP flag at socket level, for PTP 
>> applications.
>>
>>   In recv(), if current socket is not marked WANT_HARDWARE_RX_STAMP 
>> and device has
>>   the global flag set, copy system time in tstamp, overrinding 
>> hardware tstamp.
>>
>>
> 
> Looks good to me. Just one question regarding
> 'copy system time in tstamp, overrinding hardware tstamp':
> 
> When recv() delivers to several sockets there would be probably 
> *different* system time values copied and delivered for the *same* skb, 
> right?

As we introduced a new skb flag for the TX part, we could reuse it in order
to copy system time to tstamp only once for the RX part.
> 
> If so i would tend to fill both (system time and hw timestamp) on driver 
> level into the skb and then decide on socket level what to push into 
> user space as you suggested above.

Well, this would enlarge skb structure by 8 bytes, since you cannot use
same tstamp location to fille both 8 bytes values.
This is probably the easy way, but very expensive...





  reply	other threads:[~2008-10-18  8:54 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-17 14:23 hardware time stamps + existing time stamp usage Patrick Ohly
2008-10-18  5:02 ` Eric Dumazet
2008-10-18  7:38   ` Oliver Hartkopp
2008-10-18  8:54     ` Eric Dumazet [this message]
2008-10-18 10:10       ` Oliver Hartkopp
2008-10-20  7:35         ` Patrick Ohly
2008-10-20 18:01           ` Oliver Hartkopp
2008-10-21  7:29             ` Patrick Ohly
2008-10-18 19:37 ` Octavian Purdila
2008-10-20 12:27   ` Patrick Ohly
2008-10-20 13:07     ` Octavian Purdila
2008-10-20 13:37       ` Patrick Ohly
2008-10-21  7:04   ` Andi Kleen
2008-10-21  7:40     ` Patrick Ohly

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=48F9A43A.7070801@cosmosbay.com \
    --to=dada1@cosmosbay.com \
    --cc=ak@linux.intel.com \
    --cc=john.ronciak@intel.com \
    --cc=netdev@axxeo.de \
    --cc=netdev@vger.kernel.org \
    --cc=oliver@hartkopp.net \
    --cc=opurdila@ixiacom.com \
    --cc=patrick.ohly@intel.com \
    --cc=shemminger@vyatta.com \
    /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).