From: Patrick Ohly <patrick.ohly@intel.com>
To: David Miller <davem@davemloft.net>
Cc: "johnstul@us.ibm.com" <johnstul@us.ibm.com>,
"Ronciak, John" <john.ronciak@intel.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>
Subject: Re: [PATCH NET-NEXT 0/10] hardware time stamping with new fields in shinfo
Date: Mon, 16 Feb 2009 08:44:54 +0100 [thread overview]
Message-ID: <1234770294.10885.24.camel@pohly-MOBL> (raw)
In-Reply-To: <20090215.231626.160752710.davem@davemloft.net>
On Mon, 2009-02-16 at 09:16 +0200, David Miller wrote:
> Ok, I applied everything and pushed it out to net-next-2.6, let's
> see how this goes :-)
Thanks :-)
> That TX clone wrt. skb_orphan() issue will need a happier solution.
>
> Can you describe that problem in detail? Maybe someone can come
> up with a way to avoid that stuff.
Bouncing information about a sent packet back to the sender (in
skb_tstamp_tx()) requires access to the socket via which the packet was
sent (orig_skb->sk).
This information must be available after the packet was handed to
ops->ndo_start_xmit() in order to implement the TX time stamping
software fallback for devices which don't implement hardware time
stamping (not enabled and/or not implemented at all).
The problem now is that some device drivers call skb_orphan() on the skb
in ops->ndo_start_xmit(). I suppose the intention is to free some
resources a bit earlier. The unmodified igb driver did this, the bnx2
one didn't.
If skb_orphan() is called, then TX software time stamping is not
possible. A user space daemon cannot detect this reliably, only make a
guess based on the observation that it doesn't receive any TX time
stamps. This is not fatal: the traditional time stamping method used by
PTPd (multicast loop back) still works.
But it would be nicer if that multicast loop back hack wasn't necessary.
TX software time stamping might also be more accurate (it generates the
time stamp after ops->ndo_start_xmit() returns, not before as in the
looped packet code path).
I see several ways to solve this:
* Always create another reference to skb->sk before
ops->ndo_start_xmit() if TX time stamping is requested.
Drawback: performance penalty for drivers which support TX time
stamping or don't call skb_orphan().
* Turn skb_orphan() into a nop during ops->ndo_start_xmit(), again
only if necessary. I think this can done by temporarily
overriding the skb destructor. Drawback: looks like a hack to
me, not sure whether that is really safe.
* Extend the driver API + another reference. Let drivers which
implement TX time stamping (and thus know when to avoid
skb_orphan()) signal that. dev_hard_start_xmit() then can avoid
the "additional sk reference" thing for these drivers. Drawback:
requires analyzing and potentially flagging all drivers to have
a real effect (as for bnx2).
--
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.
next prev parent reply other threads:[~2009-02-16 7:45 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-02-12 14:57 [PATCH NET-NEXT 0/10] hardware time stamping with new fields in shinfo Patrick Ohly
2009-02-12 15:00 ` [PATCH NET-NEXT 01/10] clocksource: allow usage independent of timekeeping.c Patrick Ohly
2009-02-12 15:00 ` [PATCH NET-NEXT 02/10] timecompare: generic infrastructure to map between two time bases Patrick Ohly
2009-02-12 15:00 ` [PATCH NET-NEXT 03/10] net: new user space API for time stamping of incoming and outgoing packets Patrick Ohly
2009-02-12 15:00 ` [PATCH NET-NEXT 04/10] net: infrastructure for hardware time stamping Patrick Ohly
2009-02-12 15:00 ` [PATCH NET-NEXT 05/10] net: socket infrastructure for SO_TIMESTAMPING Patrick Ohly
2009-02-12 15:00 ` [PATCH NET-NEXT 06/10] ip: support for TX timestamps on UDP and RAW sockets Patrick Ohly
2009-02-12 15:00 ` [PATCH NET-NEXT 07/10] net: pass new SIOCSHWTSTAMP through to device drivers Patrick Ohly
2009-02-12 15:00 ` [PATCH NET-NEXT 08/10] igb: access to NIC time Patrick Ohly
2009-02-12 15:00 ` [PATCH NET-NEXT 09/10] igb: stub support for SIOCSHWTSTAMP Patrick Ohly
2009-02-12 15:00 ` [PATCH NET-NEXT 10/10] igb: use timecompare to implement hardware time stamping Patrick Ohly
2009-02-12 15:03 ` [PATCH NET-NEXT 0/10] hardware time stamping with new fields in shinfo Patrick Ohly
2009-02-12 15:03 ` [PATCH NET-NEXT 01/10] clocksource: allow usage independent of timekeeping.c Patrick Ohly
2009-02-12 15:03 ` [PATCH NET-NEXT 02/10] timecompare: generic infrastructure to map between two time bases Patrick Ohly
2009-02-12 15:03 ` [PATCH NET-NEXT 03/10] net: new user space API for time stamping of incoming and outgoing packets Patrick Ohly
2009-02-12 15:03 ` [PATCH NET-NEXT 04/10] net: infrastructure for hardware time stamping Patrick Ohly
2009-02-12 15:03 ` [PATCH NET-NEXT 05/10] net: socket infrastructure for SO_TIMESTAMPING Patrick Ohly
2009-02-12 15:03 ` [PATCH NET-NEXT 06/10] ip: support for TX timestamps on UDP and RAW sockets Patrick Ohly
2009-02-12 15:03 ` [PATCH NET-NEXT 07/10] net: pass new SIOCSHWTSTAMP through to device drivers Patrick Ohly
2009-02-12 15:03 ` [PATCH NET-NEXT 08/10] igb: access to NIC time Patrick Ohly
2009-02-12 15:03 ` [PATCH NET-NEXT 09/10] igb: stub support for SIOCSHWTSTAMP Patrick Ohly
2009-02-12 15:03 ` [PATCH NET-NEXT 10/10] igb: use timecompare to implement hardware time stamping Patrick Ohly
2009-02-16 7:16 ` [PATCH NET-NEXT 0/10] hardware time stamping with new fields in shinfo David Miller
2009-02-16 7:44 ` Patrick Ohly [this message]
2009-02-21 9:15 ` 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=1234770294.10885.24.camel@pohly-MOBL \
--to=patrick.ohly@intel.com \
--cc=davem@davemloft.net \
--cc=john.ronciak@intel.com \
--cc=johnstul@us.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--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