Hi Richard,

>-----Original Message-----
>From: Richard Cochran [mailto:[email protected]]
>Sent: Tuesday, December 09, 2014 9:55 PM
>To: [email protected]
>Subject: [Linuxptp-devel] [PATCH RFC V2 3/4] config: Introduce options for
>correcting transmit and receive delays.

Note that egress and ingress timestamping delays change with link speed. So you 
might want to have a list of delays and apply the right one depending on link 
speed.
Regards,
Christian

>
>Signed-off-by: Richard Cochran <[email protected]>
>---
> config.c    |   12 ++++++++++++
> default.cfg |    2 ++
> ds.h        |    2 ++
> gPTP.cfg    |    2 ++
> ptp4l.8     |   12 ++++++++++++
> ptp4l.c     |    2 ++
> 6 files changed, 32 insertions(+)
>
>diff --git a/config.c b/config.c
>index d5fa378..7679f44 100644
>--- a/config.c
>+++ b/config.c
>@@ -132,6 +132,18 @@ static enum parser_result parse_pod_setting(const
>char *option,
>                       return r;
>               pod->min_neighbor_prop_delay = val;
>
>+      } else if (!strcmp(option, "egressLatency")) {
>+              r = get_ranged_int(value, &val, INT_MIN, INT_MAX);
>+              if (r != PARSED_OK)
>+                      return r;
>+              pod->tx_timestamp_offset = val;
>+
>+      } else if (!strcmp(option, "ingressLatency")) {
>+              r = get_ranged_int(value, &val, INT_MIN, INT_MAX);
>+              if (r != PARSED_OK)
>+                      return r;
>+              pod->rx_timestamp_offset = val;
>+
>       } else if (!strcmp(option, "fault_badpeernet_interval")) {
>               pod->flt_interval_pertype[FT_BAD_PEER_NETWORK].type =
>FTMO_LINEAR_SECONDS;
>               if (!strcasecmp("ASAP", value)) {
>diff --git a/default.cfg b/default.cfg
>index 9e794ba..0e20726 100644
>--- a/default.cfg
>+++ b/default.cfg
>@@ -70,6 +70,8 @@ delay_mechanism              E2E
> time_stamping         hardware
> delay_filter          moving_median
> delay_filter_length   10
>+egressLatency         0
>+ingressLatency                0
> #
> # Clock description
> #
>diff --git a/ds.h b/ds.h
>index ea25fbb..00260ed 100644
>--- a/ds.h
>+++ b/ds.h
>@@ -137,6 +137,8 @@ struct port_defaults {
>       struct fault_interval flt_interval_pertype[FT_CNT];
>       UInteger32 neighborPropDelayThresh; /*nanoseconds*/
>       int min_neighbor_prop_delay; /*nanoseconds*/
>+      int tx_timestamp_offset; /*nanoseconds*/
>+      int rx_timestamp_offset; /*nanoseconds*/
> };
>
> #endif
>diff --git a/gPTP.cfg b/gPTP.cfg
>index e15a05a..689abd8 100644
>--- a/gPTP.cfg
>+++ b/gPTP.cfg
>@@ -69,3 +69,5 @@ delay_mechanism              P2P
> time_stamping         hardware
> delay_filter          moving_median
> delay_filter_length   10
>+egressLatency         0
>+ingressLatency                0
>diff --git a/ptp4l.8 b/ptp4l.8
>index 687beb6..bee42e9 100644
>--- a/ptp4l.8
>+++ b/ptp4l.8
>@@ -205,6 +205,18 @@ The default is moving_median.
> .B delay_filter_length
> The length of the delay filter in samples.
> The default is 10.
>+.TP
>+.B egressLatency
>+Specifies the difference in nanoseconds between the actual transmission
>+time at the reference plane and the reported transmit time stamp. This
>+value will be added to egress time stamps obtained from the hardware.
>+The default is 0.
>+.TP
>+.B ingressLatency
>+Specifies the difference in nanoseconds between the reported receive
>+time stamp and the actual reception time at reference plane. This value
>+will be subtracted from ingress time stamps obtained from the hardware.
>+The default is 0.
>
> .SH PROGRAM AND CLOCK OPTIONS
>
>diff --git a/ptp4l.c b/ptp4l.c
>index 83824f7..c18406f 100644
>--- a/ptp4l.c
>+++ b/ptp4l.c
>@@ -92,6 +92,8 @@ static struct config cfg_settings = {
>               /* Default to very a large neighborPropDelay threshold */
>               .neighborPropDelayThresh = 20000000,
>               .min_neighbor_prop_delay = -20000000,
>+              .tx_timestamp_offset = 0,
>+              .rx_timestamp_offset = 0,
>       },
>
>       .timestamping = TS_HARDWARE,
>--
>1.7.10.4
>
>
>------------------------------------------------------------------------------
>Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
>from Actuate! Instantly Supercharge Your Business Reports and Dashboards
>with Interactivity, Sharing, Native Excel Exports, App Integration & more
>Get technology previously reserved for billion-dollar corporations, FREE
>http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clk
>trk
>_______________________________________________
>Linuxptp-devel mailing list
>[email protected]
>https://lists.sourceforge.net/lists/listinfo/linuxptp-devel

------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk
_______________________________________________
Linuxptp-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linuxptp-devel

Reply via email to