[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <DB7PR04MB5017355B61A31D61340A52A3F8099@DB7PR04MB5017.eurprd04.prod.outlook.com>
Date: Tue, 22 Jun 2021 10:35:13 +0000
From: "Y.b. Lu" <yangbo.lu@....com>
To: Richard Cochran <richardcochran@...il.com>
CC: "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linux-kselftest@...r.kernel.org" <linux-kselftest@...r.kernel.org>,
"mptcp@...ts.linux.dev" <mptcp@...ts.linux.dev>,
"David S . Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>,
Mat Martineau <mathew.j.martineau@...ux.intel.com>,
Matthieu Baerts <matthieu.baerts@...sares.net>,
Shuah Khan <shuah@...nel.org>,
Michal Kubecek <mkubecek@...e.cz>,
Florian Fainelli <f.fainelli@...il.com>,
Andrew Lunn <andrew@...n.ch>, Rui Sousa <rui.sousa@....com>,
Sebastien Laveze <sebastien.laveze@....com>
Subject: RE: [net-next, v3, 02/10] ptp: support ptp physical/virtual clocks
conversion
Hi Richard,
> -----Original Message-----
> From: Richard Cochran <richardcochran@...il.com>
> Sent: 2021年6月18日 2:28
> To: Y.b. Lu <yangbo.lu@....com>
> Cc: netdev@...r.kernel.org; linux-kernel@...r.kernel.org;
> linux-kselftest@...r.kernel.org; mptcp@...ts.linux.dev; David S . Miller
> <davem@...emloft.net>; Jakub Kicinski <kuba@...nel.org>; Mat Martineau
> <mathew.j.martineau@...ux.intel.com>; Matthieu Baerts
> <matthieu.baerts@...sares.net>; Shuah Khan <shuah@...nel.org>; Michal
> Kubecek <mkubecek@...e.cz>; Florian Fainelli <f.fainelli@...il.com>;
> Andrew Lunn <andrew@...n.ch>; Rui Sousa <rui.sousa@....com>; Sebastien
> Laveze <sebastien.laveze@....com>
> Subject: Re: [net-next, v3, 02/10] ptp: support ptp physical/virtual clocks
> conversion
>
> On Tue, Jun 15, 2021 at 05:45:09PM +0800, Yangbo Lu wrote:
>
> > diff --git a/drivers/ptp/ptp_private.h b/drivers/ptp/ptp_private.h
> > index 3f388d63904c..6949afc9d733 100644
> > --- a/drivers/ptp/ptp_private.h
> > +++ b/drivers/ptp/ptp_private.h
> > @@ -46,6 +46,9 @@ struct ptp_clock {
> > const struct attribute_group *pin_attr_groups[2];
> > struct kthread_worker *kworker;
> > struct kthread_delayed_work aux_work;
> > + u8 n_vclocks;
>
> Hm, type is u8, but ...
>
> > + struct mutex n_vclocks_mux; /* protect concurrent n_vclocks access */
> > + bool vclock_flag;
> > };
> >
>
> > #define info_to_vclock(d) container_of((d), struct ptp_vclock, info)
> > diff --git a/include/uapi/linux/ptp_clock.h
> > b/include/uapi/linux/ptp_clock.h index 1d108d597f66..4b933dc1b81b
> > 100644
> > --- a/include/uapi/linux/ptp_clock.h
> > +++ b/include/uapi/linux/ptp_clock.h
> > @@ -69,6 +69,11 @@
> > */
> > #define PTP_PEROUT_V1_VALID_FLAGS (0)
> >
> > +/*
> > + * Max number of PTP virtual clocks per PTP physical clock */
> > +#define PTP_MAX_VCLOCKS 20
>
> Only 20 clocks are allowed? Why?
Initially I think vclock can be used for ptp multiple domains synchronization. Since the PTP domainValue is u8, u8 vclock number is large enough.
This is not a good idea to hard-code a PTP_MAX_VCLOCKS value. But it looks a little crazy to create numbers of vclocks via one command (echo n > /sys/class/ptp/ptp0/n_vclocks).
Maybe a typo creates hundreds of vclocks we don’t need.
Do you think we should be care about setting a limitation of vclock number? Any suggestion for implementation?
Thanks.
>
> Thanks,
> Richard
Powered by blists - more mailing lists