Skip to content

Commit 714cd03

Browse files
christopher-s-hallanguy11
authored andcommitted
igc: increase wait time before retrying PTM
The i225/i226 hardware retries if it receives an inappropriate response from the upstream device. If the device retries too quickly, the root port does not respond. The wait between attempts was reduced from 10us to 1us in commit 6b8aa75 ("igc: Decrease PTM short interval from 10 us to 1 us"), which said: With the 10us interval, we were seeing PTM transactions take around 12us. Hardware team suggested this interval could be lowered to 1us which was confirmed with PCIe sniffer. With the 1us interval, PTM dialogs took around 2us. While a 1us short cycle time was thought to be theoretically sufficient, it turns out in practice it is not quite long enough. It is unclear if the problem is in the root port or an issue in i225/i226. Increase the wait from 1us to 4us. Increasing to 2us appeared to work in practice on the setups we have available. A value of 4us was chosen due to the limited hardware available for testing, with a goal of ensuring we wait long enough without overly penalizing the response time when unnecessary. The issue can be reproduced with the following: $ sudo phc2sys -R 1000 -O 0 -i tsn0 -m Note: 1000 Hz (-R 1000) is unrealistically large, but provides a way to quickly reproduce the issue. PHC2SYS exits with: "ioctl PTP_OFFSET_PRECISE: Connection timed out" when the PTM transaction fails Fixes: 6b8aa75 ("igc: Decrease PTM short interval from 10 us to 1 us") Reviewed-by: Michal Swiatkowski <[email protected]> Tested-by: Mor Bar-Gabay <[email protected]> Tested-by: Avigail Dahan <[email protected]> Signed-off-by: Christopher S M Hall <[email protected]> Reviewed-by: Corinna Vinschen <[email protected]> Signed-off-by: Jacob Keller <[email protected]> Acked-by: Vinicius Costa Gomes <[email protected]> Signed-off-by: Tony Nguyen <[email protected]>
1 parent 8e404ad commit 714cd03

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

drivers/net/ethernet/intel/igc/igc_defines.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -574,7 +574,10 @@
574574
#define IGC_PTM_CTRL_SHRT_CYC(usec) (((usec) & 0x3f) << 2)
575575
#define IGC_PTM_CTRL_PTM_TO(usec) (((usec) & 0xff) << 8)
576576

577-
#define IGC_PTM_SHORT_CYC_DEFAULT 1 /* Default short cycle interval */
577+
/* A short cycle time of 1us theoretically should work, but appears to be too
578+
* short in practice.
579+
*/
580+
#define IGC_PTM_SHORT_CYC_DEFAULT 4 /* Default short cycle interval */
578581
#define IGC_PTM_CYC_TIME_DEFAULT 5 /* Default PTM cycle time */
579582
#define IGC_PTM_TIMEOUT_DEFAULT 255 /* Default timeout for PTM errors */
580583

0 commit comments

Comments
 (0)