From: Patrick Ohly <patrick.ohly@intel.com>
To: Octavian Purdila <opurdila@ixiacom.com>
Cc: netdev@vger.kernel.org
Subject: Re: [RFC][PATCH 1/2] net: support for TX timestamps
Date: Wed, 30 Jul 2008 14:43:33 +0200 [thread overview]
Message-ID: <1217421813.30512.169.camel@ecld0pohly> (raw)
In-Reply-To: <1217291753-5322-2-git-send-email-opurdila@ixiacom.com>
On Tue, 2008-07-29 at 03:35 +0300, Octavian Purdila wrote:
> The actual timestamp will reach userspace as a RX timestamp on the
> cloned packet. If timestamping is requested and no timestamping is
> done in the device driver (potentially this may use hardware
> timestamping), it will be done in software after the device's
> start_hard_xmit routine.
This needs to be augmented to not fall back to software time stamping,
as discussed in "[RFC][PATCH 1/1] net: support for hardware
timestamping".
Apart from that the API looks okay. It should be fairly simple to adapt
PTPd.
> @@ -1568,6 +1576,8 @@ static int dev_gso_segment(struct sk_buff *skb)
>
> int dev_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
> {
> + int rc;
> +
> if (likely(!skb->next)) {
> if (!list_empty(&ptype_all))
> dev_queue_xmit_nit(skb, dev);
> @@ -1579,13 +1589,15 @@ int dev_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
> goto gso;
> }
>
> - return dev->hard_start_xmit(skb, dev);
> + rc = dev->hard_start_xmit(skb, dev);
> + if (likely(!rc))
> + net_tx_timestamp(skb);
> + return rc;
> }
How do you recognize whether the driver did hardware time stamping? Hmm,
okay, I think I can answer that myself: if the driver supports hardware
time stamping, it must clear tstamp in its hard_start_xmit(). Later on
when it has transmitted the packet, it extracts the corresponding
hardware time stamp and calls skb_tx_timestamp(). Right? If so, this
should go into a comment somewhere.
The implicit assumption here is that drivers do not touch tstamp,
because otherwise software time stamping might accidentally be disabled
by a driver. That seems to be the case, at least for in-kernel drivers.
Is skb->sk always guaranteed to be set in hard_start_xmit?
skb_tx_timestamp() depends on it. In 2.6.23 the field always seemed to
be valid, but in 2.6.26 I think I have seen NULL pointers there for PTP
UDP broadcasts.
--
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:[~2008-07-30 12:45 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-07-29 0:35 [RFC][PATCH 0/2] net: support for TX timestamps Octavian Purdila
2008-07-29 0:35 ` [RFC][PATCH 1/2] " Octavian Purdila
2008-07-30 12:43 ` Patrick Ohly [this message]
2008-07-30 13:15 ` Octavian Purdila
2008-07-30 13:34 ` Patrick Ohly
2008-07-30 13:36 ` Octavian Purdila
2008-07-29 0:35 ` [RFC][PATCH 2/2] ip: support for TX timestamps on UDP and RAW sockets Octavian Purdila
2008-07-30 9:47 ` [RFC][PATCH 0/2] net: support for TX timestamps Ingo Oeser
2008-07-30 13:02 ` Octavian Purdila
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=1217421813.30512.169.camel@ecld0pohly \
--to=patrick.ohly@intel.com \
--cc=netdev@vger.kernel.org \
--cc=opurdila@ixiacom.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).