octeontx2-pf: Recalculate UDP checksum for ptp 1-step sync packet
authorGeetha sowjanya <gakula@marvell.com>
Wed, 22 Feb 2023 11:36:00 +0000 (17:06 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 11 Mar 2023 12:55:25 +0000 (13:55 +0100)
commite3aa5d1bb1b2bdc6e0649d27b7eaa02d03f5f040
treeea5b814eec5206155f9eb3ae7ec7b89741b34b68
parente11e4d524eba2d3c8fdf897d7ce3853f7573bae9
octeontx2-pf: Recalculate UDP checksum for ptp 1-step sync packet

[ Upstream commit edea0c5a994b7829c9ada8f5bc762c4e32f4f797 ]

When checksum offload is disabled in the driver via ethtool,
the PTP 1-step sync packets contain incorrect checksum, since
the stack calculates the checksum before driver updates
PTP timestamp field in the packet. This results in PTP packets
getting dropped at the other end. This patch fixes the issue by
re-calculating the UDP checksum after updating PTP
timestamp field in the driver.

Fixes: 2958d17a8984 ("octeontx2-pf: Add support for ptp 1-step mode on CN10K silicon")
Signed-off-by: Geetha sowjanya <gakula@marvell.com>
Signed-off-by: Hariprasad Kelam <hkelam@marvell.com>
Signed-off-by: Sunil Kovvuri Goutham <sgoutham@marvell.com>
Signed-off-by: Sai Krishna <saikrishnag@marvell.com>
Link: https://lore.kernel.org/r/20230222113600.1965116-1-saikrishnag@marvell.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/marvell/octeontx2/nic/otx2_txrx.c