As some PHC hardware/drivers don't provide PPS, it may be useful to keep the
system clock synchronized to PHC via clock_gettime(). While the precision
of the clock is only in microsecond range, the error seems to be quite stable.
The -d parameter now can be omitted if -s is provided.
Signed-off-by: Miroslav Lichvar <mlichvar@redhat.com>
This fixes the following issue reported by valgrind, which occurs
after a port disable/initialize subsequent to having entered slave
mode.
==10651== Invalid read of size 4
==10651== at 0x804E6E2: fc_clear (port.c:175)
==10651== by 0x805132F: port_event (port.c:1352)
==10651== by 0x804B383: clock_poll (clock.c:597)
==10651== by 0x80498AE: main (ptp4l.c:278)
==10651== Address 0x41cba60 is 16 bytes inside a block of size 60 free'd
==10651== at 0x4023B6A: free (vg_replace_malloc.c:366)
==10651== by 0x804EB09: free_foreign_masters (port.c:287)
==10651== by 0x804FB14: port_disable (port.c:722)
==10651== by 0x8051228: port_dispatch (port.c:1298)
==10651== by 0x804B3C6: clock_poll (clock.c:602)
==10651== by 0x80498AE: main (ptp4l.c:278)
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
By not touching the event descriptor, uds is leaving the value as zero,
resulting in polling on stdin.
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
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>
If the kernel supports the ioctl, but the driver does not (like igb in
kernel version 3.5), then ptp4l will incorrectly choose the system clock.
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
The power profile requires using VLAN priority tagged packets. The tags
may or may not reach the application. This commit adds code to handle the
tags in the case that they do appear.
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
Update the configuration files for gPTP and default so that they show more of
the options as well as use suitable defaults for each style.
-v2
* Add [global] to gPTP.cfg
[ RC - also add logging_level, verbose, and use_syslog
- use time_stamping, not timestamping ]
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
this patch enables the configuration file to define per-port specific
configuration options via the use of simple INI style syntax with headings for
each port created via [device_name] syntax
[ RC - correct scanning of the port string
- remove '=' from scan format string ]
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
This patch creates a global heading for an INI style configuration file. The
parser allows the default state to be global without the header as well as to
use global. A future patch will enable per-port configuration settings.
-v2
* Forgot a "\n" in the string comparison so that global mode wasn't recognized
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
this patch causes interfaces to be built after the options have finished
scanning rather than during option parsing. This removes the ability to
specify on the command line separate transport, or dm modes for each port.
Instead this functionality will be added in a follow-on patch via the
configuration file
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
This patch moves the call to read the configuration file until just after
the options have finished parsing. This is for future patches that will allow
configuration file to enable ports with specific settings
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
this patch extracts the pod parser from the scan_line function in order to
simplify the code for future patches
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
This patch adds a flag field for setting overflag flags so that command line
options override any value in the configuration file. This will be done by
ensuring the flags set whether the config parser accepts the values specified.
This patch also streamlines the handling for the slave only command line
option, as it no longer needs special treatment.
-v2
* Minor change to fix merge with previous patch
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>