From 78025d556d170cd9192a6d3196b070d68ea9307c Mon Sep 17 00:00:00 2001
From: WingMan Kwok <w-kwok2@ti.com>
Date: Fri, 2 Mar 2018 14:42:46 -0500
Subject: [PATCH] net: hsr: save cut-through tx timestamp of stripped skb

For a received PTP event message, there may be a cut-through tx timestamp
associated with it also. When the skb is stripped of the HSR tag and a
new skb is created, the cut-through tx timestamp is saved in the shared
redundant info area of the newly created skb.

Signed-off-by: WingMan Kwok <w-kwok2@ti.com>
Signed-off-by: Murali Karicheri <m-karicheri2@ti.com>
Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
---
 net/hsr/hsr_forward.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/net/hsr/hsr_forward.c b/net/hsr/hsr_forward.c
index 7a1736f75f2aa..d556f4a3d7a09 100644
--- a/net/hsr/hsr_forward.c
+++ b/net/hsr/hsr_forward.c
@@ -475,6 +475,9 @@ static void stripped_skb_get_shared_info(struct sk_buff *skb_stripped,
 
 	if (is_hsr_l2ptp(skb_hsr)) {
 		skb_hwtstamps(skb)->hwtstamp = skb_hwtstamps(skb_hsr)->hwtstamp;
+		skb_redinfo_hwtstamps(skb)->hwtstamp =
+			skb_redinfo_hwtstamps(skb_hsr)->hwtstamp;
+
 		sred = skb_redinfo(skb);
 		/* assumes no vlan */
 		hsr_ethhdr = (struct hsr_ethhdr *)skb_mac_header(skb_hsr);
-- 
GitLab