All of lore.kernel.org
 help / color / mirror / Atom feed
From: Willem de Bruijn <willemdebruijn.kernel@gmail.com>
To: "Michael S. Tsirkin" <mst@redhat.com>
Cc: virtualization@lists.linux-foundation.org,
	Network Development <netdev@vger.kernel.org>,
	Jason Wang <jasowang@redhat.com>,
	Richard Cochran <richardcochran@gmail.com>,
	Willem de Bruijn <willemb@google.com>
Subject: Re: [PATCH RFC v2 3/4] virtio-net: support transmit timestamp
Date: Tue, 9 Feb 2021 09:45:08 -0500	[thread overview]
Message-ID: <CAF=yD-LepCKmpRbQyHP5+61ewCSpwOHmsQm_GNBcTi03Z5knXA@mail.gmail.com> (raw)
In-Reply-To: <20210209044125-mutt-send-email-mst@kernel.org>

On Tue, Feb 9, 2021 at 4:43 AM Michael S. Tsirkin <mst@redhat.com> wrote:
>
> On Mon, Feb 08, 2021 at 01:55:57PM -0500, Willem de Bruijn wrote:
> > From: Willem de Bruijn <willemb@google.com>
> >
> > Add optional PTP hardware tx timestamp offload for virtio-net.
> >
> > Accurate RTT measurement requires timestamps close to the wire.
> > Introduce virtio feature VIRTIO_NET_F_TX_TSTAMP, the transmit
> > equivalent to VIRTIO_NET_F_RX_TSTAMP.
> >
> > The driver sets VIRTIO_NET_HDR_F_TSTAMP to request a timestamp
> > returned on completion. If the feature is negotiated, the device
> > either places the timestamp or clears the feature bit.
> >
> > The timestamp straddles (virtual) hardware domains. Like PTP, use
> > international atomic time (CLOCK_TAI) as global clock base. The driver
> > must sync with the device, e.g., through kvm-clock.
> >
> > Modify can_push to ensure that on tx completion the header, and thus
> > timestamp, is in a predicatable location at skb_vnet_hdr.
> >
> > RFC: this implementation relies on the device writing to the buffer.
> > That breaks DMA_TO_DEVICE semantics. For now, disable when DMA is on.
>
> If you do something like this, please do it in the validate
> callback and clear the features you aren't using.

Ah yes. Thanks for the tip. I'll do that ..

.. once I'm sure that this approach of using an outbuf for I/O is
actually allowed behavior. I'm not entirely convinced yet myself.
Jason also pointed out more specific concerns. I'll look into that
further.

WARNING: multiple messages have this Message-ID (diff)
From: Willem de Bruijn <willemdebruijn.kernel@gmail.com>
To: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Willem de Bruijn <willemb@google.com>,
	Network Development <netdev@vger.kernel.org>,
	Richard Cochran <richardcochran@gmail.com>,
	virtualization@lists.linux-foundation.org
Subject: Re: [PATCH RFC v2 3/4] virtio-net: support transmit timestamp
Date: Tue, 9 Feb 2021 09:45:08 -0500	[thread overview]
Message-ID: <CAF=yD-LepCKmpRbQyHP5+61ewCSpwOHmsQm_GNBcTi03Z5knXA@mail.gmail.com> (raw)
In-Reply-To: <20210209044125-mutt-send-email-mst@kernel.org>

On Tue, Feb 9, 2021 at 4:43 AM Michael S. Tsirkin <mst@redhat.com> wrote:
>
> On Mon, Feb 08, 2021 at 01:55:57PM -0500, Willem de Bruijn wrote:
> > From: Willem de Bruijn <willemb@google.com>
> >
> > Add optional PTP hardware tx timestamp offload for virtio-net.
> >
> > Accurate RTT measurement requires timestamps close to the wire.
> > Introduce virtio feature VIRTIO_NET_F_TX_TSTAMP, the transmit
> > equivalent to VIRTIO_NET_F_RX_TSTAMP.
> >
> > The driver sets VIRTIO_NET_HDR_F_TSTAMP to request a timestamp
> > returned on completion. If the feature is negotiated, the device
> > either places the timestamp or clears the feature bit.
> >
> > The timestamp straddles (virtual) hardware domains. Like PTP, use
> > international atomic time (CLOCK_TAI) as global clock base. The driver
> > must sync with the device, e.g., through kvm-clock.
> >
> > Modify can_push to ensure that on tx completion the header, and thus
> > timestamp, is in a predicatable location at skb_vnet_hdr.
> >
> > RFC: this implementation relies on the device writing to the buffer.
> > That breaks DMA_TO_DEVICE semantics. For now, disable when DMA is on.
>
> If you do something like this, please do it in the validate
> callback and clear the features you aren't using.

Ah yes. Thanks for the tip. I'll do that ..

.. once I'm sure that this approach of using an outbuf for I/O is
actually allowed behavior. I'm not entirely convinced yet myself.
Jason also pointed out more specific concerns. I'll look into that
further.
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

  reply	other threads:[~2021-02-09 14:46 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-08 18:55 [PATCH RFC v2 0/4] virtio-net: add tx-hash, rx-tstamp, tx-tstamp and tx-time Willem de Bruijn
2021-02-08 18:55 ` Willem de Bruijn
2021-02-08 18:55 ` [PATCH RFC v2 1/4] virtio-net: support transmit hash report Willem de Bruijn
2021-02-08 18:55   ` Willem de Bruijn
2021-02-08 18:55 ` [PATCH RFC v2 2/4] virtio-net: support receive timestamp Willem de Bruijn
2021-02-08 18:55   ` Willem de Bruijn
2021-02-09  4:13   ` Jason Wang
2021-02-09 13:53     ` Willem de Bruijn
2021-02-09 13:53       ` Willem de Bruijn
2021-02-10  4:10       ` Jason Wang
2021-02-10  4:10         ` Jason Wang
2021-02-08 18:55 ` [PATCH RFC v2 3/4] virtio-net: support transmit timestamp Willem de Bruijn
2021-02-08 18:55   ` Willem de Bruijn
2021-02-09  5:45   ` Jason Wang
2021-02-09  5:45     ` Jason Wang
2021-02-09 16:38     ` Michael S. Tsirkin
2021-02-09 16:38       ` Michael S. Tsirkin
2021-02-10  2:36       ` Willem de Bruijn
2021-02-10  2:36         ` Willem de Bruijn
2021-02-10  4:15         ` Jason Wang
2021-02-10  4:15           ` Jason Wang
2021-02-10 14:40           ` Willem de Bruijn
2021-02-10 14:40             ` Willem de Bruijn
2021-02-10  4:12       ` Jason Wang
2021-02-10  4:12         ` Jason Wang
2021-02-09  9:42   ` Michael S. Tsirkin
2021-02-09 14:45     ` Willem de Bruijn [this message]
2021-02-09 14:45       ` Willem de Bruijn
2021-02-08 18:55 ` [PATCH RFC v2 4/4] virtio-net: support future packet transmit time Willem de Bruijn
2021-02-08 18:55   ` Willem de Bruijn
2021-05-13 22:49 ` [PATCH RFC v2 0/4] virtio-net: add tx-hash, rx-tstamp, tx-tstamp and tx-time Willem de Bruijn
2021-05-14  7:12   ` Jason Wang
2021-05-14  7:12     ` Jason Wang
2021-05-14 12:46     ` Willem de Bruijn
2021-05-14 12:46       ` Willem de Bruijn

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='CAF=yD-LepCKmpRbQyHP5+61ewCSpwOHmsQm_GNBcTi03Z5knXA@mail.gmail.com' \
    --to=willemdebruijn.kernel@gmail.com \
    --cc=jasowang@redhat.com \
    --cc=mst@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=richardcochran@gmail.com \
    --cc=virtualization@lists.linux-foundation.org \
    --cc=willemb@google.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.