]> git.baikalelectronics.ru Git - kernel.git/commit
net: macb: Fix PTP one step sync support
authorHarini Katakam <harini.katakam@xilinx.com>
Wed, 18 May 2022 17:07:56 +0000 (22:37 +0530)
committerJakub Kicinski <kuba@kernel.org>
Thu, 19 May 2022 23:58:16 +0000 (16:58 -0700)
commit0fcca792e5aa272c5b602ddf1db5d1b1724ea4c5
treecd8f827ed7daeed8360d517c1b52efd4de7fd0c5
parent25c183f6835863a5445494d8e7d9c408c9087fe2
net: macb: Fix PTP one step sync support

PTP one step sync packets cannot have CSUM padding and insertion in
SW since time stamp is inserted on the fly by HW.
In addition, ptp4l version 3.0 and above report an error when skb
timestamps are reported for packets that not processed for TX TS
after transmission.
Add a helper to identify PTP one step sync and fix the above two
errors. Add a common mask for PTP header flag field "twoStepflag".
Also reset ptp OSS bit when one step is not selected.

Fixes: dad92ea6c8d8 ("net: macb: Add hardware PTP support")
Fixes: af5d7e7c9a45 ("net: macb: add support for padding and fcs computation")
Signed-off-by: Harini Katakam <harini.katakam@xilinx.com>
Reviewed-by: Radhey Shyam Pandey <radhey.shyam.pandey@xilinx.com>
Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Link: https://lore.kernel.org/r/20220518170756.7752-1-harini.katakam@xilinx.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/cadence/macb_main.c
drivers/net/ethernet/cadence/macb_ptp.c
include/linux/ptp_classify.h