Re: [Linuxptp-users] Multi-profile grandmaster

2023-12-06 Thread Miroslav Lichvar
On Wed, Dec 06, 2023 at 08:19:49AM +, Erling Rennemo Jellum wrote:
> We are in the situation where we want to synchronize multiple devices where 
> some only support the E2E delay mechanism and others only support the P2P 
> delay mechanism (the gPTP profile specifically). Ideally, we would just use a 
> single network interface on the grandmaster. See below for a Figure 
> illustrating a possible topology. It would mean that the GM should exchange 
> Peer Delay messages with the switch (which is a Transparent Clock), while 
> also replying to Delay Request messages from the E2E slave, and sending out 
> Sync+Follow Up to both the E2E and the P2P slave.
> 
> Has anyone looked into this before? I guess it would be possible with two 
> isolated networks and two instances of linuxPTP operating on two different 
> network interfaces, but can it work on a single network?

>From the PTP point of view it could work with two different PTP domain
numbers. The GM can run multiple ptp4l instances. They can even share
the same PHC, no need for vclocks.

But practically I think it will depend on the switch whether it can be
configured for such operation.

-- 
Miroslav Lichvar



___
Linuxptp-users mailing list
Linuxptp-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-users


Re: [Linuxptp-users] Configuration for boundary clock with on two-port NIC

2023-11-20 Thread Miroslav Lichvar
On Sun, Nov 19, 2023 at 10:07:50PM +0100, Andre Puschmann wrote:
> Hey,
> 
> I've been able to get my hands on a ConnectX-3 Pro card and have done some
> initial testing. The card indeed has a shared PHC for both ports so running
> ptp4l as BC or TC does indeed work without the jbod option.
> 
> However, sync performance (i.e. rms values) for the downstream OCs isn't
> great. And in fact, even the Mellanox as a OC isn't giving great results -
> rms values jump a lot (and I've tried various PI value combinations).
> 
> Is anyone else seeing this with Mlx cards as well? Could it be my model or
> the firmware?

Try the L2 transport. IIRC at least some Mellanox NICs performed
worse with UDP transport for some reason.

-- 
Miroslav Lichvar



___
Linuxptp-users mailing list
Linuxptp-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-users


Re: [Linuxptp-users] Configuration for boundary clock with on two-port NIC

2023-11-01 Thread Miroslav Lichvar
On Wed, Nov 01, 2023 at 09:04:12AM +0100, Andre Puschmann wrote:
>  /opt/linuxptp/ptp4l -2 -i enp1s0f1 -i enp1s0f0 -f /opt/ptp4l_cfg/bc.cfg -m
> -l 6
> ptp4l[851.735]: selected /dev/ptp1 as PTP clock
> ptp4l[851.735]: port 1 (enp1s0f1): PHC device mismatch
> ptp4l[851.735]: port 1 (enp1s0f1): /dev/ptp1 requested, ptp0 attached
> ptp4l[851.735]: failed to open port enp1s0f1
> failed to create a clock
> 
> I am not sure where this is coming from but indeed the first interface seems
> PHC 1 assigned and the second PHC 0. Not sure if this is an issue.

It is an issue. The two ports of the NIC don't share the same PHC, so
there needs to be something keeping them in sync (phc2sys -a) and
ptp4l needs to be told to not verify the PHC index numbers. That's the
boundary_clock_jbod option. Don't expect best accuracy in this setup.

-- 
Miroslav Lichvar



___
Linuxptp-users mailing list
Linuxptp-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-users


Re: [Linuxptp-users] Hardware timestamping multiple domains.

2023-10-31 Thread Miroslav Lichvar
On Mon, Oct 30, 2023 at 10:26:35PM +, Eric Decker wrote:
> My understanding is each domain has a set of PTP messages associated with it. 
>  If we have two domains there would two sets of Sync, Follow Up and path 
> delay messages on the network simultaneously.  Would the hardware stamping in 
> the MAC timestamp frames/messages from both domains?  If the MAC does capture 
> timestamps for the PTP frames in both domains, then does the PHC and vclocks 
> process those timestamps?

Hardware doesn't care about domains. It timestamps all event
messages. With vclocks the hardware timestamp is interpreted as a
simple counter and the hardware timestamps are converted by vclocks to
timestamp that will be receive by applications. The application
selects the vclock by binding its socket. A single ptp4l instance
works in a single domain, so it needs just one vclock. It will receive
messages from other domains with timestamps converted by its vclock,
but it will ignore them. With multiple ptp4l instances you have
hardware timestamping enabled in multiple domains, each instance using
only timestamps of messages in its domain.

-- 
Miroslav Lichvar



___
Linuxptp-users mailing list
Linuxptp-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-users


Re: [Linuxptp-users] Use NIC as PTP GM without external sync

2023-10-19 Thread Miroslav Lichvar
On Thu, Oct 19, 2023 at 02:40:30PM +0200, Nils Fuerste wrote:
> Hello everyone!
> 
> I am trying to use a NIC as a PTP GM with any external sync sorce. I have a
> PC with a dual port NIC (82599ES 10-Gigabit SFI/SFP+) connected to an
> embedded device over Ethernet. I use a SFP-to-Ethernet adapter to translate
> from SFP+ to Ethernet. Both devices need to be synced but I cannot use GPS
> or other external clock sources. My idea is to use the NIC as a PTP GM and
> serve the embedded device with PTP. What I am not sure about is if I need to
> use phc2sys to sync NIC and the physical clock of the machine hosting the
> NIC? What quality of sync can I expect?

You can leave the clock of the NIC running free if you don't need the
client's clock to be accurate, only synchronized to the server.

> ptp4l[2023/10/19/12:28:10]: state=2 rms  222 max  518 freq  +1020 +/-   0
> delay 20436 +/-  13
> ptp4l[2023/10/19/12:28:11]: state=2 rms 968245340 max 99669 freq   +992
> +/-   0 delay 20507 +/-  36
> ptp4l[2023/10/19/12:28:13]: state=2 rms 433012546 max 99740 freq   +921
> +/-  28 delay 20559 +/-  31

Those errors are almost exactly 1 second, which is very suspicious. It
could be a driver bug. What kernel version do you use? It would help
if you could get a third device and see if it works better as a server
or client to determine on which side is the problem.

-- 
Miroslav Lichvar



___
Linuxptp-users mailing list
Linuxptp-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-users


Re: [Linuxptp-users] Configuration for boundary clock with on two-port NIC

2023-10-03 Thread Miroslav Lichvar
On Tue, Oct 03, 2023 at 02:33:32PM +0200, Nils Fuerste wrote:
> Thanks for your help! Unfortunately, setting those values doesn't work for
> me. I get the following errors:
> 
> sudo ptp4l -2 -i enp1s0f1 -f ./default-new-master.cfg -m
> -1.0 is an out of range value for option pi_proportional_const at line 73
> failed to parse configuration file ./default-new-master.cfg

It should be pi_proportional_exponent, not pi_proportional_const.

> $ sudo ptp4l -2 -i enp1s0f1 -f ./default-new-master.cfg -m
> P is a malformed value for option pi_proportional_scale at line 75
> failed to parse configuration file ./default-new-master.cfg

P and I should be replaced with the values from the table.

-- 
Miroslav Lichvar



___
Linuxptp-users mailing list
Linuxptp-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-users


Re: [Linuxptp-users] Configuration for boundary clock with on two-port NIC

2023-10-03 Thread Miroslav Lichvar
On Tue, Oct 03, 2023 at 11:45:49AM +0200, Nils Fuerste wrote:
> I have a 82599ES from Intel [1]. I found the paramters you were referring to
> but I am not sure how to adjust them. Can you give me some guidance for this
> if you get a chance?

Try this:
pi_proportional_exponent -1 
   
pi_integral_exponent -1
pi_proportional_scale P
pi_integral_scale I

where P and I are from one line of this table:

0.316 0.01562
0.158 0.00391
0.079 0.00098
0.040 0.00024
0.020 0.6

This is the NTPv4 (RFC 5905) PLL at five different gains. If the sync
interval is -4 (16 sync messages per second), try the middle pair
first.

-- 
Miroslav Lichvar



___
Linuxptp-users mailing list
Linuxptp-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-users


Re: [Linuxptp-users] Configuration for boundary clock with on two-port NIC

2023-10-02 Thread Miroslav Lichvar
On Mon, Oct 02, 2023 at 09:44:19AM +0200, Nils Fuerste wrote:
> Unfortunately, the sync on the server receiving the sync from the BC looks
> like this:
> 
> ptp4l[3297.441]: master offset 42 s2 freq   +9338 path delay  
> 319
> ptp4l[3298.441]: master offset    -10 s2 freq   +9298 path delay  
> 319
> ptp4l[3299.441]: master offset 19 s2 freq   +9324 path delay  
> 319

That doesn't look too bad.

> Is there a way to improve the configuration? I found the boundary_clock_jbod
> parameter but setting it to 1 didn't improve the sync.

jbod is only needed when the ports don't share the same clock. It
degrades the sync quality.

> Can someone provide a
> configuration for a simple BC setup with one two-port NIC? What is the sync
> quality I can expect? Any help is appreciated! Thanks in advance!

It depends on the hardware. What NIC do you have?

One thing you can try is to shorten the sync interval and decrease the
PI constants, also on the client's port of the server to minimize the
frequency noise transferred to the client.

-- 
Miroslav Lichvar



___
Linuxptp-users mailing list
Linuxptp-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-users


Re: [Linuxptp-users] PTP client selecting source IP address when NIC configured for multiple IPs

2023-10-02 Thread Miroslav Lichvar
On Tue, Sep 26, 2023 at 05:09:52PM +, David Turrie via Linuxptp-users wrote:
> Requests: I am seeking confirmation that linuxPTP does not allow the user to 
> specify the slave's source IP for unicast communications.  And second, if 
> this is something the PTP development community would consider adding to PTP 
> configuration.

There is currently no option to bind the client to a specific address.
It shouldn't be too difficult to add.

-- 
Miroslav Lichvar



___
Linuxptp-users mailing list
Linuxptp-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-users


Re: [Linuxptp-users] Linuxptp - Supported Hardware

2023-10-02 Thread Miroslav Lichvar
On Wed, Sep 27, 2023 at 04:10:53PM +0100, Fernando Gomes wrote:
> Hi Wolfgang, thanks! 10ns is excellent! I saw many references to DP83640
> for PTP but we need to support Gb ethernet, I've found some Vitesse PHYs
> (VSC8572, VSC8574,  VSC8582, VSC8584) that should also work for 1Gb
> ethernet, but I'm trying to find other alternatives, mainly because these
> PHYs have a limited temperature range (but similar to DP83640, 0 to 100C or
> -40 to 85C) and are a bit expensive. If you know any similar solutions for
> Gb ethernet please let me know.

If MAC timestamping is sufficient, I think the Intel I210/211 would be
a good choice. It's well supported, timestamping is stable to few tens
of nanoseconds and asymmetries are already compensated in the driver.
It has PPS input/output, so you can verify the accuracy.

-- 
Miroslav Lichvar



___
Linuxptp-users mailing list
Linuxptp-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-users


Re: [Linuxptp-users] How to disable "Delay Mechanim" of ptp4l Time follower / slave

2023-09-25 Thread Miroslav Lichvar
On Mon, Sep 25, 2023 at 03:15:23PM +, Nemo Crypto wrote:
> Hi Linuxptp-users,
> 
> Is there a way to disable the delay mechanism? I see only 3 options in man 
> page (E2E (default), P2P & Auto). 

There is the inhibit_delay_req option. It can be combined with the
initial_delay option to set the expected delay of the sync message.

-- 
Miroslav Lichvar



___
Linuxptp-users mailing list
Linuxptp-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-users


Re: [Linuxptp-users] sawtooth from linux timestamp?

2023-07-24 Thread Miroslav Lichvar
On Sat, Jul 22, 2023 at 04:12:32PM +0200, jmfriedt wrote:
> To do this I am connecting an Ettus Research X310 software defined
> radio to the CM4 and configuring to start collecting data upon
> detection of the WR 1PPS rising edge. The SDR input is connected to the
> 1PPS to assess that the record always stays at the same time with
> respect to the 1PPS and it does. I record a known number of samples in
> file.bin at a known datarate (5 MS/s) and look at the timestamp of the
> last file access as the last field of stat -c %y file.bin, and I try
> and analyze the factional part of this timestamp.

How exactly you are writing to that file? Any buffering or fsync()?

I think the modified timestamp of a file is captured by the kernel
when it's updating the inode. The system clock might be precise to few
tens of nanoseconds, but that update of the inode certainly cannot be
timed to such precision.

-- 
Miroslav Lichvar



___
Linuxptp-users mailing list
Linuxptp-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-users


Re: [Linuxptp-users] 3.1.1 -> 4.0 evolution?

2023-07-10 Thread Miroslav Lichvar
On Mon, Jul 10, 2023 at 03:49:52PM +0200, jmfriedt wrote:
> I git bisected and the faulty commit is

> Bump to IEEE 1588-2019 version

I think that means the hardware cannot timestamp PTPv2.1 packets, only
PTPv2.0 packets.

You can change PTP_MINOR_VERSION in msg.h to 0 and see if that helps.

-- 
Miroslav Lichvar



___
Linuxptp-users mailing list
Linuxptp-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-users


Re: [Linuxptp-users] 3.1.1 -> 4.0 evolution?

2023-07-10 Thread Miroslav Lichvar
On Mon, Jul 10, 2023 at 11:47:00AM +0200, jmfri...@femto-st.fr wrote:
> I have a Compute Module4 single board computer controlled using
> linuxptp to a White Rabbit switch as grand master. The client is
> controlled by the server with linuxptp 3.1.1

> and all goes well. I upgraded to linuxptp 4.0 in order to activate some
> of the newer options and now in the exact same context I am unable to
> lock with the messages

Is linuxptp the only thing you have upgraded? This is most likely a
driver issue as the log message suggests. The CM4 HW timestamping
support is quite problematic from what I read.

If you are sure it's linuxptp, you can try

git bisect start v4.0 v3.1

and follow with git bisect good or git bisect bad after testing each
step. In about 7 steps you should have the offending commit.

-- 
Miroslav Lichvar



___
Linuxptp-users mailing list
Linuxptp-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-users


Re: [Linuxptp-users] get notification when some faults occur

2023-06-27 Thread Miroslav Lichvar
On Tue, Jun 27, 2023 at 09:54:20AM +0800, 这个 不太冷 via Linuxptp-users wrote:
> Hi,  I am running linuxptp on embedded board as slave. I need get 
> notification when some faults occur.
> such as:
> 1. network with master down;
> 2. sync/follow_up message reception timeout;3. the clock enters the 
> SERVO_LOCKED_STABLE state;
> 
> 4. clock offset exceeds threshold;
> 
> what should I do, if I want to receive real-time notifications instead of 
> analyzing logs.

There is a mechanism for receiving notifications from ptp4l, which can
be used in shell like this:

(
echo 'SET SUBSCRIBE_EVENTS_NP duration 100 NOTIFY_PORT_STATE on 
NOTIFY_TIME_SYNC on'
sleep 50
) | pmc -u -b 0

It is also supported by the libptpmgmt library, if you don't want to
be running this in popen() or similar.

There are currently only two notifications implemented, one for
changes of the port state and another for clock updates providing the
TIME_STATUS_NP message. I think that would work for your 1 and 4. For
the others some new notifications would need to be implemented.

-- 
Miroslav Lichvar



___
Linuxptp-users mailing list
Linuxptp-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-users


Re: [Linuxptp-users] [issue] phc2sys results large jitter with multiple '-c'

2023-06-21 Thread Miroslav Lichvar
On Tue, Jun 20, 2023 at 10:07:14PM -0700, Jacob Keller wrote:
> On 6/11/2023 11:53 PM, Miroslav Lichvar wrote:
> > If you need to synchronize multiple PHCs to each other, it's better to
> > use one phc2sys instance to synchronize the system clock to the source
> > PHC and then another phc2sys instance to synchronize the rest of PHCs
> > to the system clock.
> > 
> 
> In theory the kernel could be extended with an interface to perform the
> comparison between two clocks in-kernel without a switch. That would be
> a bit better than doing it in user space.

The drivers could provide a callback for other drivers to read the
lowest part of the timestamp and another callback to complete the
timestamp. One issue with this approach would be increased delay due
to the measurement doing 3 PCIe reads instead of 1 PCIe read and
2 system clock reads. Another issue might with hardware which cannot
read the lowest part of the timestamp (latching) twice without reading
the rest, if such a thing exists.

A better approach would be to use the system clock as a reference,
similarly to what you described for PTM, except doing it multiple
times in the style of PTP_SYS_OFFSET_EXTENDED with interleaved
readings SYS, PHC1, SYS, PHC2, SYS, PHC1, SYS ... and combining the
measurements in the kernel or user space.

-- 
Miroslav Lichvar



___
Linuxptp-users mailing list
Linuxptp-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-users


Re: [Linuxptp-users] RMS Errors Growing

2023-06-20 Thread Miroslav Lichvar
On Tue, Jun 20, 2023 at 09:05:10AM -0600, ja...@astroj.com wrote:
> ptp4l[1068.939]: clockcheck: clock jumped forward or running faster than
> expected!
> ptp4l[1068.939]: rms 630332770 max 822762571 freq +2399 +/-   0 delay
> -27609959 +/- 3559790

This shows the frequency being stuck at the maximum. The server, HW or driver
is broken, or something else is adjusting the clock.

-- 
Miroslav Lichvar



___
Linuxptp-users mailing list
Linuxptp-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-users


Re: [Linuxptp-users] [issue] phc2sys results large jitter with multiple '-c'

2023-06-12 Thread Miroslav Lichvar
On Mon, Jun 12, 2023 at 12:24:19PM +0800, egg car wrote:
> 5) not only the 4 ports on the same nic, any combination of ptp0~ptp9 results
> the same.
> 
> 
> Have gone through the phc2sys codes, find nothing reasonable that explains
> this issue so far.
> 
> I can see when the large jitter happens, the measured delay also varies a lot,
> perhapse it's related to the pcie tranfication process?

Yes, it's related to PCIe delays. The problem is that the kernel
doesn't provide an ioctl to measure offset between two PHCs, so
phc2sys has to do it in user space using clock_gettime(), which
doesn't work very well (large delay, jitter and asymmetry).

For PHC vs system clock measurements there is an optimized path in the
kernel which for most drivers limits the delay to a single PCIe read.

If you need to synchronize multiple PHCs to each other, it's better to
use one phc2sys instance to synchronize the system clock to the source
PHC and then another phc2sys instance to synchronize the rest of PHCs
to the system clock.

-- 
Miroslav Lichvar



___
Linuxptp-users mailing list
Linuxptp-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-users


Re: [Linuxptp-users] Offset between TAI and PHC

2023-05-24 Thread Miroslav Lichvar
On Wed, May 24, 2023 at 08:19:37AM -0300, Elder Costa wrote:
> phc latency: 7472
> phc-rt delta: 3739320
> phc-tai delta: 3739035
> 
> phc-tai delta is greater than 50 usec !
> TAI offset set in kernel is not correct !

I think you need to set currentUtcOffsetValid and timeTraceable on the
GM with a pmc SET GRANDMASTER_SETTINGS_NP command for the client's
phc2sys to actually set the TAI-UTC offset of the system clock.

-- 
Miroslav Lichvar



___
Linuxptp-users mailing list
Linuxptp-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-users


Re: [Linuxptp-users] phc2sys exists with a Connection Timed Out error

2023-05-17 Thread Miroslav Lichvar
On Fri, May 12, 2023 at 04:28:40PM -0700, Bernie Elayda wrote:
> phc2sys will stop but ptp4l will continue to run.  This error appears to
> originate from the sysoff_precise function;Doesn't this error just mean
> when attempting to read PTP_SYS_OFFSET_PRECISE the kernel was just busy?
> Wouldn't it be better to just 'log' the error and continue, or does even
> one occurrence of this error mean something is misconfigured in my setup?

I think this phc2sys issue was fixed after 3.1.1 in git. Please try
that and see if it still exits.

-- 
Miroslav Lichvar



___
Linuxptp-users mailing list
Linuxptp-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-users


Re: [Linuxptp-users] Software timestamping delay - master offset drift

2023-05-16 Thread Miroslav Lichvar
On Tue, May 16, 2023 at 11:04:36AM -0300, Elder Costa wrote:
> > > ptp4l[484.261]: port 1 (enp3s0): new foreign master 0001c0.fffe.1a3cda-1
> > > ptp4l[488.262]: selected best master clock 0001c0.fffe.1a3cda
> > > ptp4l[488.262]: foreign master not using PTP timescale
> > > ptp4l[488.262]: port 1 (enp3s0): LISTENING to UNCALIBRATED on RS_SLAVE
> > > ptp4l[490.263]: master offset -37039670930503 s0 freq  -0 path delay
> > 229600
> > >
> > > ptp4l[17805.578]: port 1 (enp3s0): new foreign master 0001c0.fffe.1a3e8e-1
> > > ptp4l[17809.579]: selected best master clock 0001c0.fffe.1a3e8e
> > > ptp4l[17809.579]: foreign master not using PTP timescale
> > > ptp4l[17809.579]: port 1 (enp3s0): LISTENING to UNCALIBRATED on RS_SLAVE
> > > ptp4l[17810.584]: master offset 159453 s0 freq +1 path delay
> >216530
> > >
> >
> > Where does that initial freq value come from?

It's the current frequency of the clock.

> > Is it possible to force it to +0 like in the log of the
> > first run above, the one that synchronizes?

phc_ctl CLOCK_REALTIME freq 0

-- 
Miroslav Lichvar



___
Linuxptp-users mailing list
Linuxptp-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-users


Re: [Linuxptp-users] Trying to understand different behaviors of ptp4l

2023-05-11 Thread Miroslav Lichvar
On Thu, May 11, 2023 at 08:45:02AM -0300, Elder Costa wrote:
> Hello, Richard, thank you for the explanation. It confirms my initial
> understanding of the
> parameter. But I must be doing something wrong as I am not getting
> this clock step.

> cve@cve-sbc-flt2:~$ sudo ptp4l -4 -S -s -m -q step_threshold=0.001 -i enp3s0

step_threshold is an option. If specified on command line, it needs to
have the "--" prefix: --step_threshold=0.001

-- 
Miroslav Lichvar



___
Linuxptp-users mailing list
Linuxptp-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-users


Re: [Linuxptp-users] ptp4l passive phc synchronization with active phc in linux bonding

2023-04-11 Thread Miroslav Lichvar
On Mon, Apr 10, 2023 at 10:49:45PM +0530, shashank varshney wrote:
> I have following queries related to functioning of PTP with active-passive
> bonding:
> 
>- Will passive/standby slave PHC synchronize itself with active slave
>PHC when active-passive NIC ports are on different PHCs?

No, phc2sys doesn't know about the other interfaces in the bond.

>- Does the passive NIC port's PHC is ready to take-over when the current
>active slave NIC goes down or does this require the passive NIC's PHC to
>synchronize first?

The latter. It's not a seamless switch.

-- 
Miroslav Lichvar



___
Linuxptp-users mailing list
Linuxptp-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-users


Re: [Linuxptp-users] ptp4l support for multiple time domains

2023-04-06 Thread Miroslav Lichvar
On Wed, Apr 05, 2023 at 07:04:12PM +, Nemo Crypto wrote:
> Hi All,
> 
> I have a use case where my SoC needs to be configured as two Time Follower or 
> Slave to 2 different PTP Domains (Domain 0 & Domain 1) through a single 
> interface.
> 
> SoC supports HW timestamping on this interface.
> 
> How to configure the ptp4l to achieve this? Is this supported by linuxptp?

It's supported in the latest development code. It's using virtual
clocks provided by the kernel, each having its own ptp4l instance. You
can create the vclocks and start ptp4l+phc2sys instances manually or
let timemaster handle it. See the man page.

-- 
Miroslav Lichvar



___
Linuxptp-users mailing list
Linuxptp-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-users


Re: [Linuxptp-users] negative delay issue

2023-03-29 Thread Miroslav Lichvar
On Tue, Mar 28, 2023 at 10:24:47PM +0800, Merlin He wrote:
> hello team,
> 
> I found that port_nrate_calculate() save the first ingress1 before slave
> clock jumping, if the offset of master and slave is too large, this may
> results in an extremly small nrate_ratio value, and cause the nagative
> delay issue.
> so, is this a problem please?

There might be an assumption that the clock if running free. I'm not
very familiar with this feature.

> what about port_nrate_calculate() sampling the first ingress1 until servo
> entering lock state?
> like this:
> 1028   if (tmv_is_zero(n->ingress1) && *clock_servo_state(p->clock) ==
> SERVO_LOCKED*) {
> 1029 n->ingress1 = ingress;
> 1030 n->origin1 = origin;
> 1031 return;
> 1032   }

Another option might be calling port_nrate_initialize() on clock jump.

-- 
Miroslav Lichvar



___
Linuxptp-users mailing list
Linuxptp-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-users


Re: [Linuxptp-users] rogue peer delay response caused by port_synchronize()

2023-03-27 Thread Miroslav Lichvar
On Fri, Mar 24, 2023 at 03:46:49PM +0800, merlinhe wrote:
>  
> port.port_initialize()->transport_open()->raw_open()->sk_timestamping_init()->hwts_init()->*ioctl(fd,
> SIOCSHWTSTAMP)(eth driver set PHC to SYS(year 2000) in this ioctl)*

That ioctl definitely shouldn't cause the PHC to be stepped. What
HW/driver is it?

-- 
Miroslav Lichvar



___
Linuxptp-users mailing list
Linuxptp-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-users


Re: [Linuxptp-users] rogue peer delay response caused by port_synchronize()

2023-03-21 Thread Miroslav Lichvar
On Tue, Mar 21, 2023 at 10:17:56AM +0800, merlinhe wrote:
> 1. after the first clock jumpping, PHC jumpped to master, SYS keep the
> original value
> 2. peer_delay_req set to NUL
> 3. when the next peer_delay_resp arrives, the port enters the faulty state,
> which cause the port reinited(PHC reset to SYS)

By phc2sys? System clock shouldn't be used at all with HW
timestamping.

> 4. then the next SYNC, FUP arrives, the clock.servo enter LOCK state,
> 
> Do you have any suggestions to fix this problem? Or do I need to change my
> ptp4l configuration?

It's not very clear to me what is the issue that you are trying to
avoid.

-- 
Miroslav Lichvar



___
Linuxptp-users mailing list
Linuxptp-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-users


Re: [Linuxptp-users] rogue peer delay response caused by port_synchronize()

2023-03-15 Thread Miroslav Lichvar
On Wed, Mar 15, 2023 at 03:48:41PM +0800, merlinhe wrote:
> Hello Team,
> 
> I recently encountered a *rogue peer delay response* error which seemly
> caused by function port_synchronize() reset peer_delay_req pointer.
> I'd like to know why port_synchronize() reset p->peer_delay_req to NULL is
> needed, can i comment this to avoid the rogue peer delay response error?

The clock jumping in the middle of a peer delay measurement corrupts
the result. Pretending there was no request is a simple solution to
avoid accepting the response, although the error message is confusing.

-- 
Miroslav Lichvar



___
Linuxptp-users mailing list
Linuxptp-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-users


Re: [Linuxptp-users] RHEL PTP Boundary Clock

2023-03-15 Thread Miroslav Lichvar
On Tue, Mar 14, 2023 at 05:56:45PM +, Chang, Benjamin via Linuxptp-users 
wrote:
> When I try to add the other nic in the config file, it errors. It says it 
> cant open the port of the nic to server 2.
> I tried running "sudo ptp4l -i nic2 -m" on command line and it does appear to 
> broadcast ptp, but it's using a local clock as grandmaster and not my 
> grandmaster.

The NICs don't have a common PTP clock. You need to enable the
boundary_clock_jbod option and run phc2sys in the automatic mode to
synchronize the PHCs to each other.

-- 
Miroslav Lichvar



___
Linuxptp-users mailing list
Linuxptp-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-users


Re: [Linuxptp-users] Pps output

2023-02-20 Thread Miroslav Lichvar
On Mon, Feb 20, 2023 at 09:48:08AM +, Alexis Chatail--Rigolleau (Student at 
CentraleSupelec) wrote:
> Hi,
> I have achieved ptp sync with my 2 linux devices which have 1 Intel xxv710 
> network adapter each. However I want to see a pps output to see how well my 
> signals are alined.
> 
> If my network adapter can provide a pps output on its SMA pins, how cam I 
> enable it ?

In the source code of the Linux kernel there is a "testptp" utility in
tools/testing/selftests/ptp. It has -L option to configure PPS input
or output.

-- 
Miroslav Lichvar



___
Linuxptp-users mailing list
Linuxptp-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-users


Re: [Linuxptp-users] message rates on G.8275.1

2023-02-20 Thread Miroslav Lichvar
On Mon, Feb 20, 2023 at 06:42:08PM +0530, Aditya Venu wrote:
> Doesn't ptp4l take the domain Number from default.cfg?

Only if you specify it as a config with the -f option.

The default.cfg file is provided in linuxptp to show the default
values of all options. It's not normally expected to be used as the
real config. It doesn't change anything.

-- 
Miroslav Lichvar



___
Linuxptp-users mailing list
Linuxptp-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-users


Re: [Linuxptp-users] message rates on G.8275.1

2023-02-20 Thread Miroslav Lichvar
On Mon, Feb 20, 2023 at 04:14:46PM +0530, Aditya Venu via Linuxptp-users wrote:
> I ran sudo ./ptp4l -f configs/G.8275.1 -i eth0 -2 -m

It should be -f configs/G.8275.1.cfg. The file specifies
the domain 24, the L2 transport, sync interval of 1/16s, and other
G.8275.1 settings.

-- 
Miroslav Lichvar



___
Linuxptp-users mailing list
Linuxptp-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-users


Re: [Linuxptp-users] IEEE802.1AS gPTP Boundary Clock

2023-02-13 Thread Miroslav Lichvar
On Thu, Feb 09, 2023 at 11:37:52AM -0800, Richard Cochran wrote:
> On Thu, Feb 09, 2023 at 01:32:14PM +0100, Miroslav Lichvar wrote:
> 
> > Yes, but if you know the length of the chain and charateristics of all
> > clocks and their timestamping, you can tune the servos to minimize
> > their gain peaking for the synchronization of the last clock. This can
> > be done with the pi servo in ptp4l.
> 
> Cool.
> 
> Have you ever published examples of this?  That would interest me.

No, I don't remember doing that. I'd expect there to be a thick book
written on this subject, likely from someone working in telco, with a
conclusion that it's more practical to require all PLLs to have their
gain peaking very small (e.g. 0.1 or 0.2 dB), assuming all chains of
clocks are long.

-- 
Miroslav Lichvar



___
Linuxptp-users mailing list
Linuxptp-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-users


Re: [Linuxptp-users] IEEE802.1AS gPTP Boundary Clock

2023-02-09 Thread Miroslav Lichvar
On Wed, Feb 08, 2023 at 07:18:17AM -0800, Richard Cochran wrote:
> > BTW, synchronization with BCs can work better than TCs if the PLLs are
> > well implemented and tuned. TCs are the simpler and safer approach.
> 
> There was a simulation study showing "gain peaking" from a long chain
> of servos.

Yes, but if you know the length of the chain and charateristics of all
clocks and their timestamping, you can tune the servos to minimize
their gain peaking for the synchronization of the last clock. This can
be done with the pi servo in ptp4l. The linreg servo has significant
gain peaking and is not configurable, i.e. unsuitable for longer
chains.

The way I think about the BC vs TC performance is that with BCs the
noise is filtered on each link and what passes to the end is smaller
than the sum of noise on all links, which is what it gets with TCs.
This assumes the sync interval is sufficiently short for the
instability of the clocks to not dominate the errors.

-- 
Miroslav Lichvar



___
Linuxptp-users mailing list
Linuxptp-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-users


Re: [Linuxptp-users] IEEE802.1AS gPTP Boundary Clock

2023-02-08 Thread Miroslav Lichvar
On Tue, Feb 07, 2023 at 07:39:48PM -0800, Richard Cochran wrote:
> Sure, if you have a chain topology of 15 hops, then you would start to
> see benefits from using TAB over BC.  But who has that kind of network?
> 
> Even then, would an 802.1as TAB outperform an ieee 1588 TC?

The draft I saw claimed that the synchronization performance of the
network is identical to 1588 using P2P TCs. It's not clear to me what
advantages their approach has.

BTW, synchronization with BCs can work better than TCs if the PLLs are
well implemented and tuned. TCs are the simpler and safer approach.

-- 
Miroslav Lichvar



___
Linuxptp-users mailing list
Linuxptp-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-users


Re: [Linuxptp-users] IEEE802.1AS gPTP Boundary Clock

2023-02-07 Thread Miroslav Lichvar
On Mon, Feb 06, 2023 at 04:17:30PM +, Nemo Crypto wrote:
>  Hi Miroslav,
> Thanks!
> In my understanding of "Time Aware Bridge", it doesn't correct/adjust/tune 
> the PHC. Is that not correct? 

Looking at some freely available drafts of 801.AS, yes, it seems the
clocks are supposed to be running free and correct timestamps with the
accumulated offsets from the follow up info TLV. However, the example
gPTP config doesn't have the free_running option enabled, so I'm not
sure if the support is complete or maybe it's only for the end
instances and not the bridges/relays. I have no experience with gPTP.

-- 
Miroslav Lichvar



___
Linuxptp-users mailing list
Linuxptp-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-users


Re: [Linuxptp-users] IEEE802.1AS gPTP Boundary Clock

2023-02-06 Thread Miroslav Lichvar
On Mon, Feb 06, 2023 at 03:21:25PM +, Nemo Crypto wrote:
> Hi Linuxptp-users,
> I am using gPTP 802.1AS profile for my network. My simplified network 
> topology looks like this,
> TimeLeader --> Eth Switch (802.1as Time Aware Bridge)-->Processor 
> (BC?)--->TimeFollower
> In the above topology, The processor runs linuxptp (ptp4l & phc2sys) has 2 
> interfaces. One interface should act as 802.1AS TimeFollower and other should 
> act as 802.1AS TimeLeader. I know that IEEE1588 BoundaryClock has this 
> feature. But I am not sure if 802.1AS (gPTP) has similar feature. 
> 
> Can you please share me details? If this is supported by LinuxPTP, can you 
> please help me how would the configuration file look like? 

IIRC gPTP has time-aware bridges which are equivalent to PTP boundary
clocks. ptp4l as a boundary clock doesn't require any special
configuration. For a gPTP example see configs/gPTP.cfg in the linuxptp
tarball/repository.

If your interfaces don't share a PTP clock, you will need to enable
the boundary_clock_jbod option and run phc2sys to keep the two PHCs
synchronized. However, that might not meet the gPTP requirements on
accuracy.

-- 
Miroslav Lichvar



___
Linuxptp-users mailing list
Linuxptp-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-users


Re: [Linuxptp-users] Slave's clock servo not going to locked state

2023-01-23 Thread Miroslav Lichvar
On Mon, Jan 23, 2023 at 04:36:11PM +0530, Aditya Venu wrote:
> *It seems the first clock step is disabled. Did you
> changefirst_step_threshold in your config?*
> 
> It is set to the default value itself(0.2).

I have no explanation. Sorry.

-- 
Miroslav Lichvar



___
Linuxptp-users mailing list
Linuxptp-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-users


Re: [Linuxptp-users] Slave's clock servo not going to locked state

2023-01-23 Thread Miroslav Lichvar
On Mon, Jan 23, 2023 at 03:54:27PM +0530, Aditya Venu wrote:
> *Does it work if you enable SW timestamping on the client?*
> 
> I'm pasting the output below with HW timestamping at master and SW
> timestamping on client:

It seems the first clock step is disabled. Did you change
first_step_threshold in your config?

-- 
Miroslav Lichvar



___
Linuxptp-users mailing list
Linuxptp-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-users


Re: [Linuxptp-users] Slave's clock servo not going to locked state

2023-01-23 Thread Miroslav Lichvar
On Mon, Jan 23, 2023 at 11:54:25AM +0530, Aditya Venu wrote:
> Any suggestions to the above issue please?!

I don't see anything wrong in the phc2ctl output, but your ptp4l
output shows frequency stuck at -1, which makes no sense to me.
Does it work if you enable SW timestamping on client?
What NIC, kernel, and linuxptp version is it using?

-- 
Miroslav Lichvar



___
Linuxptp-users mailing list
Linuxptp-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-users


Re: [Linuxptp-users] Slave's clock servo not going to locked state

2023-01-17 Thread Miroslav Lichvar
On Tue, Jan 17, 2023 at 03:46:29PM +0530, Aditya Venu via Linuxptp-users wrote:
> Corrected step_threshold to 0 and observed that slave's servo state going
> to locked state.
> 
> But the offset is continuously increasing..

It might be a driver issue. What does phc_ctl /dev/ptp0 (or the
corresponding device) print?

-- 
Miroslav Lichvar



___
Linuxptp-users mailing list
Linuxptp-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-users


Re: [Linuxptp-users] Slave's clock servo not going to locked state

2023-01-16 Thread Miroslav Lichvar
On Mon, Jan 16, 2023 at 03:40:20PM +0530, Aditya Venu wrote:
> Hi Miroslav,
> 
> Attaching the slave and master's config files below.

Your config sets step_threshold to 2 microseconds, which is less than
the offsets measured by the client and causes it to constantly step.
Such a poor performance with hardware timestamping indicates a problem
in the network (e.g. have the switches enabled PTP support?).

-- 
Miroslav Lichvar



___
Linuxptp-users mailing list
Linuxptp-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-users


Re: [Linuxptp-users] Slave's clock servo not going to locked state

2023-01-16 Thread Miroslav Lichvar
On Mon, Jan 16, 2023 at 12:17:33PM +0530, Aditya Venu via Linuxptp-users wrote:
> Hi All,
> In other words, what could be the reason for slave's servo clock state not
> going to locked state?

Clock stepping would be one example.

> Literally stuck at this point. Any inputs will help me in setting the
> direction for debugging.

If you provided your config, you might get a better advice.

-- 
Miroslav Lichvar



___
Linuxptp-users mailing list
Linuxptp-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-users


Re: [Linuxptp-users] No Effect of setting DelayAssymetry value in config file

2023-01-12 Thread Miroslav Lichvar
On Thu, Jan 12, 2023 at 04:21:11PM +0530, Gururaj Badiger wrote:
> Waveform Monitor takes Black inputs generated by Dev1 and Dev2 devices.
> 
> In this setup, Dev2 is locked to Dev1 PTP Leader. Now, when I change the
> "delayAsymmetry '' value of Dev2, from 0 to 20us, we are expecting a timing
> shift in Waveform Monitor. However, we dont see any change.
> This seems to indicate the value set to parameter delayAsymmetry doesn't
> have any effect.

The option works for me. Did you set it to 2 (nanoseconds)?
What exactly is the monitor comparing, two PPS signals from PHC on the
server and client?

-- 
Miroslav Lichvar



___
Linuxptp-users mailing list
Linuxptp-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-users


Re: [Linuxptp-users] Need clarification on sequence id

2023-01-11 Thread Miroslav Lichvar
On Wed, Jan 11, 2023 at 03:33:31PM +0530, Aditya Venu via Linuxptp-users wrote:
> I'm doing a two step time stamping and acting as a master. My doubt is:
> Should the sequence ID for sync, followup, announce, delay req and delay
> resp as shown in the screenshot be the same for one iteration?

Only messages that are responses to other message are expected to have
the same sequence ID. That is sync and follow_up, delay_req and
delay_resp, and pdelay_req and pdelay_resp/pdelay_resp_follow_up.

> 
> After the follow_up is received by the slave, will the immediate next
> message from the slave be delay_request?

No, delay requests are independent from sync/followup messages. There
can be zero, one, or multiple delay requests between two sync
messages.

-- 
Miroslav Lichvar



___
Linuxptp-users mailing list
Linuxptp-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-users


Re: [Linuxptp-users] Help to understand the ambiguity with phc2sys options

2022-12-05 Thread Miroslav Lichvar
On Thu, Dec 01, 2022 at 09:36:54PM +, Nemo Crypto wrote:
> Hi Experts,
> 
> According to the man page of phc2sys, it is used to synchronize 2 or more 
> clocks in the system. May I know what does this mean?

Maybe more clear would be to say it synchronizes one or more clocks to
another clock.

With some options it doesn't even have to synchronize anything.

> To my understanding, phc2sys is used to synchronize the system clock based on 
> the phc in 2 ways, either by directly reading the phc time periodically, or 
> using the PHC's PPS output as PPS source. So it is always for synchronizing 
> the system clock? I do not understand why 2 or more clocks would be 
> synchronized? Does it mean, there could be multiple system clocks and minimum 
> no. of sys clock is 2?

There is just one system clock.

> option -a => I looked at the code, and according to this, it is "autocfg". 
> Can someone please explain the scenario of this autocfg? 

Instead of the clocks being specified on the phc2sys command line it
asks ptp4l with what clocks it is configured.

> The manpage says - read the "clocks" to synchronize. Does it mean, there can 
> be multiple PHC? 
> Can there be one PHC on each port of a system?

Yes, it depends on the hardware. Each port of a NIC can have its own
PHC or they can share a common PHC.

-- 
Miroslav Lichvar



___
Linuxptp-users mailing list
Linuxptp-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-users


Re: [Linuxptp-users] Unable run ptp4l using Virtual Clock

2022-11-28 Thread Miroslav Lichvar
On Fri, Nov 25, 2022 at 02:43:34PM +0530, Amar B S wrote:
> Hi Miroslav,
> 
> Do you see any problem in the trace?

The kernel doesn't seem to be responding with any vclocks to
the ETHTOOL_MSG_PHC_VCLOCKS_GET request for srio2.

Is directory /sys/class/ptp/ptp2/ptp8 present on the system? That
should confirm that ptp8 is a vclock of ptp2.

-- 
Miroslav Lichvar



___
Linuxptp-users mailing list
Linuxptp-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-users


Re: [Linuxptp-users] Unable run ptp4l using Virtual Clock

2022-11-23 Thread Miroslav Lichvar
On Wed, Nov 23, 2022 at 07:53:32PM +0530, Amar B S wrote:
> This part of the code checks if VPHC is present using NetLink messages, it
> seems like we are not getting the expected response, hence failing to
> detect the VPHC.

Can you please run ptp4l in strace and post the output?

-- 
Miroslav Lichvar



___
Linuxptp-users mailing list
Linuxptp-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-users


Re: [Linuxptp-users] can linuxptp run on a single system?

2022-11-23 Thread Miroslav Lichvar
On Wed, Nov 23, 2022 at 08:41:36PM +0800, Hamilton Alex wrote:
> Hi, Miroslav:
> Thank you for your reply!
> but i didn't understand, on a single system, port 0 as master and port 1 as
> slave, and there is cable connect port 0 and port 1 for pkt communication.
> why ptp protocol doesn't work this way?

Are you using the hybrid_e2e option?

This is not an issue with the protocol. As I understand it, the kernel
will normally not send or accept a unicast packet to itself over a
real network interface. It has the loopback interface for that.

One way to get around that is to use multiple network namespaces.

-- 
Miroslav Lichvar



___
Linuxptp-users mailing list
Linuxptp-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-users


Re: [Linuxptp-users] can linuxptp run on a single system?

2022-11-23 Thread Miroslav Lichvar
On Wed, Nov 23, 2022 at 03:35:57PM +0800, Hamilton Alex wrote:
> so I wonder whether linuxptp can run on a single system(one CPU)?

You can have multiple ptp4l instances talking to each other on a
single system, but you need to disable the loopback shortcut between
them. The easiest way to do that is to put them in separate network
namespaces. See ip-netns(8).

-- 
Miroslav Lichvar



___
Linuxptp-users mailing list
Linuxptp-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-users


Re: [Linuxptp-users] Unable run ptp4l using Virtual Clock

2022-11-22 Thread Miroslav Lichvar
On Wed, Nov 23, 2022 at 01:04:42PM +0530, Amar B S wrote:
> Hi Miroslav,
> 
> May I know on which kernel version, this was working fine?

It turned out to be a linuxptp issue. See my patch on -devel.

-- 
Miroslav Lichvar



___
Linuxptp-users mailing list
Linuxptp-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-users


Re: [Linuxptp-users] Unable run ptp4l using Virtual Clock

2022-11-21 Thread Miroslav Lichvar
On Mon, Nov 21, 2022 at 03:06:44PM +0530, Amar B S wrote:
> Hi Miroslav,
> 
> The code was built on a dev system and I copied binaries into to test
> system. Is it required to build on the test system where kernel support is
> present ?

Actually, it shouldn't matter where it is built as linuxptp includes a
copy of the required declarations from the headers.

I did a test with a recent kernel and linuxptp, and there is indeed
something broken wrt vclocks. I'll look into that.

-- 
Miroslav Lichvar



___
Linuxptp-users mailing list
Linuxptp-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-users


Re: [Linuxptp-users] Unable run ptp4l using Virtual Clock

2022-11-20 Thread Miroslav Lichvar
On Mon, Nov 21, 2022 at 12:13:05PM +0530, Amar B S wrote:
> When I run ptp4l it's unable to detect the virtual clock and prints out the
> error “phc device mismatch”.
> After reading through the code I see that *“rtnl_iface_has_vclock” *is
> failing to detect the virtual clock. Can you please suggest what could be
> going wrong here? We are using CentOS 7 with
> *“kernel-ml-6.0.8-1.el7.elrepo.x86_64”*

Were the corresponding development files of the kernel available when
linuxptp was built? In the build log you should see -DHAVE_VCLOCKS.

-- 
Miroslav Lichvar



___
Linuxptp-users mailing list
Linuxptp-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-users


Re: [Linuxptp-users] PHC not being updated correctly

2022-11-15 Thread Miroslav Lichvar
On Tue, Nov 15, 2022 at 12:58:53PM +, prathosh shastry wrote:
> Hello team,
> 
> I had no issue with using software time stamping and also I am able to see
> the hardware timestamping support by building new kernel. But when I try to
> use the PHC, I see the PHC clock not being updated correctly. I see only
> the nSec bits being updated. Here are some of the tests I did.
> 
> -
> *root@sama7g5ek-sd:~# phc_ctl eth0 get*
> 
> *phc_ctl[60533.796]: clock time is 1.010098874 or Thu Jan  1 00:00:01 1970*

It's most likely a bug in the driver. What hardware are you using?

-- 
Miroslav Lichvar



___
Linuxptp-users mailing list
Linuxptp-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-users


Re: [Linuxptp-users] Fw: clock_gettime() and clock_id (Nemo Crypto)

2022-10-31 Thread Miroslav Lichvar
On Mon, Oct 31, 2022 at 02:00:28PM +, Nemo Crypto wrote:
> MONOTONIC:964.921879908
> REALTIME:316260827.761696659
> TAI:316260827.761702962
> 
> During this time, at least, I was expecting that the phc2sys phc offset would 
> show the jump in offset which is not the case..
> phc2sys[44.221]: CLOCK_REALTIME phc offset   909 s2 freq  +17596 delay   
> 1071
> ptp4l[44.283]: master offset   1156 s2 freq  +18362 path delay 14498
> phc2sys[45.221]: CLOCK_REALTIME phc offset  1651 s2 freq  +18610 delay   
> 1041
> ptp4l[45.308]: master offset    766 s2 freq  +18319 path delay 14498
> phc2sys[46.221]: CLOCK_REALTIME phc offset  1346 s2 freq  +18801 delay   
> 1069
> ptp4l[46.333]: master offset   -305 s2 freq  +17478 path delay 14498
> phc2sys[47.221]: CLOCK_REALTIME phc offset   123 s2 freq  +1798
> Can you please help explaining this behavior?

The timestamps printed by ptp4l and phc2sys in brackets is the
monotonic time, which doesn't match the 964 above. Are you running the
commands on the same machine?

-- 
Miroslav Lichvar



___
Linuxptp-users mailing list
Linuxptp-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-users


Re: [Linuxptp-users] Fw: clock_gettime() and clock_id (Nemo Crypto)

2022-10-31 Thread Miroslav Lichvar
On Sun, Oct 30, 2022 at 05:50:00PM +, Nemo Crypto wrote:
>  Thank you Chris, this answers my question.
> 
> I used CLOCK_REALTIME and observed the time jumping according to the timezone 
> change and day light saving adjustment. I think CLOCK_TAI would be the right 
> one to use, I will try this.

CLOCK_REALTIME is supposed to keep time in UTC, not a local timezone.
The only observable time jumps when synchronized should be leap
seconds. If your application is displaying time in a broken-down
format, it might be an issue with calling localtime() instead of
gmtime().

-- 
Miroslav Lichvar



___
Linuxptp-users mailing list
Linuxptp-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-users


Re: [Linuxptp-users] Intel i350 offset volatility

2022-10-24 Thread Miroslav Lichvar
On Sat, Oct 22, 2022 at 06:23:16AM +1100, Aris Theocharides via Linuxptp-users 
wrote:
> For the record, I adjusted some kernel configurations and the offsets are now 
> down to the ~20-30 ns range on the i350 card.
> 
> The differences are adjustments to PCI bus performance modes.

Good to hear it's working. What delay is now phc2sys reporting? Those
~2 ns in your original post is way too much for an I350.

-- 
Miroslav Lichvar



___
Linuxptp-users mailing list
Linuxptp-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-users


Re: [Linuxptp-users] Intel X722 maybe incompatible with IEEE1588 2.1

2022-10-20 Thread Miroslav Lichvar
On Thu, Oct 20, 2022 at 12:27:06AM -0700, Cliff Spradlin via Linuxptp-users 
wrote:
> I'm looking into it further, but it looks like the X722 (which uses
> the i40e driver) does not record RX timestamps on layer 2 1588 event
> packets where the version is set to 2.1 rather than 2.
> 
I'm wondering if this could be fixed with a firmware update or if it's
in the silicon. I vaguely remember some Intel NIC had a firmware
update which added a timestamping filter.

-- 
Miroslav Lichvar



___
Linuxptp-users mailing list
Linuxptp-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-users


Re: [Linuxptp-users] PMC SET command for message rates

2022-10-10 Thread Miroslav Lichvar
On Mon, Oct 10, 2022 at 07:28:31PM +0530, Gururaj Badiger wrote:
> Hello,
> 
> In my current setup, whenever I want to change the message rates, I update
> config file and restart Ptp4l process.
> 
> I have a requirement where in, I want to change the message rates while
> Ptp4l process is in running state, perhaps by running a PMC SET command (?).

It's not possible to change the intervals with a management message
and the current code.

-- 
Miroslav Lichvar



___
Linuxptp-users mailing list
Linuxptp-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-users


Re: [Linuxptp-users] Overflow issue for 32bit machines: ptp_clock_info.max_adj versus timex.freq

2022-10-06 Thread Miroslav Lichvar
On Thu, Oct 06, 2022 at 09:23:57AM +0200, Janusz Użycki wrote:
> OK. The issue is not related to linuxptp v3.1. Thank you for pointing the
> clamp.
> Is it common for phc2sys and ts2phc also ?

I see a phc_max_adj() call in both phc2sys and ts2phc, so I'd expect
them to handle it correctly.

-- 
Miroslav Lichvar



___
Linuxptp-users mailing list
Linuxptp-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-users


Re: [Linuxptp-users] Overflow issue for 32bit machines: ptp_clock_info.max_adj versus timex.freq

2022-10-06 Thread Miroslav Lichvar
On Thu, Oct 06, 2022 at 12:11:39AM +0200, Janusz Użycki wrote:
> Hi.
> 
> A lot of PTP/PHC drivers set max_adj value quite big. Howover due to
> kernel's API limit of 32bit long type value (freq) and POSIX frequency
> conversion it should limited to 32767999 ppb.
> 
> It concerns the frequency limit check both for kernel, testptp and ptp4linux
> servos. Simply 65.536 * 32767999 is almost 2^31... It is also common for
> adjfreq() vs newer adjfine().
> Moreover such big frequency limits seem not practical (phase jump used
> instead, 1000ppm is huge for any PTP oscillator application), even driver or
> rather PHC hardware has ability to tune is such range.

What issue are you seeing with linuxptp?

In phc_max_adj() there is some code clamping the value on 32-bit
systems, so the overflow should be avoided.

-- 
Miroslav Lichvar



___
Linuxptp-users mailing list
Linuxptp-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-users


Re: [Linuxptp-users] Is output from pmc cached in some manner?

2022-09-29 Thread Miroslav Lichvar
On Wed, Sep 28, 2022 at 10:53:48AM -0400, Rich Schmidt wrote:
> On a second PTP client, *the Grandmaster is reported as still present:*
> 
> pmc -i enp10s0f0 "GET TIME_STATUS_NP"

Is this command being executed on the PTP client itself? In
that case you would normally want to use the Unix socket instead of
network interface. If you have two ptp4l instances, you would need
them to be configured with different uds_address and specify the path
for pmc with the -s option.

> sending: GET TIME_STATUS_NP
> 
> b49691.fffe.35c204-1 seq 0 RESPONSE MANAGEMENT TIME_STATUS_NP

Does the port ID above correspond to the client's port you intended to
query? There might be a different PTP client running in the
network and giving you unexpected responses.

-- 
Miroslav Lichvar



___
Linuxptp-users mailing list
Linuxptp-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-users


Re: [Linuxptp-users] (no subject)

2022-09-26 Thread Miroslav Lichvar
On Mon, Sep 26, 2022 at 02:12:38PM +0200, Akash Munirathinam wrote:
> 
> Dear All,
> My NIC is i350 which supports ptp. when i ran the command ethtool -T "my
> interface" it doesn't show any parameters. it's quite strange. i have
> attached an image for your reference. Do let me know if i am missing
> something and btw i even installed latest ethernet driver but in vain.

Which parameters? The output seems ok to me, except it doesn't look
like an I350, which should be able to timestamp all received packets.
Here is the output I get:

Time stamping parameters for i350a:
Capabilities:
hardware-transmit
software-transmit
hardware-receive
software-receive
software-system-clock
hardware-raw-clock
PTP Hardware Clock: 0
Hardware Transmit Timestamp Modes:
off
on
Hardware Receive Filter Modes:
    none
    all

-- 
Miroslav Lichvar



___
Linuxptp-users mailing list
Linuxptp-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-users


Re: [Linuxptp-users] Need to disable Follow Up message

2022-09-19 Thread Miroslav Lichvar
On Mon, Sep 19, 2022 at 08:23:15AM +0200, Miroslav Lichvar wrote:
> > Please help me to disable followUp messages in linux stack.
> 
> You can disable announce messages with the inhibit_announce option.

I should read the mail more carefully. There is no option to disable
followUp message on two-step clocks. That would prevent
synchronization.

-- 
Miroslav Lichvar



___
Linuxptp-users mailing list
Linuxptp-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-users


Re: [Linuxptp-users] Need to disable Follow Up message

2022-09-19 Thread Miroslav Lichvar
On Mon, Sep 19, 2022 at 11:44:50AM +0530, Hari Kumar wrote:
> Hi All,
> 
> I need to disable followUp messages in initial ptp stack messages in
> Boundary clock mode.
> I have disabled OneStep flag but the interface is not coming up with the
> master. So, enabled the OneStep flag and all are working fine but I
> dont want followUp messages since it is a Unicast profile.
> Please help me to disable followUp messages in linux stack.

You can disable announce messages with the inhibit_announce option.

But I guess you actually need to keep the unicast message and only
disable multicast messages, in which case there is the
inhibit_multicast_service option.

-- 
Miroslav Lichvar



___
Linuxptp-users mailing list
Linuxptp-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-users


Re: [Linuxptp-users] PHY or MAC timestamp

2022-09-14 Thread Miroslav Lichvar
On Wed, Sep 14, 2022 at 12:48:57PM +0530, Hari Kumar wrote:
> I couldn't able to check that the timestamp getting with ptp4l is PHY or
> MAC based timestamping.
> will ptp4l support PHY timestamp? If yes, please help me by sharing steps
> to run ptp4l for PHY timestamp. Finally, how to confirm what kind of
> timestamping?

It depends on the hardware and driver. You would need to check the
source code. ptp4l doesn't know/care which is it. PHY timestamping
seems to be very rare in computer NICs (and is limited to slower
network speeds?).

As a quick test, if you have two pieces of the hardware, you can
connect them with directly with a short cable and see the delay
reported by ptp4l. If it is hundreds of nanoseconds or more, it's
likely MAC timestamping. Note that some drivers have hardcoded
compensation and some modern NICs seem to do it in hardware.

-- 
Miroslav Lichvar



___
Linuxptp-users mailing list
Linuxptp-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-users


Re: [Linuxptp-users] ANNOUNCE_RECEIPT_TIMEOUT_EXPIRES error when slave syncs with GM

2022-09-12 Thread Miroslav Lichvar
On Mon, Sep 12, 2022 at 07:23:03PM +0530, Raj wrote:
> Yes, ECU1 sends  Announce  packet  in every 2 sec , however the switch in
> between (NETGEAR GS724Tv4) sends Announce packet to ECU2 every 1 sec.
> 
> I tried with "logAnnounceInterval  0" in both ECU1 & ECU2 and observed the
> same issue as mentioned above.

Ok, so there is a gPTP bridge between ECU1 and ECU2. What do you see
in its announce messages? Is the grandmaster identity changing over
time?

The delay you had in the log was over 3 microseconds. Is the delay to
ECU1 the same and is it acceptable for the switch according to its
configured delay threshold?

-- 
Miroslav Lichvar



___
Linuxptp-users mailing list
Linuxptp-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-users


Re: [Linuxptp-users] ANNOUNCE_RECEIPT_TIMEOUT_EXPIRES error when slave syncs with GM

2022-09-12 Thread Miroslav Lichvar
On Sat, Sep 10, 2022 at 09:18:04PM +0530, Raj wrote:
> We are observing that When ECU1 is active ECU2 initially takes a long time
> (randomly 10 sec - 2min approx) to sync with ECU1(GM) and once ECU2
> successfully syncs with ECU1 then after that there is no issue. ECU2
> throwing "SLAVE to MASTER on ANNOUNCE_RECEIPT_TIMEOUT_EXPIRES" error and
> considering itself as GM by sending announce packet , after that again
> considering ECU1 as GM and going to slave mode, this fluctuation on ECU2 is
> happening intially  when ECU2 is trying to sync with ECU1 and after some
> time (randomly 10 sec -2min) ECU2 successfully  getting synchronozed with
> ECU1.
> 
> 
> The question is why does ECU2 take more time initially to select ECU1 as GM
> ?

If you capture PTP traffic on ECU2, do you see announce messages from
ECU1 every two seconds (following logAnnounceInterval=1) ?

-- 
Miroslav Lichvar



___
Linuxptp-users mailing list
Linuxptp-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-users


Re: [Linuxptp-users] [Linuxptp-devel] linuxptp result doesn't match 1PPS measurement

2022-09-08 Thread Miroslav Lichvar
On Thu, Sep 08, 2022 at 07:41:53PM +0800, Hamilton Alex wrote:
> ptp4l[130171.662]: rms1 max2 freq-49 +/-   3 delay  9058 +/-   0

> my board has 1PPS output, I connect it to the master and compared with
> reference PPS.
> however,  the 1pps time error is around 40 NS, which means my board is
> ahead of the reference for about 40NS, which doesn't match the result
> dumped by ptp4l.

ptp4l is just printing the measured offset. It doesn't know the actual error.

A measured delay of 9 microseconds is huge. That's few kilometers of
cable. What hardware do you use? Does it have PHY or MAC timestamping,
and are those errors compensated? 

-- 
Miroslav Lichvar



___
Linuxptp-users mailing list
Linuxptp-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-users


Re: [Linuxptp-users] Error when configuring multiple slaves

2022-09-07 Thread Miroslav Lichvar
On Wed, Sep 07, 2022 at 10:30:09AM +0900, james jeong wrote:
> Slave 1 and 2 are normally synchronized with Master's time.
> However, Slave3 is out of sync as "Waiting for ptp4l..." is output in
> the log of phc2sys.

It would help if you could post the ptp4l logs.

> Up to 2 slaves can be synchronized normally, but if you try to
> configure 3 or more slaves, synchronization will fail.

That is odd. What HW and driver does the server have?

-- 
Miroslav Lichvar



___
Linuxptp-users mailing list
Linuxptp-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-users


Re: [Linuxptp-users] Two Delay_req message

2022-09-05 Thread Miroslav Lichvar
On Mon, Sep 05, 2022 at 05:31:55PM +0600, - - wrote:
> Thank you for your help.
> 
> But I'm not quite clear:
> Sync message
> Follow_up message
> Delay_req message
> Delay_resp message
> Delay_req message
> Delay_resp message
> 
> So it looks like there is a surplus here
> Delay_req message
> Delay_resp message
> 
> Is this normal?

Yes, it is normal. The timing of delay requests is independent from
sync messages and it is random. You can have 0, 1, 2, or more delay
request and responses between two sync messages.

-- 
Miroslav Lichvar



___
Linuxptp-users mailing list
Linuxptp-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-users


Re: [Linuxptp-users] Two Delay_req message

2022-09-05 Thread Miroslav Lichvar
On Mon, Sep 05, 2022 at 08:11:48AM +, Dennis Hagarty (dehagart) via 
Linuxptp-users wrote:
> In IEEE 1588-2019, the requirement for regular messages is outlined in 
> “9.5.11.2 Timing requirements” – generally they should be transmitted at an 
> interval above 90% of the desired inter-message interval.
> So, for example, if you configured 32 packets per second (1/32 second 
> interval), you would expect an average inter-message time value around that 
> configured value (roughly +/- 10%)
> So, if the two delay_Req and sent are on top of each other, then the slave is 
> misbehaving, although the master should tolerate short excursions from the 
> inter-message interval.

No, the client is fine. The minimum interval between two delay
requests is 0. Quoting from 9.5.11.2:

the random distribution shall be a uniform random distribution with a
minimum value of 0 and a maximum value of {2^logMinDelayReqInterval+1}
    seconds

-- 
Miroslav Lichvar



___
Linuxptp-users mailing list
Linuxptp-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-users


Re: [Linuxptp-users] Two Delay_req message

2022-09-05 Thread Miroslav Lichvar
On Mon, Sep 05, 2022 at 12:25:20AM +0500, - - wrote:
> I understand that depending on the mod ptp can work without Follow_up.

Follow up is needed when the hardware cannot modify the timestamp in
the sync message as it is being transmitted. This seems to be rare in
computer HW.

> So it looks like the master sends two Delay_req.
> I just need to understand if it's expected ptp work or it's a bug with the
> driver

The interval between delay requests is random to avoid requests from
different clients to arrive at the same time at the server.
If the server is slower in responding, or the interval happens to be
very close to 0, you could see two delay requests before first
response.

-- 
Miroslav Lichvar



___
Linuxptp-users mailing list
Linuxptp-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-users


Re: [Linuxptp-users] Irregular rate of Delay Request messages

2022-08-30 Thread Miroslav Lichvar
On Tue, Aug 30, 2022 at 03:28:51PM +0200, Ray Vanbeek wrote:
> Ah, that explains it. Thanks, Miroslav!
> 
> And what about an ever decreasing master offset value at -max freq?
> I assume the master offset value is in nanosecs? It seems that in 120
> seconds, the master offset value decreases with appr 90 secs

The offset is in nanoseconds. That sounds like a bug in driver/hw.
What do you use? Maybe someone will have a better suggestion.

-- 
Miroslav Lichvar



___
Linuxptp-users mailing list
Linuxptp-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-users


Re: [Linuxptp-users] Irregular rate of Delay Request messages

2022-08-30 Thread Miroslav Lichvar
On Tue, Aug 30, 2022 at 02:27:22PM +0200, Ray Vanbeek wrote:
> Running ptp4l as a slave, what influences the rate at which Delay Request
> Messages are sent out? Pretty standard, the GM send out Announce Messages
> every 2 secs, Sync and Follow_Up Messages every second.
> The slave sends out Delay Request Messages irregular:  ranging from <1 sec
> to 16 sec between subsequent messages. The GM always responds immediately
> to a DelayReq.

That's a feature of PTP. Clients are required to randomize their
interval of delay requests in order to minimize collisions at the server.

If you see the interval reaching 16 seconds, that means
logMinDelayReqInterval is 3 on the server.

-- 
Miroslav Lichvar



___
Linuxptp-users mailing list
Linuxptp-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-users


Re: [Linuxptp-users] Question about L2 mode

2022-08-22 Thread Miroslav Lichvar
On Fri, Aug 19, 2022 at 02:12:20PM +0600, - - wrote:
> offset root mean square (rms)
> maximum absolute offset (max)
> frequency offset (freq): its mean, and standard deviation
> path delay (delay): its mean, and standard deviation
> 
> How are these values calculated?

They are calculated from the offsets and frequencies returned by the
servo in the interval configured by the summary_interval option. If
you set summary_interval to the logSyncInterval, you will see the raw
values.

> After about 40 seconds, is this a feature of L2 mode? or the issue is not
> in the ptp?

Sounds like a hardware or driver issue. What are you using?

-- 
Miroslav Lichvar



___
Linuxptp-users mailing list
Linuxptp-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-users


Re: [Linuxptp-users] instable mapping of ptp device to interface

2022-08-22 Thread Miroslav Lichvar
On Wed, Jul 13, 2022 at 03:33:06PM +0200, Marco Davids (SIDN) via 
Linuxptp-users wrote:
> Most of the time when I reboot this Linux server, ptp0 is connected to eno1:
> 
> ptp4l: [18.144] eno1 selected /dev/ptp0 as PTP clock
> 
> But sometimes this is ptp1, which is pretty annoying:
> 
> ptp4l: [18.745] eno1 selected /dev/ptp1 as PTP clock
> 
> Does anyone has a suggestion on how to prevent this and make the mapping
> between interface and ptp device more robust?

Beside custom scripts determining the mapping, it's possible to use
udev rules (e.g. /etc/udev/rules.d/80-phc.rules) like this:

KERNEL=="ptp[0-9]*", 
DEVPATH=="/devices/pci:00/:00:1c.0/:03:00.0/*", 
SYMLINK+="ptp-i350-1"
KERNEL=="ptp[0-9]*", 
DEVPATH=="/devices/pci:00/:00:1c.0/:03:00.1/*", 
SYMLINK+="ptp-i350-2"

This should create stable symlinks for the two PHC devices matching
the PCI device path.

You can find the device path for an existing device like this:

# udevadm info /dev/ptp7
P: /devices/pci:00/:00:1c.0/:03:00.1/ptp/ptp7
N: ptp7
E: DEVNAME=/dev/ptp7
E: DEVPATH=/devices/pci:00/:00:1c.0/:03:00.1/ptp/ptp7
E: MAJOR=249
E: MINOR=7
E: SUBSYSTEM=ptp

-- 
Miroslav Lichvar



___
Linuxptp-users mailing list
Linuxptp-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-users


Re: [Linuxptp-users] Doubly attached clock - Unknown option

2022-08-10 Thread Miroslav Lichvar
On Tue, Aug 09, 2022 at 07:59:19PM +0530, Sethu Madhav wrote:
> Which version of the linuxptp branch supports option doubly attached node.
> I have doubly attached clock in config and iam getting unknown option . can
> someone tell the supported version for doubly attached clock.
> Iam a beginner in this field and career .Any helps are appreciated.

You were probably using a custom linuxptp version. The official code
doesn't contain any option with "doubly" in its name and I don't see
anything in the git log either.

-- 
Miroslav Lichvar



___
Linuxptp-users mailing list
Linuxptp-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-users


Re: [Linuxptp-users] Question about how to run linuxptp as a service daemon

2022-08-10 Thread Miroslav Lichvar
On Wed, Aug 10, 2022 at 09:13:53AM +0900, james jeong wrote:
> Dear,
> 
> We are using Ubuntu 20.04 LTS.
> I am trying to use linuxptp as a service daemon rather than an application.
> (The purpose is to automatically run ptp4l and phc2sys when the Master and
> Slave devices are booted.)

The Ubuntu linuxptp package seems to contain systemd service files:

/lib/systemd/system/phc2sys.service
/lib/systemd/system/ptp4l.service
/lib/systemd/system/timemaster.service

and it has configuration files in /etc/linuxptp.

You would just edit the configuration and enable the services you need
to run.

-- 
Miroslav Lichvar



___
Linuxptp-users mailing list
Linuxptp-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-users


Re: [Linuxptp-users] Syntax to use PMC with SET command

2022-08-09 Thread Miroslav Lichvar
On Tue, Aug 09, 2022 at 10:21:57AM +0530, Gururaj Badiger wrote:
> HW:   ARMv8 Cortex-A53 processor (quad-core) in the Stratix10 SoC FPGA
> 
> Driver:  intel_fpga_qse_ll (10gb/s)

I think that was meant for the other thread.

It seems to be an out-of-tree driver. Try increasing
tx_timestamp_timeout. If that doesn't help, you will need to ask the
vendor or where you got the driver to look at the issue you have with
missing TX timestamps.

-- 
Miroslav Lichvar



___
Linuxptp-users mailing list
Linuxptp-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-users


Re: [Linuxptp-users] inconsistent Message rates

2022-08-08 Thread Miroslav Lichvar
On Mon, Aug 08, 2022 at 03:29:26PM +0530, Gururaj Badiger wrote:
> Is the server configured with the same logAnnounceInterval?:
>  Do you mean both Leader and Follower config files should be
> configured with the same Sync and Announce interval values?

The announce interval needs to be the same in the whole PTP domain.
The sync interval doesn't have to be, but usually it is.

> Client log meaning, are you asking console logs on Leader?

I think client is follower in the leader/follower terminology (we use
the server/client terminology in linuxptp).

>  Here is the console log on Leader shell:

Your log shows many tx timestamp timeouts, so that needs to be
resolved first. What hardware and driver are you using?

-- 
Miroslav Lichvar



___
Linuxptp-users mailing list
Linuxptp-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-users


Re: [Linuxptp-users] inconsistent Message rates

2022-08-08 Thread Miroslav Lichvar
On Mon, Aug 08, 2022 at 02:34:32PM +0530, Gururaj Badiger wrote:
> Hello,
> 
> I have been using ptp4l with the below config file. What I noticed was -
> 
> In Follower mode, when 'Announce Interval' set to more than 4Hz (4 messages
> per second config value -2) and 'Sync Interval' set to more than 8Hz
> (8messages per second config value -3), I see ptp4l lock status toggling
> between "Faulty" to "ÜnCalibrated" to "Slave" to "Faulty" and cycle
> repeats. The lock status is not getting stabilized.

Is the server configured with the same logAnnounceInterval? If the
client had a shorter interval, it would time out and lead to
the uncalibrated state. I'm not sure about faulty. Can you post the
client log?

-- 
Miroslav Lichvar



___
Linuxptp-users mailing list
Linuxptp-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-users


Re: [Linuxptp-users] Syntax to use PMC with SET command

2022-08-08 Thread Miroslav Lichvar
On Mon, Aug 08, 2022 at 01:18:11PM +0530, Gururaj Badiger wrote:
> I understand that for some of the parameters such as PRIORITY1,
> PRIORITY2, PORT_DATA_SET_NP etc., PMC command provides the option to SET
> the values to ptp4l.
> 
> Could you help me with the syntax on how to use the PMC SET command via
> shell.

Here are some examples:

# pmc -u 'SET PRIORITY1 130'
# pmc -u 'SET PORT_DATA_SET_NP neighborPropDelayThresh 1000 asCapable 0'

-- 
Miroslav Lichvar



___
Linuxptp-users mailing list
Linuxptp-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-users


Re: [Linuxptp-users] [chrony-users] Re: Question about large gap of offset on phc2sys with chrony

2022-08-08 Thread Miroslav Lichvar
On Fri, Aug 5, 2022 at 11:14 AM 심준영  wrote:
> My problem is to cause too large gap between system clock and PTP hardware
> clock
> for a short while, whenever chrony synchronizes time from external NTP
> server
> (Poll is 6, so about 64 seconds) and then will affect to PTP hardware
> clock and
> system clock of the ptp4l slave machine.
>
> Are there any ideas to keep stable small gap even though using NTP like
> chrony
> to update system clock?

You can slow down the corrections of the system clock made by chronyd
by increasing the corrtimeratio (e.g. to 100 or 1000) and/or slow down
the corrections of the PHC made by phc2sys by setting smaller PI
constants (e.g. -P 0.04 -I 0.00024).

The latter will not make the offset reported by the server phc2sys
smaller, but it will make the clock easier for the clients to follow,
i.e. keep the offset between the clients smaller, which I assume is
what you are primarily interested in.

-- 
Miroslav Lichvar



___
Linuxptp-users mailing list
Linuxptp-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-users


Re: [Linuxptp-users] nullf servo Q

2022-08-04 Thread Miroslav Lichvar
On Thu, Aug 04, 2022 at 02:27:30PM +0300, Aya Levin via Linuxptp-users wrote:
> Hi,
> 
> I am trying to use ptp4l combined with synce.
> Thus I am using nullf servo.
> Configuring:
> I keep getting the fault messages below.
> Q: Is this expected? Am I missing some configurations?

> clock_servo nullf
> step_threshold  0.1

You have the step threshold set to 1 ns, but the log below shows
larger offsets, which means it's frequently stepping. You should
increase the threshold.

If you want to synchronize to the average offset instead of sticking
to the first measurement, you can use the PI servo with small
constants.

> Output:
> port 1: SLAVE to UNCALIBRATED on SYNCHRONIZATION_FAULT
> rms    4 max   10 freq     +0 +/-   0 delay  7173 +/-   0
> port 1: UNCALIBRATED to SLAVE on MASTER_CLOCK_SELECTED
> port 1: SLAVE to UNCALIBRATED on SYNCHRONIZATION_FAULT
> port 1: UNCALIBRATED to SLAVE on MASTER_CLOCK_SELECTED
> rms    4 max    7 freq     +0 +/-   0 delay  7172 +/-   0

-- 
Miroslav Lichvar



___
Linuxptp-users mailing list
Linuxptp-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-users


Re: [Linuxptp-users] Enable timestamping in Wireless

2022-08-04 Thread Miroslav Lichvar
On Thu, Aug 04, 2022 at 12:44:06PM +0200, Anh Nguyen wrote:
> Hello,
> I have been using linuxptp in a wired network but now I would like to try
> using a mixed configuration. However, my NIC seems to not support the
> operation as it is missing tx_software. I have read that it would require a
> modification to the driver but I have no experience in the matter and would
> like to ask if there is any example to help.

This topic was discussed here recently:
https://www.mail-archive.com/linuxptp-users@lists.sourceforge.net/msg02822.html

In short, there is no HW support, SW timestamping doesn't make sense,
don't use PTP over wireless networks.

-- 
Miroslav Lichvar



___
Linuxptp-users mailing list
Linuxptp-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-users


Re: [Linuxptp-users] Questions about how to use linuxptp

2022-08-04 Thread Miroslav Lichvar
On Thu, Aug 04, 2022 at 05:51:20PM +0900, james jeong wrote:
> I have the following questions:
> 1. What is the difference between the delay output from phc2sys and the
> path delay output from ptp4l of the slave?

ptp4l prints the estimated network delay of sync messages including
timestamping errors.

phc2sys prints the time it takes to read the system clock and
hardware clock in order to measure the offset. That includes delays in
the CPU, PCIe and the NIC.

> 2. If you change the master's time arbitrarily while PTP time is
> synchronized by entering the command written above (example: change the
> time randomly by entering date -s '2012-01-01 00:00:00' in the master) Is
> there a way for the Slave to automatically synchronize accordingly? (Or is
> there an option to synchronize it to the master's clock every specific
> period?)

You can enable clock steps with the step_threshold option. See the
ptp4l and phc2sys man pages.

-- 
Miroslav Lichvar



___
Linuxptp-users mailing list
Linuxptp-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-users


Re: [Linuxptp-users] [Linuxptp-devel] Clockcheck: clock jumped backward or running slower than expected!

2022-08-03 Thread Miroslav Lichvar
On Wed, Aug 03, 2022 at 10:51:27AM +, ramesh t wrote:
> Thanks for your response.
> 
> This issue is observed on NIC PHC and apart from ptp4l no other process will 
> update the NIC PHC in this case.

Can you post a log with the message?
> 
> Will process (ptp4l) scheduling have an impact on this?

Yes, that's possible.

-- 
Miroslav Lichvar



___
Linuxptp-users mailing list
Linuxptp-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-users


Re: [Linuxptp-users] [Linuxptp-devel] Clockcheck: clock jumped backward or running slower than expected!

2022-08-03 Thread Miroslav Lichvar
On Tue, Aug 02, 2022 at 05:42:55PM +, ramesh t via Linuxptp-devel wrote:
> Hello,
> 
> Observing once in while clockcheck error.
> 
> Any suggestion why this could happen??

On what hardware? SW or HW timestamping?

It could be a driver bug. It could also be another program adjusting
the clock, like an NTP client.

-- 
Miroslav Lichvar



___
Linuxptp-users mailing list
Linuxptp-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-users


Re: [Linuxptp-users] FYI - TX Timestamp Timeout Fix

2022-07-28 Thread Miroslav Lichvar
On Wed, Jul 27, 2022 at 01:41:23PM -0700, Cliff Spradlin via Linuxptp-users 
wrote:
> I just wanted to share the results of an investigation on TX timestamp
> timeout problems my project has been experiencing. The tl;dr is that
> the pfifo_fast qdisc suffers from data ordering bugs which can cause
> outgoing packets to get forgotten / stuck in the outgoing buffer.
> Those may have been fixed in newer kernel versions, but my solution
> was to switch to the pfifo qdisc which uses much less sophisticated
> codepaths.

Very interesting. Thanks for sharing.

-- 
Miroslav Lichvar



___
Linuxptp-users mailing list
Linuxptp-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-users


Re: [Linuxptp-users] ioctl SIOCSHWTSTAMP failed: Operation not supported

2022-07-25 Thread Miroslav Lichvar
On Fri, Jul 22, 2022 at 10:46:33PM +0200, Mohammad wrote:
>i am using patched ath9k driver to run wiFi-ptp
> 
>linuxptp works with Software timestaming but with Hardware timestamping it
>Shows this error.
> 
> 
> 
>ptp4l[121.996]: ioctl SIOCSHWTSTAMP failed: Operation not supported

It's probably a bug in the patch that it presents both the SW and HW
timestamping capability.

But as was discussed in the previous thread, PTP over SW-timestamped
wifi will not work well.

-- 
Miroslav Lichvar



___
Linuxptp-users mailing list
Linuxptp-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-users


Re: [Linuxptp-users] gPTP issues with ntpd

2022-07-21 Thread Miroslav Lichvar
On Thu, Jul 21, 2022 at 02:13:29PM +0200, Jakub Raczyński wrote:
> My interpretation is based only on ntpshmmon tool - it clearly shows that 
> ntpshm servo is only fed when PTP portState is set to Slave. So it is used 
> only to write to the segment, but phc2sys clearly controls when it is done. 
> Since ntpd does not communicate with phc2sys then whether it works or not is 
> only based on phc2sys.

You said something about ntpd reset. I'm not sure what that is. If
there was something removing the segment (e.g. a script using ipcrm)
before phc2sys reverses the direction, it would create a new SHM, which
wouldn't be monitored by ntpshmmon started earlier.

> It seems you have great feature of phc2sys that allows to synchronize ntpshm 
> servo in Slave state and use CLOCK_REALTIME as Master, yet you say like it 
> does not exist. And again, I intend to use it that way. I am not trying to 
> read anything from ntpshm.

ntpshm doesn't synchronize anything. It just provides data for another
process to synchronize the clock. ntpd can synchronize CLOCK_REALTIME,
but not a PHC, and even if it could, it wouldn't know when it should
switch.

You need two phc2sys instances.

-- 
Miroslav Lichvar



___
Linuxptp-users mailing list
Linuxptp-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-users


Re: [Linuxptp-users] gPTP issues with ntpd

2022-07-21 Thread Miroslav Lichvar
On Thu, Jul 21, 2022 at 12:41:54PM +0200, Jakub Raczyński wrote:
> > 21.07.2022 10:20 Miroslav Lichvar  wrote:
> > No, that's not correct. Try running the ntpshmmon tool from gpsd to
> > see that phc2sys is writing new samples in both directions.
> 
> You are mistaken, I did try ntpshmmon and it does write to ntpshm only in one 
> direction as Slave.

Well, that means there is something wrong with your setup.

> As such, since data is not written to ntpshm, I assume that phc2sys does 
> select direction incorrectly after ntpd reset when significant offset was 
> present. Seems like servo reset issue that does not update direction or sets 
> it incorrectly. I will probably debug it in following days but I had hoped 
> you could be of assistance.

Your interpretation is wrong.

If you looked at the code, you would see that the ntpshm servo is only
writing to the segment. It doesn't know if there is anything reading
that data, or what happens with it. ntpd cannot communicate with
phc2sys over the SHM.

-- 
Miroslav Lichvar



___
Linuxptp-users mailing list
Linuxptp-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-users


Re: [Linuxptp-users] gPTP issues with ntpd

2022-07-21 Thread Miroslav Lichvar
On Wed, Jul 20, 2022 at 05:57:57PM +0200, Jakub Raczyński wrote:
> So this setup seems to be correct and from the phc2sys log I sent previously 
> it seems to be. So it seems that phc2sys is correctly writing timestamps to 
> ntpshm only when it is Slave.

No, that's not correct. Try running the ntpshmmon tool from gpsd to
see that phc2sys is writing new samples in both directions.

> The only problem is caused by ntpd reset - it starts synchronizing to PTP 
> (ntpshm) even if it shouldn't as is it Master.

If you have multiple sources configured for ntpd, it could be
rejecting the SHM as a falseticker when the TAI-UTC correction in
phc2sys flips. On a restart/reset and depending on the polling
intervals, it could temporarily select the SHM source for
synchronization and later reject it again.

Try it with SHM as the only source. That should make it obvious
that this cannot work.

-- 
Miroslav Lichvar



___
Linuxptp-users mailing list
Linuxptp-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-users


Re: [Linuxptp-users] gPTP issues with ntpd

2022-07-20 Thread Miroslav Lichvar
On Wed, Jul 20, 2022 at 03:12:39PM +0200, Jakub Raczyński wrote:
> phc2sys[2031.823]: lan1 sys offset  4870 s0 freq  +0 delay   1875
> phc2sys[2032.824]: lan1 sys offset  4915 s0 freq  +0 delay   1875
> phc2sys[2033.824]: lan1 sys offset  5011 s0 freq  +0 delay   1750
> phc2sys[2034.825]: port 360712.fffe.52efd6-1 changed state
> phc2sys[2034.826]: reconfiguring after port state change
> phc2sys[2034.828]: master clock not ready, waiting...
> phc2sys[2035.828]: port 360712.fffe.52efd6-1 changed state
> phc2sys[2035.830]: reconfiguring after port state change
> phc2sys[2035.831]: selecting CLOCK_REALTIME for synchronization
> phc2sys[2035.832]: selecting lan1 as the master clock
> phc2sys[2035.833]: CLOCK_REALTIME phc offset -5136 s0 freq  +0 delay  
>  1875
> phc2sys[2036.834]: CLOCK_REALTIME phc offset -4435 s0 freq  +0 delay  
>  1875
> 
> So, as mentioned "That is not expected to work" but kinda did or seemed like 
> it. Would need more research and debugging what is actually happening inside 
> both servos.

There is only one SHM segment and it's used by ntpd for
synchronization of the system clock. When phc2sys reverses the
direction, the offset will flip the sign, intending to synchronize the
PHC to the system clock, but ntpd will still be using the data it
receives to synchronize the system clock, which will cause a positive
feedback loop and the clock will be steered away, stepped, or ntpd
will give up depending on its configuration.

-- 
Miroslav Lichvar



___
Linuxptp-users mailing list
Linuxptp-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-users


Re: [Linuxptp-users] gPTP issues with ntpd

2022-07-20 Thread Miroslav Lichvar
On Wed, Jul 20, 2022 at 12:06:43PM +0200, Jakub Raczyński wrote:
>  I was trying to setup gPTP using linuxptp (ptp4l + phc2sys) that would allow 
> two way synchronization using ntpd. Setup without ntpd (synchronizing 
> CLOCK_REALTIME) seems to be working perfectly. 
> However with ntpd is that when in network there is no external gPTP Master 
> available and device does become Master itself it may synchronize itself to 
> its own shm memory. 
> 
> 
>  phc2sys is run using: /usr/sbin/phc2sys -a -r -r -f /etc/ptp4l.cfg -E ntpshm 
> -M 4 

That is not expected to work. phc2sys has only one servo and ntpshm
can be used only in one direction.

You would need a second phc2sys instance with an option to only synchronize
the PHC, when the port is in master state.

As a workaround, you could write a script that would monitor the state
and start/stop phc2sys as needed.

>  While testing devices with gPTP we encountered, in my opinion, quite 
> inconsequential behavior. Using different setups, I set following flags and 
> had following outcome: 
> 
> 
>  gmCapable = 0 , slaveOnly = 0 -> OK 
>  gmCapable = 1 , slaveOnly = 0 -> OK 
>  gmCapable = 0 , slaveOnly = 1 -> Cannot mix 1588 slaveOnly with 802.1AS 
> !gmCapable 
>  gmCapable = 1 , slaveOnly = 1 -> OK 
> 
> 
>  Frankly, I would expect combination of "gmCapable = 1 , slaveOnly = 1" to 
> fail with than "gmCapable = 0 , slaveOnly = 1". 
> 
> 
> 
>  I would like to ask for reasoning behind that combination block and not the 
> other. Since SlaveOnly flag performs as expected, even for gPTP setup. 

I'm not sure. If slaveOnly is 1, the clock will not ever be a
grandmaster, i.e. not try to send sync messages. What would be
different with gmCapable of 0?

-- 
Miroslav Lichvar



___
Linuxptp-users mailing list
Linuxptp-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-users


Re: [Linuxptp-users] Adding software-transmit (SOF_TIMESTAMPING_TX_SOFTWARE) capability to driver

2022-07-20 Thread Miroslav Lichvar
On Tue, Jul 19, 2022 at 09:02:37PM -0700, Richard Cochran wrote:
> > I am not sure how accurate a software timestamp for a wifi device would
> > be, given the potential delay between timestamp and actual transmission.
> 
> WiFi on Linux is never going to support PTP.  The issue is the closed
> source radio firmware.  End of story.

I tested driver TX timestamping in the mt76 driver, where the firmware
is supposed to be very simple, but IIRC it didn't make a noticeable
difference when compared to user-space TX timestamping.

But if there is demand, I think we could see wireless chips with
HW-timestamping support in future. If the stations can hear each
other, maybe it wouldn't even be necessary for the access point to
support PTP, like when using a cheap Ethernet hub instead of expensive
switch with PTP support.

-- 
Miroslav Lichvar



___
Linuxptp-users mailing list
Linuxptp-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-users


Re: [Linuxptp-users] Disabling PTP management messages?

2022-07-18 Thread Miroslav Lichvar
On Mon, Jul 18, 2022 at 08:46:24AM +0200, Marco Davids (SIDN) via 
Linuxptp-users wrote:
> Hi,
> 
> Even though I understand that Linuxptp has not supported many SET and CMD
> PMC-messages yet, I would still like know if there are ways to disable PTP
> managment messages, in order to prevent (rogue) clients from messing things
> up.
> 
> Is this possible?

No, there is no option to disable management messages.

SET and CMD commands are not allowed over network, but that doesn't
prevent rogue clients from pretending to be a better master clock and
take control over other clients.

-- 
Miroslav Lichvar



___
Linuxptp-users mailing list
Linuxptp-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-users


Re: [Linuxptp-users] ptp4l does not return delay response message

2022-07-18 Thread Miroslav Lichvar
On Fri, Jul 15, 2022 at 06:10:57PM +0800, Kevin Choo wrote:
>I am trying to test ptp implementation with ptp4l as the ptp master on a
>Linux pc and another ptp slave on evaluation board. Facing a weird issue
>where the ptp4l in master mode does not return delay response message when
>the slave is sending delay request message.

Does it work with ptp4l as a client?

-- 
Miroslav Lichvar



___
Linuxptp-users mailing list
Linuxptp-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-users


Re: [Linuxptp-users] [Linuxptp-devel] phc2sys struck on "waiting for ptp4l"

2022-07-14 Thread Miroslav Lichvar
On Tue, Jul 12, 2022 at 05:36:42PM +, ramesh t via Linuxptp-devel wrote:
> As part of testing, we are doing disable and enable of PTP on the switch. 
> Sometimes we are observing phc2sys process struck on "Waiting for ptp4l".

> Jun 30 15:56:42  ptp4l: [113418.006] rms    4 max    6 freq  +4822 +/-   6 
> delay   232 +/-   0
> Jun 30 15:56:43  ptp4l: [113419.006] rms    3 max    6 freq  +4817 +/-   5 
> delay   232 +/-   0
> Jun 30 15:56:44  phc2sys: [113419.955] uds: sendto failed: No such file or 
> directory

This looks like something removed the Unix domain socket, possibly a
different ptp4l instance using the same configuration. Are you sure
there is always only one ptp4l running with the same uds_address?

-- 
Miroslav Lichvar



___
Linuxptp-users mailing list
Linuxptp-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-users


  1   2   3   >