[Linuxptp-devel] [RFC Patch 0/2] Fix link down/up to continue using phc_index set from command line -p option.

2021-01-06 Thread vincent.cheng.xh
From: Vincent Cheng The command line "-p" option is used to assign the port's phc_index. If the port link goes down and then up, the port reverts to using the phc_index associated with the network interface instead of the phc clock provided by the "-p" option. Add debug code to port.c to illust

[Linuxptp-devel] [RFC Patch 2/2] port: Fix link down/up to continue using phc_index set from command line -p option.

2021-01-06 Thread vincent.cheng.xh
From: Vincent Cheng In the scenario where a port link goes down and up, current code checks the port's phc_index against the interface's phc_index and if they are different will set the port phc_index to the interface phc_index. If the phc_index was initially set by the command line -p option, t

[Linuxptp-devel] [RFC Patch 1/2] port: Add phc_from_cmdline to indicate the phc index was from the command line.

2021-01-06 Thread vincent.cheng.xh
From: Vincent Cheng Signed-off-by: Vincent Cheng --- port_private.h | 1 + 1 file changed, 1 insertion(+) diff --git a/port_private.h b/port_private.h index fcabaa6..6e40e15 100644 --- a/port_private.h +++ b/port_private.h @@ -69,6 +69,7 @@ struct port { struct fdarray fda; int

[Linuxptp-devel] [RFC PATCH v2 0/1] Fix link down/up to continue using phc_index set from command line -p option.

2021-01-08 Thread vincent.cheng.xh
From: Vincent Cheng * Changed in v2: - Squash patch 1 and patch 2 together - On link restore, display same warning message from start-up about the PHC index not matching the PHC index associated with the network interface The command line "-p" option is used to assign the port's phc_ind

[Linuxptp-devel] [RFC PATCH v2 1/1] port: Fix link down/up to continue using phc_index set from command line -p option.

2021-01-08 Thread vincent.cheng.xh
From: Vincent Cheng In the scenario where a port link goes down and up, current code checks the port's phc_index against the interface's phc_index and if they are different will set the port phc_index to the interface phc_index. If the phc_index was initially set by the command line -p option, t

[Linuxptp-devel] [PATCH 0/1] clock: Introduce step_window to free run x seconds after a clock step.

2021-02-01 Thread vincent.cheng.xh
From: Vincent Cheng When clock stepping is unable to happen instantaneously the subsequent timestamps after a clock step does not reflect the step result and undesired clock freq and clock step adjustments will occur. When using ts2phc to synchronize timestamping clock using external 1 PPS,

[Linuxptp-devel] [PATCH 1/1] clock: Introduce step_window to free run x seconds after a clock step.

2021-02-01 Thread vincent.cheng.xh
From: Vincent Cheng When clock stepping is unable to happen instantaneously the subsequent timestamps after a clock step does not reflect the step result and undesired clock freq and step adjustments will occur. When using ts2phc to synchronize timestamping clock using external 1 PPS, it could t

[Linuxptp-devel] [PATCH v2 0/1] clock: Introduce step_window to free run n Sync events after a clock step.

2021-02-13 Thread vincent.cheng.xh
From: Vincent Cheng When clock stepping is unable to happen instantaneously the subsequent timestamps after a clock step does not reflect the step result and undesired clock freq and clock steps would occur. When using ts2phc to synchronize timestamping clock using external 1 PPS, it could take

[Linuxptp-devel] [PATCH v2 1/1] clock: Introduce step_window to free run x Sync events after a clock step.

2021-02-13 Thread vincent.cheng.xh
From: Vincent Cheng When clock stepping is unable to happen instantaneously the subsequent timestamps after a clock step does not reflect the step result and undesired clock freq and step adjustments will occur. When using ts2phc to synchronize timestamping clock using external 1 PPS, it could t

[Linuxptp-devel] [PATCH v3 0/1] clock: Introduce step_window to free run x Sync events after a clock step.

2021-02-14 Thread vincent.cheng.xh
From: Vincent Cheng When clock stepping is unable to happen instantaneously the subsequent timestamps after a clock step does not reflect the step result and undesired clock freq and clock steps would occur. When using ts2phc to synchronize timestamping clock using external 1 PPS, it could take

[Linuxptp-devel] [PATCH v3 1/1] clock: Introduce step_window to free run x Sync events after after a clock step.

2021-02-14 Thread vincent.cheng.xh
From: Vincent Cheng When clock stepping is unable to happen instantaneously the subsequent timestamps after a clock step does not reflect the step result and undesired clock freq and step adjustments will occur. When using ts2phc to synchronize timestamping clock using external 1 PPS, it could t

[Linuxptp-devel] [PATCH v4 0/1] clock: Introduce step_window to free run x Sync events after a clock step.

2021-02-15 Thread vincent.cheng.xh
From: Vincent Cheng When clock stepping is unable to happen instantaneously the subsequent timestamps after a clock step does not reflect the step result and undesired clock freq and clock steps would occur. When using ts2phc to synchronize timestamping clock using external 1 PPS, it could take

[Linuxptp-devel] [PATCH v4 1/1] clock: Introduce step_window to free run x Sync events after a clock step.

2021-02-15 Thread vincent.cheng.xh
From: Vincent Cheng When clock stepping is unable to happen instantaneously the subsequent timestamps after a clock step does not reflect the step result and undesired clock freq and step adjustments will occur. When using ts2phc to synchronize timestamping clock using external 1 PPS, it could t

[Linuxptp-devel] [PATCH] port: Cancel unicast service when closing port.

2022-03-12 Thread vincent.cheng.xh
From: Vincent Cheng ptp4l currently does not cancel unicast service on program exit. This causes problems for subsequent ptp4l session that is using different masters. Below example has debug statements to print out announce master address and received packet address. Start unicast slave sess

[Linuxptp-devel] [PATCH v2 4/4] port: cancel unicast transmission when closing port.

2022-03-13 Thread vincent.cheng.xh
From: Vincent Cheng Signed-off-by: Vincent Cheng --- port.c | 16 1 file changed, 16 insertions(+) diff --git a/port.c b/port.c index 0169161..1480630 100644 --- a/port.c +++ b/port.c @@ -167,6 +167,21 @@ static int msg_source_equal(struct ptp_message *m1, struct foreign_cloc

[Linuxptp-devel] [PATCH v2 1/4] unicast: Add support to check if message was received from an entry in the unicast master table.

2022-03-13 Thread vincent.cheng.xh
From: Vincent Cheng Signed-off-by: Vincent Cheng --- unicast_client.c | 16 unicast_client.h | 11 +++ 2 files changed, 27 insertions(+) diff --git a/unicast_client.c b/unicast_client.c index 87d8471..4d6386e 100644 --- a/unicast_client.c +++ b/unicast_client.c @@ -547

[Linuxptp-devel] [PATCH v2 0/4] port: Cancel unicast service when closing port.

2022-03-13 Thread vincent.cheng.xh
From: Vincent Cheng ptp4l currently does not cancel unicast service on program exit. This causes problems for subsequent ptp4l session that is using different masters. Below example has debug statements to print out announce master address and received packet address. Start unicast slave sess

[Linuxptp-devel] [PATCH v2 3/4] port: unicast client - do not add master to foreign master table if not in the unicast master table.

2022-03-13 Thread vincent.cheng.xh
From: Vincent Cheng Signed-off-by: Vincent Cheng --- port.c | 28 +++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/port.c b/port.c index f2b666c..0169161 100644 --- a/port.c +++ b/port.c @@ -167,6 +167,27 @@ static int msg_source_equal(struct ptp_messag

[Linuxptp-devel] [PATCH v2 2/4] unicast: Add support to send CANCEL_UNICAST_TRANSMISSION TLVs.

2022-03-13 Thread vincent.cheng.xh
From: Vincent Cheng Signed-off-by: Vincent Cheng --- unicast_client.c | 50 unicast_client.h | 8 2 files changed, 58 insertions(+) diff --git a/unicast_client.c b/unicast_client.c index 4d6386e..7688814 100644 --- a/unicast_client.c +

[Linuxptp-devel] [PATCH v3 1/4] unicast: Add support to check if message was received from an entry in the unicast master table.

2022-03-19 Thread vincent.cheng.xh
From: Vincent Cheng Signed-off-by: Vincent Cheng v1->v2: new v2->v3: unicast_client_unicast_master_table_received() to unicast_client_msg_is_from_master_table_entry() Code clarity - add separate variable set to 1 instead of depending on STAILQ behavior. --- unicast_client.c | 18

[Linuxptp-devel] [PATCH v3 3/4] port: unicast client - do not add master to foreign master table if not in the unicast master table.

2022-03-19 Thread vincent.cheng.xh
From: Vincent Cheng Signed-off-by: Vincent Cheng Reviewed-by: Jacob Keller v1->v2: new v2->v3: Remove unrelated white space change. --- port.c | 26 ++ 1 file changed, 26 insertions(+) diff --git a/port.c b/port.c index f2b666c..6e0fdda 100644 --- a/port.c +++ b/port.

[Linuxptp-devel] [PATCH v3 4/4] port: cancel unicast transmission when closing port.

2022-03-19 Thread vincent.cheng.xh
From: Vincent Cheng Signed-off-by: Vincent Cheng Reviewed-by: Jacob Keller --- port.c | 16 1 file changed, 16 insertions(+) diff --git a/port.c b/port.c index 6e0fdda..d9dac38 100644 --- a/port.c +++ b/port.c @@ -167,6 +167,21 @@ static int msg_source_equal(struct ptp_messag

[Linuxptp-devel] [PATCH v3 0/4] port: Cancel unicast service when closing port.

2022-03-19 Thread vincent.cheng.xh
From: Vincent Cheng ptp4l currently does not cancel unicast service on program exit. This causes problems for subsequent ptp4l session that is using different masters. Below example has debug statements to print out announce master address and received packet address. Start unicast slave sess

[Linuxptp-devel] [PATCH v3 2/4] unicast: Add support to send CANCEL_UNICAST_TRANSMISSION TLVs.

2022-03-19 Thread vincent.cheng.xh
From: Vincent Cheng Signed-off-by: Vincent Cheng Reviewed-by: Jacob Keller --- unicast_client.c | 50 unicast_client.h | 8 2 files changed, 58 insertions(+) diff --git a/unicast_client.c b/unicast_client.c index 61a4b94..8ebe06f 1006

[Linuxptp-devel] [PATCH 1/1] clock: Fix stale clock parent pid usage after best master change

2022-12-02 Thread vincent.cheng.xh
From: Vincent Cheng In handle_state_decision_event(), the update of the clock's parent pid after best master change is non-deterministic. It depends on the port processing order and bmc_state_decision() results. Subsequent call to unicast_client_state_changed() via port_dispatch() may use stale

[Linuxptp-devel] [PATCH 0/1] Unselected master port may unintentionally continue to request announce/sync/delay_resp packets

2022-12-02 Thread vincent.cheng.xh
From: Vincent Cheng Problem === Unselected master port may unintentionally continue to request announce/sync/delay_resp packets. Expecting port with unselected master to only maintain announce messages. Setup = Client running with unicast mode and 2 ports, each port has single entry

[Linuxptp-devel] [PATCH v2 1/1] clock: Fix stale clock parent pid usage after best master change

2022-12-08 Thread vincent.cheng.xh
From: Vincent Cheng Signed-off-by: Vincent Cheng --- clock.c| 6 ++ port.c | 12 ++-- port.h | 7 +++ port_private.h | 1 + 4 files changed, 24 insertions(+), 2 deletions(-) diff --git a/clock.c b/clock.c index 134c7c3..a68a732 100644 --- a/clock.c ++

[Linuxptp-devel] [PATCH v2 0/1] Unselected master port may unintentionally continue to request announce/sync/delay_resp packets

2022-12-08 Thread vincent.cheng.xh
From: Vincent Cheng Problem === Unselected master port may unintentionally continue to request announce/sync/delay_resp packets. Expecting port with unselected master to only maintain announce messages. Setup = Client running with unicast mode and 2 ports, each port has single entry

[Linuxptp-devel] [PATCH v3 1/1] clock: Fix stale clock parent pid usage after best master change

2022-12-13 Thread vincent.cheng.xh
From: Vincent Cheng Problem === Unselected master port may unintentionally continue to request announce/sync/delay_resp packets. Expecting port with unselected master to only maintain announce messages. Cause = In handle_state_decision_event() loop, the update of the clock's parent pid

[Linuxptp-devel] [PATCH v3 0/1] Unselected master port may unintentionally continue to request announce/sync/delay_resp packets

2022-12-13 Thread vincent.cheng.xh
From: Vincent Cheng Problem === Unselected master port may unintentionally continue to request announce/sync/delay_resp packets. Expecting port with unselected master to only maintain announce messages. Setup = Client running with unicast mode and 2 ports, each port has single entry