Discussion:
[Linuxptp-users] Need help : new to PTP testing
Rayagond Kokatanur
2013-01-25 10:58:39 UTC
Permalink
Hi All,

I am new to PTP implementation and testing.

So far I have done following with the help of Linux doc and browsing (
http://linuxptp.sourceforge.net/),

1. I referred Linux doc and reference driver and implemented PTP V1 and V2
in MAC driver - MAC driver is able to handle PTP packets, it can pass the
transmitted/received packets timestamp value to stack.

2. I am able to write PTP Hardware Clock (PHC) driver and integrate with my
MAC driver - Through PHC driver I have registered all the clock API's like
gettime/settime/adjtime etc to ptp clock driver or ptp stack. My MAC has
internal clock source, so I am registering the PHC driver as part of MAC
driver itself.

3. I build Linux kernel with version 3.1.1 and enabled all the PTP related
kernel configurations like CONFIG_PPS, CONFIG_NETWORK_PHY_TIMESTAMPING and
PTP_1588_CLOCK.

4. After loading MAC driver I can see /dev/ptp0 entry for my PHC driver.

5. For testing PTP, I downloaded the ptp application from - git clone
git://git.code.sf.net/p/linuxptp/code, and compiled the ptp it and
installed in my system. Now I can run the ptp application.

6. I ran following commands ...

$ptp4l -i eth0 -p /dev/ptp0

ie I choose my system ad PTP master and it is sending the SYNC messages and
all.

I am not getting how to use -f option and what is the configuration file
etc.

I don't have clear idea on how to test the PTP, please give me some
suggestions to go ahead.

Thank you all in advance for any help.

---------------
Rayagond
Jacob Keller
2013-01-25 18:56:44 UTC
Permalink
Post by Rayagond Kokatanur
Hi All,
I am new to PTP implementation and testing.
So far I have done following with the help of Linux doc and browsing
(http://linuxptp.sourceforge.net/),
1. I referred Linux doc and reference driver and implemented PTP V1 and
V2 in MAC driver - MAC driver is able to handle PTP packets, it can pass
the transmitted/received packets timestamp value to stack.
2. I am able to write PTP Hardware Clock (PHC) driver and integrate with
my MAC driver - Through PHC driver I have registered all the clock API's
like gettime/settime/adjtime etc to ptp clock driver or ptp stack. My
MAC has internal clock source, so I am registering the PHC driver as
part of MAC driver itself.
3. I build Linux kernel with version 3.1.1 and enabled all the PTP
related kernel configurations like CONFIG_PPS,
CONFIG_NETWORK_PHY_TIMESTAMPING and PTP_1588_CLOCK.
4. After loading MAC driver I can see /dev/ptp0 entry for my PHC driver.
5. For testing PTP, I downloaded the ptp application from - git clone
git://git.code.sf.net/p/linuxptp/code
<http://git.code.sf.net/p/linuxptp/code>, and compiled the ptp it and
installed in my system. Now I can run the ptp application.
6. I ran following commands ...
$ptp4l -i eth0 -p /dev/ptp0
ie I choose my system ad PTP master and it is sending the SYNC messages
and all.
I am not getting how to use -f option and what is the configuration file
etc.
I don't have clear idea on how to test the PTP, please give me some
suggestions to go ahead.
Thank you all in advance for any help.
---------------
Rayagond
Hi Rayagond -

The config file has a lot of fine tuning options that you may (or may
not) need for your part to work, and for fine tuning some settings. I
would suggest viewing the man page which is provided in the source. This
page describes the options available and how to use them.

If your device has a method of externally generating a pulse per second
you can set up a test that helps to compare the calculated offset value
by PTP and the actual jitter of the pulse per second.

You will need two machines, at least one of which has your part, linked
to the other end that has a working PTP implementation, whether that is
your own part, another part, or software timestamping.

For testing purposes I would use the -v option which switches to verbose
mode and prevents the daemon software from backgrounding. This will
allow you to more easily view the output.

I would suggest providing a known working hardware timestamp NIC or
switch or something on the other end of the link in order to test your
part against that.

Hope this helps.

- Jake
Richard Cochran
2013-01-26 07:38:30 UTC
Permalink
Post by Jacob Keller
For testing purposes I would use the -v option which switches to verbose
mode and prevents the daemon software from backgrounding. This will
allow you to more easily view the output.
I changed the -v option to show the version info, just before making
release 1.0. Instead you now use -m and -q.

Otherwise, Jacob's advice is good.

Thanks,
Richard
Keller, Jacob E
2013-01-26 07:53:49 UTC
Permalink
-----Original Message-----
Sent: Friday, January 25, 2013 11:39 PM
To: Keller, Jacob E
Subject: Re: [Linuxptp-users] Need help : new to PTP testing
Post by Jacob Keller
For testing purposes I would use the -v option which switches to
verbose
Post by Jacob Keller
mode and prevents the daemon software from backgrounding. This
will
Post by Jacob Keller
allow you to more easily view the output.
I changed the -v option to show the version info, just before making
release 1.0. Instead you now use -m and -q.
Otherwise, Jacob's advice is good.
Yes I had forgotten :) Thanks

- Jake
Thanks,
Richard
Rayagond Kokatanur
2013-01-28 06:36:32 UTC
Permalink
Thanks Jacob and Richard for your quick help, I will try it and let you
know.
Post by Keller, Jacob E
-----Original Message-----
Sent: Friday, January 25, 2013 11:39 PM
To: Keller, Jacob E
Subject: Re: [Linuxptp-users] Need help : new to PTP testing
Post by Jacob Keller
For testing purposes I would use the -v option which switches to
verbose
Post by Jacob Keller
mode and prevents the daemon software from backgrounding. This
will
Post by Jacob Keller
allow you to more easily view the output.
I changed the -v option to show the version info, just before making
release 1.0. Instead you now use -m and -q.
Otherwise, Jacob's advice is good.
Yes I had forgotten :) Thanks
- Jake
Thanks,
Richard
Richard Cochran
2013-01-26 07:32:45 UTC
Permalink
Post by Rayagond Kokatanur
I am new to PTP implementation and testing.
...
Post by Rayagond Kokatanur
6. I ran following commands ...
Up until this point, you did everything just right.
Post by Rayagond Kokatanur
$ptp4l -i eth0 -p /dev/ptp0
ie I choose my system ad PTP master and it is sending the SYNC messages and
all.
I would do

ptp4l -i eth0 -p /dev/ptp0 -m -q

then you will see all the messages that show the estimated offset from
master. You can also add '-s' to force slave-only mode.
Post by Rayagond Kokatanur
I am not getting how to use -f option and what is the configuration file
etc.
For simple testing, you don't need the configuration file at all.

HTH,
Richard
Continue reading on narkive:
Loading...