net: ptp: calculate link delay with right timestamps
At the starting of ptp syncrhonization, there may be not Sync frame TX/RX timestamps in first time link delay calculation. So, need a check for that in case of wrong link delay calculated. Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
This commit is contained in:
parent
a167c2d895
commit
e9efff6e33
1 changed files with 4 additions and 0 deletions
|
@ -556,6 +556,10 @@ void ptp_clock_delay(uint64_t egress, uint64_t ingress)
|
|||
{
|
||||
int64_t delay;
|
||||
|
||||
if (ptp_clk.timestamp.t1 == 0 || ptp_clk.timestamp.t2 == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
ptp_clk.timestamp.t3 = egress;
|
||||
ptp_clk.timestamp.t4 = ingress;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue