summaryrefslogtreecommitdiff
path: root/drivers/net/dsa
diff options
context:
space:
mode:
authorChristian Eggers <ceggers@arri.de>2023-01-10 11:49:26 +0300
committerDavid S. Miller <davem@davemloft.net>2023-01-13 11:40:41 +0300
commita32190b154bde4a3bf2fddb9367aec49be09b15d (patch)
treeab0a58fc703fd9bc2ab6a1ebf90076578243e376 /drivers/net/dsa
parentab32f56a4100f879c5064b45c7657bb4be175ac3 (diff)
downloadlinux-a32190b154bde4a3bf2fddb9367aec49be09b15d.tar.xz
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>
Diffstat (limited to 'drivers/net/dsa')
-rw-r--r--drivers/net/dsa/microchip/ksz_ptp.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/net/dsa/microchip/ksz_ptp.c b/drivers/net/dsa/microchip/ksz_ptp.c
index 6edce141cbd7..2a68649943d5 100644
--- a/drivers/net/dsa/microchip/ksz_ptp.c
+++ b/drivers/net/dsa/microchip/ksz_ptp.c
@@ -267,6 +267,10 @@ void ksz_port_txtstamp(struct dsa_switch *ds, int port, struct sk_buff *skb)
switch (ptp_msg_type) {
case PTP_MSGTYPE_PDELAY_REQ:
break;
+ case PTP_MSGTYPE_PDELAY_RESP:
+ KSZ_SKB_CB(skb)->ptp_type = type;
+ KSZ_SKB_CB(skb)->update_correction = true;
+ return;
default:
return;