|
|
ae5d40 |
commit 1a2dfe9b00b79a59acf905476bbc33c74d5770a3
|
|
|
ae5d40 |
Author: Jacob Keller <jacob.e.keller@intel.com>
|
|
|
ae5d40 |
Date: Thu Jul 8 12:59:30 2021 -0700
|
|
|
ae5d40 |
|
|
|
ae5d40 |
Increase the default tx_timestamp_timeout to 10
|
|
|
ae5d40 |
|
|
|
ae5d40 |
The tx_timestamp_timeout configuration defines the number of
|
|
|
ae5d40 |
milliseconds to wait for a Tx timestamp from the kernel stack. This
|
|
|
ae5d40 |
delay is necessary as Tx timestamps are captured after a packet is sent
|
|
|
ae5d40 |
and reported back via the socket error queue.
|
|
|
ae5d40 |
|
|
|
ae5d40 |
The current default is to poll for up to 1 millisecond. In practice, it
|
|
|
ae5d40 |
turns out that this is not always enough time for hardware and software
|
|
|
ae5d40 |
to capture the timestamp and report it back. Some hardware designs
|
|
|
ae5d40 |
require reading timestamps over registers or other slow mechanisms.
|
|
|
ae5d40 |
|
|
|
ae5d40 |
This extra delay results in the timestamp not being sent back to
|
|
|
ae5d40 |
userspace within the default 1 millisecond polling time. If that occurs
|
|
|
ae5d40 |
the following can be seen from ptp4l:
|
|
|
ae5d40 |
|
|
|
ae5d40 |
ptp4l[4756.840]: timed out while polling for tx timestamp
|
|
|
ae5d40 |
ptp4l[4756.840]: increasing tx_timestamp_timeout may correct this issue,
|
|
|
ae5d40 |
but it is likely caused by a driver bug
|
|
|
ae5d40 |
ptp4l[4756.840]: port 1 (p2p1): send sync failed
|
|
|
ae5d40 |
ptp4l[4756.840]: port 1 (p2p1): MASTER to FAULTY on FAULT_DETECTED
|
|
|
ae5d40 |
(FT_UNSPECIFIED)
|
|
|
ae5d40 |
|
|
|
ae5d40 |
This can confuse users because it implies this is a bug, when the
|
|
|
ae5d40 |
correct solution in many cases is to just increase the timeout to
|
|
|
ae5d40 |
a slightly higher value.
|
|
|
ae5d40 |
|
|
|
ae5d40 |
Since we know this is a problem for many drivers and hardware designs,
|
|
|
ae5d40 |
lets increase the default timeout.
|
|
|
ae5d40 |
|
|
|
ae5d40 |
Note that a longer timeout should not affect setups which return the
|
|
|
ae5d40 |
timestamp quickly. On modern kernels, the poll() call will return once
|
|
|
ae5d40 |
the timestamp is reported back to the socket error queue. (On old
|
|
|
ae5d40 |
kernels around the 3.x era the poll will sleep for the full duration
|
|
|
ae5d40 |
before reporting the timestamp, but this is now quite an old kernel
|
|
|
ae5d40 |
release).
|
|
|
ae5d40 |
|
|
|
ae5d40 |
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
|
|
|
ae5d40 |
|
|
|
ae5d40 |
diff --git a/config.c b/config.c
|
|
|
ae5d40 |
index 760b395..03d981e 100644
|
|
|
ae5d40 |
--- a/config.c
|
|
|
ae5d40 |
+++ b/config.c
|
|
|
ae5d40 |
@@ -324,7 +324,7 @@ struct config_item config_tab[] = {
|
|
|
ae5d40 |
GLOB_ITEM_INT("ts2phc.pulsewidth", 500000000, 1000000, 999000000),
|
|
|
ae5d40 |
PORT_ITEM_ENU("tsproc_mode", TSPROC_FILTER, tsproc_enu),
|
|
|
ae5d40 |
GLOB_ITEM_INT("twoStepFlag", 1, 0, 1),
|
|
|
ae5d40 |
- GLOB_ITEM_INT("tx_timestamp_timeout", 1, 1, INT_MAX),
|
|
|
ae5d40 |
+ GLOB_ITEM_INT("tx_timestamp_timeout", 10, 1, INT_MAX),
|
|
|
ae5d40 |
PORT_ITEM_INT("udp_ttl", 1, 1, 255),
|
|
|
ae5d40 |
PORT_ITEM_INT("udp6_scope", 0x0E, 0x00, 0x0F),
|
|
|
ae5d40 |
GLOB_ITEM_STR("uds_address", "/var/run/ptp4l"),
|
|
|
ae5d40 |
diff --git a/configs/default.cfg b/configs/default.cfg
|
|
|
ae5d40 |
index 64ef3bd..d615610 100644
|
|
|
ae5d40 |
--- a/configs/default.cfg
|
|
|
ae5d40 |
+++ b/configs/default.cfg
|
|
|
ae5d40 |
@@ -51,7 +51,7 @@ hybrid_e2e 0
|
|
|
ae5d40 |
inhibit_multicast_service 0
|
|
|
ae5d40 |
net_sync_monitor 0
|
|
|
ae5d40 |
tc_spanning_tree 0
|
|
|
ae5d40 |
-tx_timestamp_timeout 1
|
|
|
ae5d40 |
+tx_timestamp_timeout 10
|
|
|
ae5d40 |
unicast_listen 0
|
|
|
ae5d40 |
unicast_master_table 0
|
|
|
ae5d40 |
unicast_req_duration 3600
|
|
|
ae5d40 |
diff --git a/ptp4l.8 b/ptp4l.8
|
|
|
ae5d40 |
index fe9e150..7ca3474 100644
|
|
|
ae5d40 |
--- a/ptp4l.8
|
|
|
ae5d40 |
+++ b/ptp4l.8
|
|
|
ae5d40 |
@@ -496,7 +496,7 @@ switches all implement this option together with the BMCA.
|
|
|
ae5d40 |
.B tx_timestamp_timeout
|
|
|
ae5d40 |
The number of milliseconds to poll waiting for the tx time stamp from the kernel
|
|
|
ae5d40 |
when a message has recently been sent.
|
|
|
ae5d40 |
-The default is 1.
|
|
|
ae5d40 |
+The default is 10.
|
|
|
ae5d40 |
.TP
|
|
|
ae5d40 |
.B check_fup_sync
|
|
|
ae5d40 |
Because of packet reordering that can occur in the network, in the
|