[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220410134215.GA258320@hoboy.vegasvil.org>
Date: Sun, 10 Apr 2022 06:42:15 -0700
From: Richard Cochran <richardcochran@...il.com>
To: Gerhard Engleder <gerhard@...leder-embedded.com>
Cc: Vinicius Costa Gomes <vinicius.gomes@...el.com>, yangbo.lu@....com,
David Miller <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>, mlichvar@...hat.com,
netdev <netdev@...r.kernel.org>
Subject: Re: [PATCH net-next v2 4/5] ptp: Support late timestamp determination
On Sun, Apr 10, 2022 at 02:54:36PM +0200, Gerhard Engleder wrote:
> > > @@ -887,18 +885,28 @@ void __sock_recv_timestamp(struct msghdr *msg, struct sock *sk,
> > > if (shhwtstamps &&
> > > (sk->sk_tsflags & SOF_TIMESTAMPING_RAW_HARDWARE) &&
> > > !skb_is_swtx_tstamp(skb, false_tstamp)) {
> > > + rcu_read_lock();
> > > + orig_dev = dev_get_by_napi_id(skb_napi_id(skb));
> >
> > __sock_recv_timestamp() is hot path.
> >
> > No need to call dev_get_by_napi_id() for the vast majority of cases
> > using plain old MAC time stamping.
>
> Isn't dev_get_by_napi_id() called most of the time anyway in put_ts_pktinfo()?
No. Only when SOF_TIMESTAMPING_OPT_PKTINFO is requested.
> That's the reason for the removal of a separate flag, which signals the need to
> timestamp determination based on address/cookie. I thought there is no need
> for that flag, as netdev is already available later in the existing code.
>
> > Make this conditional on (sk->sk_tsflags & SOF_TIMESTAMPING_BIND_PHC).
>
> This flag tells netdev_get_tstamp() which timestamp is required. If it
> is not set, then
> netdev_get_tstamp() has to deliver the normal timestamp as always. But
> this normal
> timestamp is only available via address/cookie. So netdev_get_tstamp() must be
> called.
It should be this:
- normal, non-vclock: use hwtstamps->hwtstamp directly
- vclock: use slower path with lookup
I don't see why you can't implement that.
Thanks,
Richard
Powered by blists - more mailing lists