public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Patrick Ohly <patrick.ohly@intel.com>
To: David Miller <davem@davemloft.net>,
	Herbert Xu <herbert@gondor.apana.org.au>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"Kirsher, Jeffrey T" <jeffrey.t.kirsher@intel.com>
Subject: TX time stamping
Date: Tue, 03 Mar 2009 10:31:21 -0800	[thread overview]
Message-ID: <1236105081.4653.68.camel@pohly-MOBL> (raw)

Hello!

Based on previous discussions, there are some areas of time stamping
which could be improved or needing a fix.

The first being, using skb->sk to send back TX information. The goal is
to notify the sender, and just the sender of the packet about the time
when the packet got transmitted.

I cannot think of how this can be done without skb->sk, but I am open to
suggestions. Without it, one would have to fall back to some kind of
broadcasting scheme were all TX stamped packets are received by all processes
potentially interested in them. This has security issues (packet data
needs to be included to identify packets -> data sent by one user would
be visible to other users; TX stamping feature would have to be
restricted to root, which is not the case now), and potentially impacts
performance (every process has to analyze every packet) and might not be
reliable (depending on the packet payload, processes might not be able
to identify their own packets when they get mixed with those of other
processes).

When an early call to skb_orphan() gets implemented, would it be
acceptable to only do that if no TX time stamping is requested for the
packet? This can be tested relatively fast (check one field in shinfo)?

Second, loopback. I cannot see any issues with loopback, but please let
me know if I have missed something. If I remember (and understand)
correctly, loopback is implemented as writing to a special network
device. Once the TX software fallback is implemented again (see third
point below), then this case can be tested with the timestamping test
program by selecting "lo" as device and asking for TX software time
stamps.

Third, TX software time stamping. I believe a clean solution could work
like this:
      * if TX time stamping is requested, then clone the skb and get a
        reference to the socket
      * ask driver to send packet
      * check status of cloned skb: if TX software fallback is
        necessary, do it using the socket reference
      * drop the references to the cloned skb and the socket

In this scenario the extra work is only done for those packets which
need it. It will work for drivers which call skb_orphan().

As an extra refinement one can later add a driver flag which tells the
kernel that the driver will do the software TX fallback itself. In that
case no extra work needs to be done before calling the driver.

Of course, this all depends on still having the socket before calling
the driver - see above  :-/

-- 
Best Regards, Patrick Ohly

The content of this message is my personal opinion only and although
I am an employee of Intel, the statements I make here in no way
represent Intel's position on the issue, nor am I authorized to speak
on behalf of Intel on this matter.



             reply	other threads:[~2009-03-03 18:31 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-03 18:31 Patrick Ohly [this message]
2009-03-19 21:05 ` TX time stamping David Miller
2009-03-20  2:10   ` Herbert Xu
2009-03-25  7:08     ` Patrick Ohly
2009-03-26 14:48       ` Herbert Xu
2009-03-26 15:30         ` Patrick Ohly
2009-03-30 18:09           ` Oliver Hartkopp
2009-03-31  6:53             ` 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=1236105081.4653.68.camel@pohly-MOBL \
    --to=patrick.ohly@intel.com \
    --cc=davem@davemloft.net \
    --cc=herbert@gondor.apana.org.au \
    --cc=jeffrey.t.kirsher@intel.com \
    --cc=netdev@vger.kernel.org \
    /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