[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <DB7PR04MB5017E8CEA0DA148A4EB1EAF9F83F9@DB7PR04MB5017.eurprd04.prod.outlook.com>
Date: Mon, 31 May 2021 11:26:18 +0000
From: "Y.b. Lu" <yangbo.lu@....com>
To: Richard Cochran <richardcochran@...il.com>
CC: "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"David S . Miller" <davem@...emloft.net>,
Claudiu Manoil <claudiu.manoil@....com>,
Jakub Kicinski <kuba@...nel.org>
Subject: RE: [net-next, v2, 7/7] enetc: support PTP domain timestamp
conversion
> -----Original Message-----
> From: Richard Cochran <richardcochran@...il.com>
> Sent: 2021年5月25日 20:49
> To: Y.b. Lu <yangbo.lu@....com>
> Cc: netdev@...r.kernel.org; David S . Miller <davem@...emloft.net>; Claudiu
> Manoil <claudiu.manoil@....com>; Jakub Kicinski <kuba@...nel.org>
> Subject: Re: [net-next, v2, 7/7] enetc: support PTP domain timestamp
> conversion
>
> On Tue, May 25, 2021 at 05:37:11AM -0700, Richard Cochran wrote:
> > Instead, the conversion from raw time stamp to vclock time stamp
> > should happen in the core infrastructure. That way, no driver hacks
> > will be needed, and it will "just work" everywhere.
>
> For transmit time stamps, we have skb_complete_tx_timestamp().
>
> For receive, most drivers use the following cliche:
>
> shwt = skb_hwtstamps(skb);
> memset(shwt, 0, sizeof(*shwt));
> shwt->hwtstamp = ns_to_ktime(ns);
>
> So the first step will be to introduce a helper function for that, and then
> re-factor the drivers to use the helper.
So, the timestamp conversion could be in skbuff.c.
That's good to do this. But there are quite a lot of drivers using timestamping.
Should we convert all drivers to use the helper, or let others do this when they need?
Thanks.
>
> Thanks,
> Richard
>
>
Powered by blists - more mailing lists