netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Miroslav Lichvar <mlichvar@redhat.com>
To: Willem de Bruijn <willemdebruijn.kernel@gmail.com>
Cc: Network Development <netdev@vger.kernel.org>,
	Richard Cochran <richardcochran@gmail.com>,
	Willem de Bruijn <willemb@google.com>
Subject: Re: [PATCH v3 net-next 5/7] net: don't make false software transmit timestamps
Date: Wed, 17 May 2017 12:27:07 +0200	[thread overview]
Message-ID: <20170517102707.GE4156@localhost> (raw)
In-Reply-To: <CAF=yD-+rFQBER8A=P216Bgbtxq+zHgAERoZaGdp=dvo=_otMXA@mail.gmail.com>

On Tue, May 16, 2017 at 06:34:38PM -0400, Willem de Bruijn wrote:
> On Tue, May 16, 2017 at 8:44 AM, Miroslav Lichvar <mlichvar@redhat.com> wrote:
> > If software timestamping is enabled by the SO_TIMESTAMP(NS) option
> > when a message without timestamp is already waiting in the queue, the
> > __sock_recv_timestamp() function will read the current time to make a
> > timestamp in order to always have something for the application.
> >
> > However, this applies also to outgoing packets looped back to the error
> > queue when hardware timestamping is enabled by the SO_TIMESTAMPING
> > option.
> 
> This is already the case for sockets that have both software receive
> timestamps and hardware tx timestamps enabled, independent from
> the new option SOF_TIMESTAMPING_OPT_TX_SWHW, right? If so,
> then this behavior must remain.

Even if we consider that it's not actually returning a valid TX
timestamp and it didn't behave as documented ("Only one field is
non-zero at any time")?

On the RX side this timestamp does make some sense as it could be
viewed as a very late timestamp, correctly ordered after the HW
timestamp, but on the TX side the order is reversed and returning a
timestamp later than the actual transmission might break a protocol.

If you don't see it as a bug fix, I think this weird interaction
between the SO_TIMESTAMPING(NS) and SO_TIMESTAMPING options needs to
be documented.

-- 
Miroslav Lichvar

  reply	other threads:[~2017-05-17 10:27 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-16 12:44 [PATCH v3 net-next 0/7] Extend socket timestamping API Miroslav Lichvar
2017-05-16 12:44 ` [PATCH v3 net-next 1/7] net: define receive timestamp filter for NTP Miroslav Lichvar
2017-05-16 12:44 ` [PATCH v3 net-next 2/7] net: ethernet: update drivers to handle HWTSTAMP_FILTER_NTP_ALL Miroslav Lichvar
2017-05-16 12:44 ` [PATCH v3 net-next 3/7] net: add function to retrieve original skb device using NAPI ID Miroslav Lichvar
2017-05-16 22:29   ` Willem de Bruijn
2017-05-16 12:44 ` [PATCH v3 net-next 4/7] net: add new control message for incoming HW-timestamped packets Miroslav Lichvar
2017-05-16 22:29   ` Willem de Bruijn
2017-05-17 14:11   ` Soheil Hassas Yeganeh
2017-05-17 17:21     ` Richard Cochran
2017-05-16 12:44 ` [PATCH v3 net-next 5/7] net: don't make false software transmit timestamps Miroslav Lichvar
2017-05-16 22:34   ` Willem de Bruijn
2017-05-17 10:27     ` Miroslav Lichvar [this message]
2017-05-17 13:52       ` Willem de Bruijn
2017-05-16 12:44 ` [PATCH v3 net-next 6/7] net: allow simultaneous SW and HW transmit timestamping Miroslav Lichvar
2017-05-16 22:31   ` Willem de Bruijn
2017-05-16 12:44 ` [PATCH v3 net-next 7/7] net: ethernet: update drivers to make both SW and HW TX timestamps Miroslav Lichvar

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=20170517102707.GE4156@localhost \
    --to=mlichvar@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=richardcochran@gmail.com \
    --cc=willemb@google.com \
    --cc=willemdebruijn.kernel@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).