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>,
	Soheil Hassas Yeganeh <soheil@google.com>,
	"Keller, Jacob E" <jacob.e.keller@intel.com>,
	Denny Page <dennypage@me.com>, Jiri Benc <jbenc@redhat.com>
Subject: Re: [RFC PATCH 3/7] net: add option to get information about timestamped packets
Date: Thu, 13 Apr 2017 17:18:06 +0200	[thread overview]
Message-ID: <20170413151806.GA26613@localhost> (raw)
In-Reply-To: <CAF=yD-Lsbr7f7aPUsFF3gCtFdyR8yb1=VBPJGQuxv_JbrJud6Q@mail.gmail.com>

On Thu, Apr 13, 2017 at 10:37:07AM -0400, Willem de Bruijn wrote:
> On Wed, Apr 12, 2017 at 10:17 AM, Miroslav Lichvar <mlichvar@redhat.com> wrote:
> > Extend the skb_shared_hwtstamps structure with the index of the
> > real interface which received or transmitted the packet and the length
> > of the packet at layer 2.
> 
> The original packet is received along with the timestamp.

But only outgoing packets, right?

> Why is this L2 length needed?

It's needed for incoming packets to allow converting of preamble
timestamps to trailer timestamps.

> > Add a SOF_TIMESTAMPING_OPT_PKTINFO flag to
> > the SO_TIMESTAMPING option to allow applications to get this information
> > as struct scm_ts_pktinfo in SCM_TIMESTAMPING_PKTINFO control message.
> 
> This patch saves skb->dev->ifindex, which is the same as existing
> SOF_TIMESTAMPING_OPT_CMSG. See also the bug fix for that
> feature I sent yesterday: http://patchwork.ozlabs.org/patch/750197/

The main point is that it provides the index of the device which
received the packet. It does duplicate the functionality of OPT_CMSG +
IP_PKTINFO for outgoing packets, but I thought it might be useful with
the TSONLY option.

BTW, the original ifindex used to be in skb->skb_iif, but that changed
in b6858177.

> If the intent is to return a different ifindex, I would still suggest using
> the existing pktinfo infrastructure, but changing the ifindex that is
> recorded.

How would the application get the l2 length? If this (l2 length,
if_index) tuple is specific to timestamping, I think it would make
sense to keep it out of the IP layer.

-- 
Miroslav Lichvar

  reply	other threads:[~2017-04-13 15:18 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-12 14:17 [RFC PATCH 0/7] Extend socket timestamping API Miroslav Lichvar
2017-04-12 14:17 ` [RFC PATCH 1/7] net: define receive timestamp filter for NTP Miroslav Lichvar
2017-04-12 14:17 ` [RFC PATCH 2/7] net: ethernet: update drivers to handle HWTSTAMP_FILTER_NTP_ALL Miroslav Lichvar
2017-04-12 19:49   ` Richard Cochran
2017-04-13  9:00   ` Keller, Jacob E
2017-04-12 14:17 ` [RFC PATCH 3/7] net: add option to get information about timestamped packets Miroslav Lichvar
2017-04-13 14:37   ` Willem de Bruijn
2017-04-13 15:18     ` Miroslav Lichvar [this message]
2017-04-13 16:16       ` Willem de Bruijn
2017-04-24  9:00         ` Miroslav Lichvar
2017-04-24 15:18           ` Willem de Bruijn
2017-04-25 13:56             ` Miroslav Lichvar
2017-04-25 17:23               ` Willem de Bruijn
2017-04-12 14:17 ` [RFC PATCH 4/7] net: ethernet: update drivers to provide timestamping packet info Miroslav Lichvar
2017-04-13  9:04   ` Keller, Jacob E
2017-04-12 14:17 ` [RFC PATCH 5/7] net: don't make false software transmit timestamps Miroslav Lichvar
2017-04-12 14:17 ` [RFC PATCH 6/7] net: allow simultaneous SW and HW transmit timestamping Miroslav Lichvar
2017-04-13 14:30   ` Willem de Bruijn
2017-04-13 14:59     ` Miroslav Lichvar
2017-04-13 15:24       ` Keller, Jacob E
2017-04-13 16:17         ` Willem de Bruijn
2017-04-12 14:17 ` [RFC PATCH 7/7] net: ethernet: update drivers to make both SW and HW TX timestamps Miroslav Lichvar
2017-04-13  9:08 ` [RFC PATCH 0/7] Extend socket timestamping API Keller, Jacob E
2017-04-13  9:53   ` Miroslav Lichvar
2017-04-13 10:45     ` Keller, Jacob E

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=20170413151806.GA26613@localhost \
    --to=mlichvar@redhat.com \
    --cc=dennypage@me.com \
    --cc=jacob.e.keller@intel.com \
    --cc=jbenc@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=richardcochran@gmail.com \
    --cc=soheil@google.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).