Re: [Linuxptp-devel] [PATCH v2 0/2] Introduce per-port stats for received and transmitted messages

2019-09-10 Thread Richard Cochran
On Tue, Sep 10, 2019 at 05:59:04PM +, Keller, Jacob E wrote: > One thing (unrelated to this patch) I would love to see in the > future is a bit more of an indepth "tutorial" style manpage or > readme that explains how to use pmc, as opposed to trying to parse > the output of the ptp4l log

Re: [Linuxptp-devel] [PATCH v2 0/2] Introduce per-port stats for received and transmitted messages

2019-09-10 Thread Richard Cochran
On Tue, Sep 10, 2019 at 12:23:33PM +, Petr Machata wrote: > Black-box switches with PTP support commonly provide per-port statistics of > number of messages sent and received, split by the message type. Like other > statistics (ip link, ethtool, etc. etc.), network operators use the PTP >

Re: [Linuxptp-devel] [PATCH] udp6: Make mc6_addr transport-local

2019-09-10 Thread Richard Cochran
On Tue, Sep 10, 2019 at 12:51:35PM +, Petr Machata wrote: > mc6_addr holds the parsed multicast address to which messages should be sent. > But since each port can have a different scope, and the primary MC address > depends on the scope, it really can't be stored in a global variable. Move >

Re: [Linuxptp-devel] [Linuxptp-users] How do I implement Sync message receive timeout according to Automotive and 802.1 AS profiles?

2019-09-15 Thread Richard Cochran
On Sat, Sep 14, 2019 at 09:23:15PM +0300, Андрей Иванов wrote: > Moving on the way of realization of 802.1AS TAB I ask to describe > the modified algorithm of functioning of linuxptp taking into > account need of processing of a timeout of reception of the SYNC > message. I'm taking this

Re: [Linuxptp-devel] [PATCH] clock: prepend port number to grandmaster notice

2019-08-06 Thread Richard Cochran
On Wed, Jul 31, 2019 at 05:57:15PM +0200, Hubert Feurstein wrote: > Signed-off-by: Hubert Feurstein > --- > clock.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/clock.c b/clock.c > index 642f688..146576a 100644 > --- a/clock.c > +++ b/clock.c > @@ -1790,7 +1790,8

Re: [Linuxptp-devel] [RFC PATCH v2] ptp4l: Add configuration option for socket priority

2019-08-06 Thread Richard Cochran
On Wed, Aug 07, 2019 at 11:31:18AM +0800, Isaac Khor wrote: > From: "Khor, Isaac Shi Yan" > > Users may need to use different socket priorities for ptp4l traffic for > the purpose of traffic shaping. An example is to route ptp4l traffic > through a specific Linux egress queue using the mqprio

Re: [Linuxptp-devel] [RFC PATCH] ptp4l: Add configuration option for socket priority

2019-08-06 Thread Richard Cochran
On Tue, Aug 06, 2019 at 02:54:06PM +0800, Isaac Khor wrote: > From: "Khor, Isaac Shi Yan" > > Users may need to use different socket priorities for ptp4l traffic for > the purpose of traffic shaping. An example is to route ptp4l traffic > through a specific Linux egress qdisc. > > - Update

Re: [Linuxptp-devel] ptp4l port 1: bad message

2019-09-30 Thread Richard Cochran
On Mon, Sep 30, 2019 at 02:50:41PM +, RAVEENDRA M via Linuxptp-devel wrote: > I have downloaded latest linuxptp code from sourceforget,net and build the > ptp4l. I am running ptp master with two step mode. > But seeing following errors, > > > [root@mavdu linuxptp]# > [root@mavdu linuxptp]#

Re: [Linuxptp-devel] [PATCH] port: Deal with higher-order sync/follow-up reordering

2019-09-30 Thread Richard Cochran
On Sat, Sep 28, 2019 at 03:34:14PM +0300, Vladimir Oltean wrote: > > From an application socket's perspective, it may happen from time to > time that follow-up messages are delayed and received not 1 sync message > too late, but 2 sync messages too late (or more). Then it is "game over". The

Re: [Linuxptp-devel] [Linuxptp-users] How do I implement Sync message receive timeout according to Automotive and 802.1 AS profiles?

2019-09-30 Thread Richard Cochran
On Mon, Sep 30, 2019 at 07:16:31PM +, Rodney Cummings wrote: > In 1588-2008, 8.2.5.4.3, portDS.logSyncInterval is specified per-port. > If the Sync interval was mandated to be the same on all ports, it would > exist in defaultDS or similar. In 1588-2008, 7.7.2.3, NOTE 1 even provides > an

Re: [Linuxptp-devel] [PATCH] port: Deal with higher-order sync/follow-up reordering

2019-09-30 Thread Richard Cochran
On Tue, Oct 01, 2019 at 12:30:15AM +0300, Vladimir Oltean wrote: > On Tue, 1 Oct 2019 at 00:14, Keller, Jacob E wrote: > > So what's the argument for not increasing the default history depth a > > little to help alleviate the need to reconfigure it? As I said in my other reply, there is no

Re: [Linuxptp-devel] [Linuxptp-users] How do I implement Sync message receive timeout according to Automotive and 802.1 AS profiles?

2019-09-23 Thread Richard Cochran
On Mon, Sep 23, 2019 at 04:17:02AM +, Y.b. Lu wrote: > May I have your suggestion here? To maintain gPTP time in software, > I just copied kernel timecounter code into linuxptp for usage. Why? That sounds wrong. Thanks, Richard ___

Re: [Linuxptp-devel] [Linuxptp-users] How do I implement Sync message receive timeout according to Automotive and 802.1 AS profiles?

2019-09-23 Thread Richard Cochran
On Mon, Sep 23, 2019 at 04:17:02AM +, Y.b. Lu wrote: > BTW, I have another problem. Usually hardware has a 1588 PHC clock > which is shared by Qbv/Qci for TSN. We are facing problem that > 802.1AS requires free-running clock which TSN requires synchronized > PHC. Right. If you want to use

Re: [Linuxptp-devel] [Linuxptp-users] How do I implement Sync message receive timeout according to Automotive and 802.1 AS profiles?

2019-09-29 Thread Richard Cochran
undary Clock code, as > originally suggested by Rodney Greenstreet. > 2. Integrate time-aware bridge as a new "hybrid" clock, as suggested by > Richard Cochran (as I understand). I'd recommend "PRI" as an acronym (not > "TAB"). > That being said,

Re: [Linuxptp-devel] linuxptp filter architure

2019-09-23 Thread Richard Cochran
On Mon, Sep 23, 2019 at 08:31:30PM +, Stuart Venters wrote: > The remaining part appears to be figuring out how to turn off the all the > kernel packet timestamping help. > Also, turning off the /dev/ptp0 stuff. > > > Thoughts? Sounds like a great step backwards. Really. I didn't quite

Re: [Linuxptp-devel] [PATCH] port: Deal with higher-order sync/follow-up reordering

2019-10-01 Thread Richard Cochran
On Tue, Oct 01, 2019 at 11:04:21AM +0300, Vladimir Oltean wrote: > I have no idea what is "Eidson 5.2.2". Some psalm of sorts? https://books.google.com/books/about/Measurement_Control_and_Communication_Us.html?id=o_5sKmpyBaoC ___ Linuxptp-devel

Re: [Linuxptp-devel] [PATCH] port: Deal with higher-order sync/follow-up reordering

2019-10-01 Thread Richard Cochran
On Tue, Oct 01, 2019 at 02:33:33PM +0300, Vladimir Oltean wrote: > And well, there are hardware and architectural (DSA => stacked net > devices) reasons why it takes so long to transmit these frames. I do > need to bump up tx_timestamp_timeout to 30 for the same reasons. When you implement a TC

Re: [Linuxptp-devel] ptp4l port 1: bad message

2019-10-01 Thread Richard Cochran
On Tue, Oct 01, 2019 at 12:34:34PM +, RAVEENDRA M wrote: > Wireshark seeing correct ptp frame. > But the bad message error displayed at ptp master for delay request sent by > ptp slave. > Attached is the image of ptp delay request packet for which ptp master throws > up "bad message" error

Re: [Linuxptp-devel] [PATCH] port: Deal with higher-order sync/follow-up reordering

2019-10-01 Thread Richard Cochran
On Tue, Oct 01, 2019 at 11:04:21AM +0300, Vladimir Oltean wrote: > As far as I understand, this just introduces "dead time" from a > control theory point of view. Not sure that it is as fatal you are > suggesting it is. See the Eidson book. ___

Re: [Linuxptp-devel] [PATCH] Improve G.8275.[12] example configs.

2019-07-05 Thread Richard Cochran
On Fri, May 10, 2019 at 01:20:36PM +0200, Miroslav Lichvar wrote: > Set the announce, sync and delay request intervals in the example > configs per the G.8275.1 and G.8275.2 recommendations. Enable the L2 > transport in G.8275.1. Applied. Thanks, Richard

Re: [Linuxptp-devel] [PATCH v4] sk: Recognize HWTSTAMP_FILTER_SOME

2019-07-05 Thread Richard Cochran
On Tue, Jun 11, 2019 at 04:35:09PM +, Petr Machata wrote: > struct hwtstamp_config.rx_filter passed to SIOCSHWTSTAMP can be updated by > the kernel with the value of HWTSTAMP_FILTER_SOME. That indicates that all > requested packets will be timestamped, and some others as well. > > Update

Re: [Linuxptp-devel] [[PATCHv6]] rtnl: add team activebackup support

2019-07-05 Thread Richard Cochran
On Fri, Mar 22, 2019 at 03:02:46PM +0800, Hangbin Liu wrote: > This patch add team interface activebackup mode support. As linux team use > genl netlink message, when we get a rtnl link change notify, we have to setup > a new genl socket and request the current active port. Applied. Sorry about

Re: [Linuxptp-devel] [PATCH 1/2] nsm: Add man page.

2019-07-05 Thread Richard Cochran
On Wed, Jun 05, 2019 at 06:18:32PM +0200, Miroslav Lichvar wrote: > Add a man page for the nsm program based on the pmc man page. Applied. Thanks, Richard ___ Linuxptp-devel mailing list Linuxptp-devel@lists.sourceforge.net

Re: [Linuxptp-devel] [PATCH 2/2] pmc: Describe -f option in man page.

2019-07-05 Thread Richard Cochran
On Wed, Jun 05, 2019 at 06:18:33PM +0200, Miroslav Lichvar wrote: > Signed-off-by: Miroslav Lichvar Applied. Thanks, Richard ___ Linuxptp-devel mailing list Linuxptp-devel@lists.sourceforge.net

Re: [Linuxptp-devel] IPv4 Unicast TC

2019-12-16 Thread Richard Cochran
On Mon, Dec 16, 2019 at 03:42:52PM +0530, Prasanth KV wrote: > BC (IPv4 UC) - TC --- BC(IP4 UC) > > I'm trying this scenario and I'm not successful with TC. TC is not able to > forward the PTP packets. Do any one has a working settings for TC in this > scenario? Here is the relevant code:

Re: [Linuxptp-devel] [PATCH 3/3] unicast: Enable sharing master tables between ports.

2019-10-21 Thread Richard Cochran
On Mon, Oct 21, 2019 at 02:15:03PM +0200, Miroslav Lichvar wrote: > I think free(NULL) is required to be a no-op, so that test would be > unnecessary, but if there is another reason like coding style, I can > add it to the patch. Ah, right. I tend to check everything out of paranoid habit, but I

Re: [Linuxptp-devel] [PATCH 3/3] unicast: Enable sharing master tables between ports.

2019-10-21 Thread Richard Cochran
On Thu, Sep 26, 2019 at 03:54:32PM +0200, Miroslav Lichvar wrote: > Don't require each port to have its own master table specified in the > config. Instead of ports claming configured tables, clone the table in > each port, so different ports don't interfere with each other. I'd like to tack on

Re: [Linuxptp-devel] Timestamp value in PTP Sync & Followup packets

2019-10-16 Thread Richard Cochran
On Wed, Oct 16, 2019 at 01:57:59PM +, RAVEENDRA M via Linuxptp-devel wrote: > PTP Sync & Followup packets carrying zero timestamp value. > > Is this expected behavior or any other way we can configure it to generate > timestamps in PTP packets ? Yours is a question for the linuxptp-users

Re: [Linuxptp-devel] linuxptp filter architure

2019-09-22 Thread Richard Cochran
On Fri, Sep 20, 2019 at 04:39:06PM +, Stuart Venters wrote: > Change the argument list for filter_create to add an indication of > which filter is being created, and pointers to the clock_type and > config. > Change the argument list for filter_sample to be local time of the > experiment and

Re: [Linuxptp-devel] ptp4l port 1: bad message

2019-10-07 Thread Richard Cochran
On Mon, Oct 07, 2019 at 03:18:21PM +, Vincent Li X wrote: > This issue hits us over and over again. Are you sure we don't want to protect > us better? I am protecting you from buggy HW. Thanks, Richard ___ Linuxptp-devel mailing list

Re: [Linuxptp-devel] [Linuxptp-users] How do I implement Sync message receive timeout according to Automotive and 802.1 AS profiles?

2019-10-10 Thread Richard Cochran
On Thu, Oct 10, 2019 at 03:38:28AM +, Y.b. Lu wrote: > May I confirm that we don't have to use new clock types for PTP End Instance > and PTP Relay Instance? > PTP End Instance should be OC tyoe, The end instance is already implemented. Why change it now? > and PTP Relay Instance should be

Re: [Linuxptp-devel] timed out while polling for tx timestamp messages

2019-10-10 Thread Richard Cochran
On Thu, Oct 10, 2019 at 02:26:14PM +, RAVEENDRA M via Linuxptp-devel wrote: > > Jan 02 22:17:02 mavdu.local ptp4l[16312]: ptp4l[166601.457]: timed out while > polling for tx timestamp > Jan 02 22:17:02 mavdu.local ptp4l[16312]: [166601.457] timed out while > polling for tx timestamp > Jan

Re: [Linuxptp-devel] [Linuxptp-users] How do I implement Sync message receive timeout according to Automotive and 802.1 AS profiles?

2019-10-10 Thread Richard Cochran
On Fri, Oct 11, 2019 at 03:24:50AM +, Y.b. Lu wrote: > [Y.b. Lu] Sorry, I didn't mean to change it now. > Initially I thought that end instance was different with OC. Current end > instance of linuxptp was totally an OC without utilizing follow_up_tlv and > free running clock. > I thought

Re: [Linuxptp-devel] [Linuxptp-users] How do I implement Sync message receive timeout according to Automotive and 802.1 AS profiles?

2019-10-12 Thread Richard Cochran
On Fri, Oct 11, 2019 at 07:23:38AM +, Y.b. Lu wrote: > I'm just not familiar how applications use 802.1AS synchronized time. I don't know of any open source applications using 802.1AS either! > For physical clock adjustment, I know we have /dev/ptpx device to access for > time. > For free

Re: [Linuxptp-devel] [PATCH] port: Deal with higher-order sync/follow-up reordering

2019-10-12 Thread Richard Cochran
On Tue, Oct 01, 2019 at 10:00:42AM +0200, Miroslav Lichvar wrote: > On Mon, Sep 30, 2019 at 07:17:23PM -0700, Richard Cochran wrote: > > The delay between the Tx time stamp on the GM and the Rx time stamp > > must not exceed a small fraction of the sync. period, otherwis

Re: [Linuxptp-devel] [PATCH 0/2] pmc: Support querying TLV_PORT_PROPERTIES_NP

2019-10-12 Thread Richard Cochran
On Thu, Sep 12, 2019 at 11:06:28AM +, Petr Machata wrote: > In commit 424bbde8fcca ("Custom management TLV PORT_PROPERTIES_NP"), a new > TLV was added that allows introspection into PTP ports, and in particular > translation from PTP port identifiers to system netdevice names. The TLV > was

Re: [Linuxptp-devel] [PATCH 1/2] phc_ctl: display all capability information

2019-10-12 Thread Richard Cochran
On Thu, Sep 26, 2019 at 10:47:21AM -0700, Jacob Keller wrote: > @@ -320,12 +320,16 @@ static int do_caps(clockid_t clkid, int cmdc, char > *cmdv[]) > " %d programable alarms\n" > " %d external time stamp channels\n" > " %d programmable periodic

Re: [Linuxptp-devel] [PATCH 1/3] port: Don't leak transport when unicast initialization fails.

2019-10-12 Thread Richard Cochran
On Thu, Sep 26, 2019 at 03:54:30PM +0200, Miroslav Lichvar wrote: > Signed-off-by: Miroslav Lichvar Applied, but I also fixed two other goto labels further down. Thanks, Richard ___ Linuxptp-devel mailing list Linuxptp-devel@lists.sourceforge.net

Re: [Linuxptp-devel] [PATCH 2/3] port: Avoid calling freed servo after switching PHC.

2019-10-12 Thread Richard Cochran
On Thu, Sep 26, 2019 at 03:54:31PM +0200, Miroslav Lichvar wrote: > In port_synchronize(), when the clock returned SERVO_UNLOCKED and > port_dispatch() triggered a switch of the PHC, the variable "s" would > point to a servo which was already freed and the following call of >

Re: [Linuxptp-devel] [PATCH 3/3] unicast: Enable sharing master tables between ports.

2019-10-12 Thread Richard Cochran
On Thu, Sep 26, 2019 at 03:54:32PM +0200, Miroslav Lichvar wrote: > @@ -250,6 +252,45 @@ out: > return err; > } > > +static void free_master_table(struct unicast_master_table *table) > +{ > + struct unicast_master_address *address; > + > + while ((address = STAILQ_FIRST(>addrs)))

Re: [Linuxptp-devel] Virtual machines

2019-10-12 Thread Richard Cochran
On Tue, Oct 01, 2019 at 05:48:41AM +0200, Hans-Heinrich Hansen wrote: > are there any ideas how LinuxPTP could be used in virtual machines? > > It would be sufficient to be able to use the exact time generated by PTP, > e.g. with LinuxPTP running on the host system. On the VM host, simply run

Re: [Linuxptp-devel] Virtual machines

2019-10-12 Thread Richard Cochran
On Sat, Oct 12, 2019 at 09:06:53PM -0700, Richard Cochran wrote: > A PHC device representing the host clock will appear in the guest. > Then, for example: > > To configure Chronyd to use PHC refclock, add the > following line to its configuration file: > > r

Re: [Linuxptp-devel] [PATCH RFC 07/30] Convert call sites to the proper method for getting interface names.

2020-03-04 Thread Richard Cochran
On Tue, Feb 18, 2020 at 11:38:43AM -0800, Jacob Keller wrote: > > Is there a way to generate the network of how interconnected the various > object files are? The .d files have the includes. I once wrote a script to turn the .d files into a dotty graph. But I guess the utility is low. Thanks,

Re: [Linuxptp-devel] [PATCH RFC 24/30] interface: Introduce methods to create and destroy instances.

2020-03-04 Thread Richard Cochran
On Tue, Feb 18, 2020 at 01:25:00PM -0800, Jacob Keller wrote: > > I still think it would be good to have the functions guarantee the NULL > by manually assigning or using one of the string copy implementations > that will guarantee it. That way they don't have to rely on this assumption. In the

Re: [Linuxptp-devel] [PATCH] phc2sys: Notify kernel if clock is not in sync

2020-03-04 Thread Richard Cochran
On Fri, Feb 14, 2020 at 01:23:44PM +0200, Ville Heikkinen wrote: > In case there is no connection to the server, notify the kernel > that the clock is currently unsynchronized. > > Signed-off-by: Ville Heikkinen Applied. Thanks, Richard ___

Re: [Linuxptp-devel] [PATCH RFC 20/30] interface: Introduce a method to test the time stamping information validity.

2020-03-04 Thread Richard Cochran
On Tue, Feb 18, 2020 at 01:19:09PM -0800, Jacob Keller wrote: > > +bool interface_tsinfo_valid(struct interface *iface) > > +{ > > + return iface->ts_info.valid ? true : false; > > +} > > Do you actually need the ternary here? shouldn't ts_info.valid get > converted to true or false because we

Re: [Linuxptp-devel] [PATCH RFC 14/30] interface: Introduce a method to set the name.

2020-03-04 Thread Richard Cochran
On Tue, Feb 18, 2020 at 01:07:52PM -0800, Jacob Keller wrote: > > Good, the name is marked as constant. Side note, for those interface_* > functions that don't modify the interface, does it make sense to mark > them as taking a const interface pointer? I have heard C++ people insisting on this,

Re: [Linuxptp-devel] [PATCH] phc2sys: Notify kernel if clock is not in sync

2020-03-04 Thread Richard Cochran
On Mon, Feb 17, 2020 at 01:46:26PM +0100, Miroslav Lichvar wrote: > On Mon, Feb 17, 2020 at 02:34:14PM +0200, Heikkinen, Ville (Nokia - FI/Espoo) > wrote: > > (https://www.eecis.udel.edu/~mills/database/reports/kern/kernb.pdf). In > > there, it's specified that "STA_UNSYNC set/cleared by the

Re: [Linuxptp-devel] [PATCH RFC 06/30] interface: Introduce an access method for the name field.

2020-03-04 Thread Richard Cochran
On Tue, Feb 18, 2020 at 11:33:32AM -0800, Jacob Keller wrote: > So the interface.o isn't being added to something like $(CONFIG)? I like the idea, but I'll leave that as a follow-on task. Thanks, Richard ___ Linuxptp-devel mailing list

Re: [Linuxptp-devel] [PATCH RFC 00/30] Convert open coded interface into proper module.

2020-03-04 Thread Richard Cochran
On Tue, Feb 18, 2020 at 10:03:38AM -0800, Jacob Keller wrote: > > Nice. A lot of patches, but they sound reasonable. Will review them this > afternoon. I really appreciate your careful review. It is quite a chore. Thanks, Richard ___

Re: [Linuxptp-devel] [PATCH RFC 28/30] interface: Hide the implementation details.

2020-03-04 Thread Richard Cochran
On Tue, Feb 18, 2020 at 01:32:01PM -0800, Jacob Keller wrote: > I'd appreciate if there was some way to ensure we catch the interface > structure layout changing such that the definitions in clock.c and > config.c aren't compatible with interface.c anymore. > > Perhaps there isn't a good solution

Re: [Linuxptp-devel] [PATCH RFC 1/1] Accept external PHC devices from the command line.

2020-02-08 Thread Richard Cochran
On Mon, Jun 03, 2019 at 09:24:24AM +0200, Miroslav Lichvar wrote: > On Fri, May 31, 2019 at 07:25:45AM -0700, Richard Cochran wrote: > > A single, external PTP Hardware Clock device may be wired to one or more > > MAC devices, providing the MACs with an input clock. This patch a

Re: [Linuxptp-devel] [PATCH 2/3] clock: prevent loss of asCapable due to erroneous master rates

2020-02-09 Thread Richard Cochran
On Tue, Feb 04, 2020 at 10:34:35PM +, Erik Hons wrote: > The master rate ratio is used during peer delay measurements. For a > free running clock, several erroneous measurements of this ratio can several? In the situation you described, there will be only one bad frequency measurement

Re: [Linuxptp-devel] [PATCH 1/3] clock: reset master/local rr when best clock id changes

2020-02-09 Thread Richard Cochran
On Tue, Feb 04, 2020 at 10:34:24PM +, Erik Hons wrote: > This fixes an issue with free running clocks. When the master clock id > changes the measured master/local ratio should be reset. If it isn't, > and the local clock becomes master, then the last measured ratio to > the old master

[Linuxptp-devel] [PATCH RFC 03/30] rtnl: Constify the public interface.

2020-02-11 Thread Richard Cochran
Three of the rtnl methods never modify the strings passed in. This patch adds the const keyword to ensure these functions stay that way. Signed-off-by: Richard Cochran --- rtnl.c | 6 +++--- rtnl.h | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/rtnl.c b/rtnl.c index

[Linuxptp-devel] [PATCH RFC 06/30] interface: Introduce an access method for the name field.

2020-02-11 Thread Richard Cochran
Many of the users only require a read only reference to the interface name. This patch adds an appropriate method. Signed-off-by: Richard Cochran --- interface.c | 12 interface.h | 7 +++ makefile| 8 3 files changed, 23 insertions(+), 4 deletions(-) create

[Linuxptp-devel] [PATCH RFC 05/30] Move the network interface into its own header file.

2020-02-11 Thread Richard Cochran
Up until now, the users of the interface data structure simply access its fields without restriction. This patch takes the first step towards abstracting this data structure by giving it a file of its very own. Signed-off-by: Richard Cochran --- config.h| 15 +-- interface.h

[Linuxptp-devel] [PATCH RFC 19/30] Convert call sites to the proper method for getting the PHC index.

2020-02-11 Thread Richard Cochran
Signed-off-by: Richard Cochran --- clock.c | 2 +- port.c | 17 ++--- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/clock.c b/clock.c index 5001e66..71b3899 100644 --- a/clock.c +++ b/clock.c @@ -976,7 +976,7 @@ struct clock *clock_create(enum clock_type type

[Linuxptp-devel] [PATCH RFC 00/30] Convert open coded interface into proper module.

2020-02-11 Thread Richard Cochran
d. Thanks for your review, Richard Cochran (30): Group related objects together within the makefile. config: Constify the public interface. rtnl: Constify the public interface. utils: Constify the posix clock interface. Move the network interface into its own header file. interface: Introduce

[Linuxptp-devel] [PATCH RFC 23/30] Convert call sites to the proper method for testing time stamping modes.

2020-02-11 Thread Richard Cochran
Signed-off-by: Richard Cochran --- clock.c | 2 +- port.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/clock.c b/clock.c index 845e27a..71b5795 100644 --- a/clock.c +++ b/clock.c @@ -957,7 +957,7 @@ struct clock *clock_create(enum clock_type type, struct config

[Linuxptp-devel] [PATCH RFC 21/30] Convert call sites to the proper method for testing time stamp info validity.

2020-02-11 Thread Richard Cochran
Signed-off-by: Richard Cochran --- clock.c | 4 ++-- port.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/clock.c b/clock.c index 71b3899..845e27a 100644 --- a/clock.c +++ b/clock.c @@ -956,7 +956,7 @@ struct clock *clock_create(enum clock_type type, struct config

[Linuxptp-devel] [PATCH RFC 29/30] interface: Silence warning from gcc version 8.

2020-02-11 Thread Richard Cochran
, this patch silences the warning by using memcpy instead of strncpy. Signed-off-by: Richard Cochran --- interface.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/interface.c b/interface.c index 7cd5b41..2cf3b1e 100644 --- a/interface.c +++ b/interface.c @@ -35,7 +35,7

[Linuxptp-devel] [PATCH RFC 04/30] utils: Constify the posix clock interface.

2020-02-11 Thread Richard Cochran
The function to open a posix clock never modifies the passed in string. This patch adds the const keyword to ensure this function stays that way. Signed-off-by: Richard Cochran --- util.c | 2 +- util.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/util.c b/util.c

[Linuxptp-devel] [PATCH RFC 10/30] interface: Introduce a method to get the time stamping information.

2020-02-11 Thread Richard Cochran
In order to prevent users from open coding this logic, this patch provides a method that populates the time stamping information from the interface label. Signed-off-by: Richard Cochran --- interface.c | 5 + interface.h | 7 +++ 2 files changed, 12 insertions(+) diff --git

[Linuxptp-devel] [PATCH RFC 09/30] Convert call sites to the proper method for getting interface labels.

2020-02-11 Thread Richard Cochran
Signed-off-by: Richard Cochran --- clock.c | 2 +- port.c | 17 ++--- raw.c | 5 +++-- udp.c | 2 +- udp6.c | 2 +- 5 files changed, 16 insertions(+), 12 deletions(-) diff --git a/clock.c b/clock.c index 7d13b3b..66c6bc1 100644 --- a/clock.c +++ b/clock.c @@ -962,7 +962,7

[Linuxptp-devel] [PATCH RFC 02/30] config: Constify the public interface.

2020-02-11 Thread Richard Cochran
The two methods, config_create_interface and config_read, never modify the strings passed in. This patch adds the const keyword to ensure these functions stay that way. Signed-off-by: Richard Cochran --- config.c | 4 ++-- config.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions

[Linuxptp-devel] [PATCH RFC 08/30] interface: Introduce an access method for the time stamping label.

2020-02-11 Thread Richard Cochran
Many of the users only require a read only reference to the time stamping label of the interface. This patch adds an appropriate method. Signed-off-by: Richard Cochran --- interface.c | 5 + interface.h | 9 + 2 files changed, 14 insertions(+) diff --git a/interface.c b

[Linuxptp-devel] [PATCH RFC 17/30] Convert call sites to the proper method for setting the time stamping label.

2020-02-11 Thread Richard Cochran
Signed-off-by: Richard Cochran --- clock.c | 6 -- nsm.c | 5 - port.c | 2 +- rtnl.c | 2 +- rtnl.h | 4 +++- 5 files changed, 13 insertions(+), 6 deletions(-) diff --git a/clock.c b/clock.c index 159fcb2..5001e66 100644 --- a/clock.c +++ b/clock.c @@ -846,6 +846,7 @@ struct clock

[Linuxptp-devel] [PATCH RFC 24/30] interface: Introduce methods to create and destroy instances.

2020-02-11 Thread Richard Cochran
In order to eventually hide the implementation details of the interface, users will need to be able to create and destroy instances thereof. This patch adds the needed methods. Signed-off-by: Richard Cochran --- interface.c | 19 +++ interface.h | 13 + 2 files

[Linuxptp-devel] [PATCH RFC 25/30] clock: Use the proper create/destroy API for network interfaces.

2020-02-11 Thread Richard Cochran
Signed-off-by: Richard Cochran --- clock.c | 17 + 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/clock.c b/clock.c index 71b5795..e5f104e 100644 --- a/clock.c +++ b/clock.c @@ -122,7 +122,7 @@ struct clock { struct clock_stats stats; int

[Linuxptp-devel] [PATCH RFC 22/30] interface: Introduce a method to test supported time stamping modes.

2020-02-11 Thread Richard Cochran
Signed-off-by: Richard Cochran --- interface.c | 8 interface.h | 8 2 files changed, 16 insertions(+) diff --git a/interface.c b/interface.c index 7a3eddc..74a2512 100644 --- a/interface.c +++ b/interface.c @@ -47,3 +47,11 @@ bool interface_tsinfo_valid(struct interface

[Linuxptp-devel] [PATCH RFC 18/30] interface: Introduce a method to get the PHC index.

2020-02-11 Thread Richard Cochran
Signed-off-by: Richard Cochran --- interface.c | 5 + interface.h | 7 +++ 2 files changed, 12 insertions(+) diff --git a/interface.c b/interface.c index d7eeb41..02f63a0 100644 --- a/interface.c +++ b/interface.c @@ -28,6 +28,11 @@ const char *interface_name(struct interface *iface

[Linuxptp-devel] [PATCH RFC 12/30] interface: Introduce a method to initialize the time stamping label.

2020-02-11 Thread Richard Cochran
In many cases, the time stamping label will be the same as the name of the interface. In order to prevent users from open coding the logic that initializes the label from the interface name, this patch add an appropriate method. Signed-off-by: Richard Cochran --- interface.c | 7

[Linuxptp-devel] [PATCH RFC 15/30] Convert call sites to the proper method for setting the name.

2020-02-11 Thread Richard Cochran
Signed-off-by: Richard Cochran --- clock.c | 5 +++-- config.c | 2 +- pmc_common.c | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/clock.c b/clock.c index 3895d09..159fcb2 100644 --- a/clock.c +++ b/clock.c @@ -850,6 +850,7 @@ struct clock *clock_create(enum

[Linuxptp-devel] [PATCH RFC 27/30] pmc: Use the proper create/destroy API for network interfaces.

2020-02-11 Thread Richard Cochran
Signed-off-by: Richard Cochran --- pmc_common.c | 19 --- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/pmc_common.c b/pmc_common.c index 41181fb..3aab4b9 100644 --- a/pmc_common.c +++ b/pmc_common.c @@ -313,6 +313,7 @@ struct pmc { struct PortIdentity

[Linuxptp-devel] [PATCH RFC 20/30] interface: Introduce a method to test the time stamping information validity.

2020-02-11 Thread Richard Cochran
Signed-off-by: Richard Cochran --- interface.c | 5 + interface.h | 8 2 files changed, 13 insertions(+) diff --git a/interface.c b/interface.c index 02f63a0..7a3eddc 100644 --- a/interface.c +++ b/interface.c @@ -42,3 +42,8 @@ void interface_set_name(struct interface *iface, const

[Linuxptp-devel] [PATCH RFC 01/30] Group related objects together within the makefile.

2020-02-11 Thread Richard Cochran
making use of these interfaces. Signed-off-by: Richard Cochran --- makefile | 32 +--- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/makefile b/makefile index 3397d3e..d58d13a 100644 --- a/makefile +++ b/makefile @@ -23,12 +23,14 @@ VER = -DVER

[Linuxptp-devel] [PATCH RFC 07/30] Convert call sites to the proper method for getting interface names.

2020-02-11 Thread Richard Cochran
Signed-off-by: Richard Cochran --- clock.c| 21 +++-- config.c | 12 +++- makefile | 10 +- nsm.c | 9 + pmc_common.c | 2 +- port.c | 19 +++ port_private.h | 2 +- udp.c | 2 +- udp6.c

[Linuxptp-devel] [PATCH RFC 13/30] Convert call sites to the proper method for initializing the time stamping label.

2020-02-11 Thread Richard Cochran
Signed-off-by: Richard Cochran --- clock.c | 12 +--- nsm.c| 4 +--- pmc_common.c | 4 +--- 3 files changed, 3 insertions(+), 17 deletions(-) diff --git a/clock.c b/clock.c index f987965..3895d09 100644 --- a/clock.c +++ b/clock.c @@ -842,16 +842,6 @@ int

[Linuxptp-devel] [PATCH RFC 30/30] interface: Remove obsolete method.

2020-02-11 Thread Richard Cochran
Now that all call sites have been converted to interface_create(), there is no longer any needed for a way to set the interface's name. This patch removes the useless method. Signed-off-by: Richard Cochran --- interface.c | 7 +-- interface.h | 7 --- 2 files changed, 1 insertion

[Linuxptp-devel] [PATCH RFC 28/30] interface: Hide the implementation details.

2020-02-11 Thread Richard Cochran
Now that a complete functional API is in place, there is no need to expose the inner workings of the network interface data type. This patch converts it into an opaque type while leaving the list marker visible to users through a simple form of "friendly exposition". Signed-off-b

[Linuxptp-devel] [PATCH RFC 26/30] config: Use the proper create/destroy API for network interfaces.

2020-02-11 Thread Richard Cochran
Signed-off-by: Richard Cochran --- config.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/config.c b/config.c index 717ee65..e033842 100644 --- a/config.c +++ b/config.c @@ -829,13 +829,11 @@ struct interface *config_create_interface(const char *name, struct config

[Linuxptp-devel] [PATCH RFC 14/30] interface: Introduce a method to set the name.

2020-02-11 Thread Richard Cochran
The name field of the interface is set in different ways by different callers. In order to prevent users from open coding the logic that sets the name, this patch adds an appropriate method. Signed-off-by: Richard Cochran --- interface.c | 5 + interface.h | 8 +++- 2 files changed, 12

[Linuxptp-devel] [PATCH RFC 16/30] interface: Introduce a method to set the time stamping label.

2020-02-11 Thread Richard Cochran
The ts_label field of the interface is set in different ways by different callers. In order to prevent users from open coding the logic that sets the label, this patch adds an appropriate method. Signed-off-by: Richard Cochran --- interface.c | 5 + interface.h | 7 +++ 2 files changed

[Linuxptp-devel] [PATCH RFC 11/30] Convert call sites to the proper method for getting time stamp information.

2020-02-11 Thread Richard Cochran
Signed-off-by: Richard Cochran --- clock.c | 2 +- port.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/clock.c b/clock.c index 66c6bc1..f987965 100644 --- a/clock.c +++ b/clock.c @@ -962,7 +962,7 @@ struct clock *clock_create(enum clock_type type, struct config

Re: [Linuxptp-devel] [PATCH 5/6] phc2sys: Use reversed sysoff when synchronizing to system clock.

2020-01-02 Thread Richard Cochran
On Thu, Jan 02, 2020 at 04:00:48PM +0100, Miroslav Lichvar wrote: > My logic is often faulty when dealing with offset signs, so I've Mine too, it is easy to get confused. > learned to not trust it and test the code both ways to make sure it's > correct, which I remember quite clearly doing with

Re: [Linuxptp-devel] ptp4FreeRTOS port

2020-01-03 Thread Richard Cochran
On Sat, Jan 04, 2020 at 12:00:47AM +0530, sk.syed2 wrote: > I would like to announce availability of freeRTOS port of ptp4l. > We have been able to use this on Xilinx zcu102 board with TSN soft > IP(https://www.xilinx.com/products/intellectual-property/1gtsn.html), > where ptp4l runs on R5

Re: [Linuxptp-devel] Forwarding foreign mgmt responses to uds

2019-12-23 Thread Richard Cochran
On Thu, Nov 14, 2019 at 06:12:22PM +1100, David Mirabito via Linuxptp-devel wrote: > I'm assuming that Responses (and Acknowledge) messages are whitelisted since > it > could be user of the UDS which made the original request, an example being > using > pmc to poll every clock reachable within

Re: [Linuxptp-devel] [PATCH 5/6] phc2sys: Use reversed sysoff when synchronizing to system clock.

2019-12-23 Thread Richard Cochran
On Mon, Dec 16, 2019 at 04:04:21PM -0800, Cliff Spradlin via Linuxptp-devel wrote: > Could you please check my work? Hm, I think you are right. We define the offset in terms of the slave and master time values taken at the same instant: offset = slave - master The sysoff_measure()

Re: [Linuxptp-devel] [PATCH] phc2sys: Fix frequency estimation when synchronizing a PHC to the system clock.

2019-12-25 Thread Richard Cochran
On Wed, Dec 25, 2019 at 08:18:26PM +0200, Vladimir Oltean wrote: > I'm not sure if it's a widespread convention in linuxptp or not, but > it doesn't hurt: > > Fixes: 8142da41b61f ("phc2sys: Use reversed sysoff when synchronizing > to system clock.") Yes, we do that. I just pushed this patch out

Re: [Linuxptp-devel] [PATCH 5/6] phc2sys: Use reversed sysoff when synchronizing to system clock.

2019-12-25 Thread Richard Cochran
On Wed, Dec 25, 2019 at 07:40:28PM +0200, Vladimir Oltean wrote: > Good job spotting it! agreed! > If you send a patch, you can feel free to add: > > Tested-by: Vladimir Oltean I've got one in the works. I'll go ahead an add this tag. Thanks, Richard

[Linuxptp-devel] [PATCH] phc2sys: Fix frequency estimation when synchronizing a PHC to the system clock.

2019-12-25 Thread Richard Cochran
-off-by: Richard Cochran Reported-by: Cliff Spradlin Tested-by: Vladimir Oltean --- phc2sys.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phc2sys.c b/phc2sys.c index 523ce25..64bdf26 100644 --- a/phc2sys.c +++ b/phc2sys.c @@ -770,8 +770,8 @@ static int do_loop(struct node

Re: [Linuxptp-devel] PPS generation on BeagleBoneBlack

2020-03-11 Thread Richard Cochran
On Wed, Mar 11, 2020 at 02:31:29PM +0530, Lokesh Vutla wrote: > > This is the userspace program I have worked on to get the synchronization > working. Currently the servo part of the tool is in very hacky shape. Before > cleanup I wanted to get more inputs on where it can be integrated. But

Re: [Linuxptp-devel] [PATCH] phc2sys: Notify kernel if clock is not in sync

2020-03-06 Thread Richard Cochran
On Thu, Mar 05, 2020 at 08:29:03AM +0100, Miroslav Lichvar wrote: > > I'd stick with the meaning "the clock has is believed to have an error > larger than 16 seconds". With ptp4l/phc2sys, if someone needs to check > if the clock was updated in the last X seconds, they can check the > maxerror

[Linuxptp-devel] [PATCH 2/6] Remove the unfinished SNMP code.

2020-03-06 Thread Richard Cochran
of the features. Signed-off-by: Richard Cochran --- makefile| 14 snmp4lptp.8 | 119 -- snmp4lptp.c | 192 snmp4lptp_mib.h | 30 snmpflg.sh | 42 --- 5 files changed, 397

[Linuxptp-devel] [PATCH 6/6] Provide a method to convert a tmv_t into a timespec.

2020-03-06 Thread Richard Cochran
Currently there is a method to convert a timespec into a tmv_t, but not the other way round. This patch adds the missing function in anticipation of a new feature that will need this conversion. Signed-off-by: Richard Cochran --- tmv.h | 10 ++ 1 file changed, 10 insertions(+) diff

[Linuxptp-devel] [PATCH 1/6] clock: Safely remove event subscribers from list.

2020-03-06 Thread Richard Cochran
Signed-off-by: Richard Cochran Reported-by: Michael Walle --- clock.c | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/clock.c b/clock.c index 1668383..6f9cc21 100644 --- a/clock.c +++ b/clock.c @@ -145,9 +145,9 @@ static void remove_subscriber(struct clock_subscriber *

[Linuxptp-devel] [PATCH 5/6] Add PHC methods for querying and configuring the pin functionality.

2020-03-06 Thread Richard Cochran
In anticipation of support for external time stamping in PHC devices, this patch adds wrapper functions around the pin functionality. Signed-off-by: Richard Cochran --- phc.c | 30 -- phc.h | 21 + 2 files changed, 49 insertions(+), 2 deletions

[Linuxptp-devel] [PATCH 0/6] Clean up in preparation for GrandMaster support.

2020-03-06 Thread Richard Cochran
. Richard Cochran (6): clock: Safely remove event subscribers from list. Remove the unfinished SNMP code. Balance the posix clock open function with a close method. Add definitions for PTP pin ioctls for backwards kernel compatibility. Add PHC methods for querying and configuring the pin

[Linuxptp-devel] [PATCH 3/6] Balance the posix clock open function with a close method.

2020-03-06 Thread Richard Cochran
. Signed-off-by: Richard Cochran --- phc2sys.c | 2 +- phc_ctl.c | 1 + util.c| 8 util.h| 6 ++ 4 files changed, 16 insertions(+), 1 deletion(-) diff --git a/phc2sys.c b/phc2sys.c index c0b7b3d..64bdf26 100644 --- a/phc2sys.c +++ b/phc2sys.c @@ -341,7 +341,7 @@ static void

<    7   8   9   10   11   12   13   14   15   16   >