net: dsa: microchip: ptp: move pdelay_rsp correction field to tail tag

For PDelay_Resp messages we will likely have a negative value in the
correction field. The switch hardware cannot correctly update such
values (produces an off by one error in the UDP checksum), so it must be
moved to the time stamp field in the tail tag. Format of the correction
field is 48 bit ns + 16 bit fractional ns.  After updating the
correction field, clone is no longer required hence it is freed.

Signed-off-by: Christian Eggers <ceggers@arri.de>
Co-developed-by: Arun Ramadoss <arun.ramadoss@microchip.com>
Signed-off-by: Arun Ramadoss <arun.ramadoss@microchip.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Christian Eggers
2023-01-10 14:19:26 +05:30
committed by David S. Miller
parent ab32f56a41
commit a32190b154
3 changed files with 34 additions and 1 deletions

View File

@@ -36,6 +36,8 @@ struct ksz_tagger_data {
struct ksz_skb_cb {
struct sk_buff *clone;
unsigned int ptp_type;
bool update_correction;
u32 tstamp;
};