[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CO1PR11MB50894A28220E758BACAADDFBD6122@CO1PR11MB5089.namprd11.prod.outlook.com>
Date: Wed, 8 Jan 2025 00:34:51 +0000
From: "Keller, Jacob E" <jacob.e.keller@...el.com>
To: Andrew Lunn <andrew@...n.ch>, Jiawen Wu <jiawenwu@...stnetic.com>
CC: "andrew+netdev@...n.ch" <andrew+netdev@...n.ch>, "davem@...emloft.net"
<davem@...emloft.net>, "edumazet@...gle.com" <edumazet@...gle.com>,
"kuba@...nel.org" <kuba@...nel.org>, "pabeni@...hat.com" <pabeni@...hat.com>,
"richardcochran@...il.com" <richardcochran@...il.com>,
"linux@...linux.org.uk" <linux@...linux.org.uk>, "horms@...nel.org"
<horms@...nel.org>, "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"mengyuanlou@...-swift.com" <mengyuanlou@...-swift.com>
Subject: RE: [PATCH net-next 1/4] net: wangxun: Add support for PTP clock
> -----Original Message-----
> From: Andrew Lunn <andrew@...n.ch>
> Sent: Tuesday, January 7, 2025 5:33 AM
> To: Jiawen Wu <jiawenwu@...stnetic.com>
> Cc: andrew+netdev@...n.ch; davem@...emloft.net; edumazet@...gle.com;
> kuba@...nel.org; pabeni@...hat.com; richardcochran@...il.com;
> linux@...linux.org.uk; horms@...nel.org; Keller, Jacob E
> <jacob.e.keller@...el.com>; netdev@...r.kernel.org; mengyuanlou@...-
> swift.com
> Subject: Re: [PATCH net-next 1/4] net: wangxun: Add support for PTP clock
>
> > > > > > +/**
> > > > > > + * wx_ptp_tx_hwtstamp_work
> > > > > > + * @work: pointer to the work struct
> > > > > > + *
> > > > > > + * This work item polls TSYNCTXCTL valid bit to determine when a Tx
> hardware
> > > > > > + * timestamp has been taken for the current skb. It is necessary,
> because the
> > > > > > + * descriptor's "done" bit does not correlate with the timestamp event.
> > > > > > + */
> > > > >
> > > > > Are you saying the "done" bit can be set, but the timestamp is not yet
> > > > > in place? I've not read the whole patch, but do you start polling once
> > > > > "done" is set, or as soon at the skbuff is queues for transmission?
> > > >
> > > > The descriptor's "done" bit cannot be used as a basis for Tx hardware
> > > > timestamp. So we should poll the valid bit in the register.
> > >
> > > You did not answer my question. When do you start polling?
> >
> > As soon at the skbuff is queues for transmission.
>
> I assume polling is not for free? Is it possible to start polling once
> 'done' is set? Maybe do some benchmarks and see if that saves you some
> cycles?
>
> Andrew
>
Agreed, I would try to benchmark that. Timestamps need to be returned relatively quickly, which means the polling rate needs to be high. This costs a lot of CPU, and so any mechanism that lets you start later will help the CPU cost.
Thanks,
Jake
Powered by blists - more mailing lists