Commit Graph

251 Commits (3f764aec6a10bdff0c28a68f28fac06d5755c07f)

Author SHA1 Message Date
Richard Cochran f38338827b Provide the clock with the estimated neighbor rate ratio.
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2012-09-02 14:40:07 +02:00
Richard Cochran db36fb52ca Reset the master/local frequency estimator when changing masters.
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2012-09-02 14:40:06 +02:00
Richard Cochran 1bb8ebbdc5 Invert the frequency ratio estimation.
In 802.1AS-2011 the ratio is defined as master/local, so we should follow
suit.

Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2012-08-31 17:28:14 +02:00
Richard Cochran 829c785414 Rework the frequency ratio estimator to use the tmv functions.
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2012-08-31 17:28:14 +02:00
Richard Cochran 845e947bcb Correct a comment about the frequency ratio estimation.
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2012-08-31 17:28:14 +02:00
Richard Cochran 40dc2e13ef Make the clock release method a public function.
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2012-08-27 21:09:59 +02:00
Richard Cochran 577d34facf Provide a method to release the message cache.
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2012-08-27 21:09:10 +02:00
Richard Cochran 3936316468 Correct the TAI-UTC offset when it is reasonable to do so.
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2012-08-27 18:57:43 +02:00
Richard Cochran 1bfb6fd217 Warn if the master's time properties are suspicious.
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2012-08-26 20:36:43 +02:00
Richard Cochran ce745572b4 Use zero for the UDS port number.
Using 0xffff looks dumb in the log and in the pmc output.

Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2012-08-26 15:09:15 +02:00
Richard Cochran 420d48ce02 Use the ingress port identity for clock management replies.
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2012-08-26 14:39:57 +02:00
Richard Cochran a25c5484d1 Create one special UDS port per clock.
This port is handled a bit differently than the others. Its only purpose
is to accept management messages from the local machine.

Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2012-08-25 11:43:35 +02:00
Richard Cochran 8c0393321e Respond to the current data set management query.
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2012-08-22 07:36:33 +02:00
Richard Cochran 92c6c9149d Maintain the current data set.
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2012-08-22 07:36:33 +02:00
Richard Cochran cd8996ecb9 Estimate the local/master frequency ratio when free running.
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2012-08-21 20:10:35 +02:00
Richard Cochran 83be79df13 Provide a method to report the sync interval to the clock.
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2012-08-21 20:10:35 +02:00
Richard Cochran e4c3fb2432 Free the clock's servo and moving average on destroy.
The destroy method is supposed to undo everything that the create does.

Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2012-08-21 16:22:18 +02:00
Jacob Keller 7a69db2379 ptp4l: Allow per-port customized port defaults
this patch allows each port to maintain its own pod structure since it is only
used in ports. This will allow the user to configure any special settings per
port. It takes a copy of the default pod, and a future patch will allow the
configuration file to set per-port specific changes

-v2
* Minor change to fix merge with previous patch

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
2012-08-21 14:30:54 +02:00
Jacob Keller 64dcf257e3 ptp4l: pass struct interface directly instead of passing it's sub arguments
the port_open function takes a large number of command options, a few of which
are actually all values of struct interface. This patch modifies the port_open
call to take a struct interface value instead of all the other values. This
simplifies the overall work necessary and allows for adding new port
configuration values by appending them to the struct interface

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
2012-08-21 07:28:14 +02:00
Jacob Keller 0499513f1e ptp4l: remove timestamping as a per-port configuration option
The current code for the timestamping mode does not allow interfaces to have
separate timestamping modes. This is (probably) due to hardware timestamping
mode being required on all ports to work properly.

This patch removes the timestamping field in the struct iface, and makes it a
clock variable which is really what the mode does anyways. Ports get passed
the timestamping mode but no longer appear as though they are separate.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
2012-08-21 07:28:14 +02:00
Richard Cochran edfb5fac84 Add storage fields for the path trace list.
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2012-08-10 07:40:21 +02:00
Richard Cochran 353b0a2743 Answer all management requests with 'not supported'
Our management interface is not yet terribly useful,
but at least we are honest about it.

Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2012-08-05 21:46:03 +02:00
Richard Cochran 4f04c4139d Add a functional framework to manage the clock and its ports.
This commit only adds support for forwarding the management messages.
The actual local effects of the management commands still need to be
implemented.

Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2012-08-02 07:08:03 +02:00
Richard Cochran c1973c5e11 Update data sets after loss of foreign master.
If an announce timeout occurs on a port, and no other port is slaved, then
the clock must become a grand master by default.

Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2012-07-08 12:14:28 +02:00
Jacob Keller 0afedd7993 ptp4l: use ethtool operation to double check PHC
If the new ethtool operation is supported, then use it to verify that the PHC
selected by the user is correct. If the user doesn't specify a PHC and ethtool
is supported then automatically select the PHC device.

If the user specifies a PHC device, and the ethtool operation is suppported,
automatically confirm that the PHC device requested is correct. This check is
performed for all ports, in order to verify that a boundary clock setup is
valid.

The check for PHC device validity is not done in the transport because the
only thing necessary for performing the check is the port name. Handled this
in the port_open code instead.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
2012-05-10 06:53:15 +02:00
Richard Cochran b35a45d1a4 Add a command line option to select the peer delay mechanism.
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2012-04-05 17:48:59 +02:00
Richard Cochran 806d1e9b77 Add a clock method to accept a peer delay estimate from a slave port.
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2012-04-05 15:03:51 +02:00
Richard Cochran f2ffeae0f4 Automatically clear any port fault after fifteen seconds.
The current port code is very defensive. As the code now stands, we throw
a fault whenever we cannot send or receive a packet. Even a downed link
on an interface will cause a port fault.

This commit adds a very simple minded way of clearing the faults. We just
try to enable the port again after waiting a bit.

Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2012-03-24 12:46:24 +01:00
Richard Cochran 0ca8143da5 Remove a useless variable from the file descriptor array data type.
It was a cute idea to have the raw Ethernet layer use just one socket,
but it ended up not working on some specific PTP time stamping hardware.

Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2012-03-21 13:55:56 +01:00
Richard Cochran 39b10a5a16 Add a method to remove a port from the clock's polling array.
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2012-03-21 13:08:09 +01:00
Richard Cochran 2ff091b14b Throw a fault event if the BMC algorithm fails.
That makes more sense than re-initializing, perhaps.

Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2012-03-21 12:20:45 +01:00
Richard Cochran 7421e74aca Clear out saved time stamps after setting the clock.
When we create a discontinuity in the clock time, we must avoid mixing
local time stamps from before and after the jump.

Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2012-03-11 10:58:24 +01:00
Richard Cochran 2fcac204de Do not calculate the path delay without valid sync time stamps.
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2012-03-11 10:52:01 +01:00
Richard Cochran 6daff667c5 Initialize the time properties data set.
We can reuse the same function that sets the data sets in case of
becoming grand master.

Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2012-02-26 18:03:16 +01:00
Richard Cochran 43bd313eb1 Go ahead and use a negative path delay estimate.
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2012-01-21 15:24:15 +01:00
Richard Cochran 222c9bb62b Fix the port finite state machine.
The state machine needs to know whether a new master has just been
selected in order to choose between the slave and uncalibrated states.

Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2012-01-07 08:07:56 +01:00
Richard Cochran 335100c1a6 Differentiate the BMC related logging from the synchronization logging.
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2012-01-07 08:07:56 +01:00
Richard Cochran a442a928f8 Fix typo in the initial priority field of the parent data set.
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2012-01-07 08:07:56 +01:00
Richard Cochran 59163df8b1 Make use of the configuration file for the port data set.
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2012-01-07 08:07:55 +01:00
Richard Cochran f135133a88 Print the synchronization statistics at the information level.
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2012-01-07 08:07:55 +01:00
Richard Cochran 0536aa7413 Issue a warning when the path delay turns out negative.
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2012-01-07 08:07:55 +01:00
Richard Cochran 7dbdf2985c Provide methods to obtain a clock's parent and time properties data sets.
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2012-01-07 08:07:54 +01:00
Richard Cochran 3481c99c70 Add an access method for a clock's currentDS.stepsRemoved.
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2012-01-07 08:07:54 +01:00
Richard Cochran b76c4e108f Introduce an event recommending the grand master state.
We already have a grand master state. Adding this event will simplify the
overall logic, since it will avoid the silly requirement to set the
qualification timeout to zero when entering the grand master state.

Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2012-01-07 08:07:54 +01:00
Richard Cochran 10753faccf Implement the synchronization events.
This will allow a port to get from the uncalibrated into the slave state.

Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2012-01-07 08:07:54 +01:00
Richard Cochran ecf959ce3d Reject negative path delay.
If the path delay comes out negative, then something is amiss. In this
case, we just print a warning and ignore the path delay estimate.

Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2011-12-13 05:30:45 +01:00
Richard Cochran 87e61f9770 Let the clock servo know about the expected time stamp quality.
If software time stamping is to be used, then the servo will want to
have appropriate filtering.

Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2011-12-13 04:57:28 +01:00
Richard Cochran 56a5adc1cc Smooth the path delay estimate with a moving average.
This is really just a first attempt using a hard coded length. Probably
it will be necessary to let the length be configurable and/or adaptable.

Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2011-11-27 14:24:03 +01:00
Richard Cochran 68aea3058c Use the timeout table for the delay request messages.
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2011-11-27 14:24:03 +01:00
Richard Cochran ebd353aff6 Link it all together, but in slave-only mode.
Since the master implementation is still lacking, we will just keep
the slave-only flag hard coded for now.

Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2011-11-13 12:39:49 +01:00
Richard Cochran 49cd10e678 Implement the PTP clock.
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2011-11-12 18:59:13 +01:00