netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Richard Cochran <richardcochran@gmail.com>
To: "Keller, Jacob E" <jacob.e.keller@intel.com>
Cc: Vladimir Oltean <olteanv@gmail.com>,
	"davem@davemloft.net" <davem@davemloft.net>,
	"jakub.kicinski@netronome.com" <jakub.kicinski@netronome.com>,
	"f.fainelli@gmail.com" <f.fainelli@gmail.com>,
	"vivien.didelot@gmail.com" <vivien.didelot@gmail.com>,
	"andrew@lunn.ch" <andrew@lunn.ch>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>
Subject: Re: [PATCH net] net: dsa: sja1105: Fix double delivery of TX timestamps to socket error queue
Date: Tue, 24 Dec 2019 11:05:31 -0800	[thread overview]
Message-ID: <20191224190531.GA426@localhost> (raw)
In-Reply-To: <02874ECE860811409154E81DA85FBB58B26DF1C9@fmsmsx101.amr.corp.intel.com>

On Tue, Dec 17, 2019 at 10:21:29PM +0000, Keller, Jacob E wrote:
> > -----Original Message-----
> > From: netdev-owner@vger.kernel.org <netdev-owner@vger.kernel.org> On
> > Behalf Of Vladimir Oltean

> My understanding was that setting it prevented the stack from
> generating a SW timestamp if the hardware timestamp was going to be
> provided. Basically, this is because we would otherwise report the
> timestamp twice to applications that expect only one timestamp.

Correct. 

> There were some patches from Miroslav that enabled optionally
> allowed the reporting of both SW and HW timestamps at the same time.

Not quite.  If the user sets SOF_TIMESTAMPING_OPT_TX_SWHW, then there
will be two packets delivered to the error queue, one SW and one HW.

> > There are many more drivers that are in principle broken with DSA PTP,
> > since they don't even have the equivalent check for priv->hwts_tx_en.

Please stop saying that.  It is not true.

> Right. I'm wondering what the correct fix would be so that we can
> fix the drivers and hopefully avoid introducing a similar issue in
> the future.

No fix is needed.  MAC drivers must set SKBTX_IN_PROGRESS and call
skb_tstamp_tx() to deliver the transmit time stamp.  DSA drivers
should call skb_complete_tx_timestamp() to deliver the transmit time
stamp, and they should *not* set SKBTX_IN_PROGRESS.

Thanks,
Richard

  reply	other threads:[~2019-12-24 19:05 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-16 22:33 [PATCH net] net: dsa: sja1105: Fix double delivery of TX timestamps to socket error queue Vladimir Oltean
2019-12-17 19:57 ` Keller, Jacob E
2019-12-17 20:07   ` Vladimir Oltean
2019-12-17 22:21     ` Keller, Jacob E
2019-12-24 19:05       ` Richard Cochran [this message]
2019-12-26 18:24         ` Vladimir Oltean
2019-12-27  1:52           ` Richard Cochran
2019-12-27 15:19             ` Richard Cochran
2019-12-27 15:30               ` Vladimir Oltean
2019-12-27 17:39                 ` Richard Cochran

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=20191224190531.GA426@localhost \
    --to=richardcochran@gmail.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=jacob.e.keller@intel.com \
    --cc=jakub.kicinski@netronome.com \
    --cc=netdev@vger.kernel.org \
    --cc=olteanv@gmail.com \
    --cc=vivien.didelot@gmail.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).