瀏覽代碼

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>
WingMan Kwok 7 年之前
父節點
當前提交
4c9a3533fd
共有 1 個文件被更改,包括 6 次插入1 次删除
  1. 6 1
      net/hsr-prp/hsr_prp_forward.c

+ 6 - 1
net/hsr-prp/hsr_prp_forward.c

@@ -491,8 +491,13 @@ static void stripped_skb_get_shared_info(struct sk_buff *skb_stripped,
 	skb_hsr = frame->skb_hsr;
 	skb = skb_stripped;
 
-	if (is_hsr_l2ptp_evt(skb_hsr))
+	if (is_hsr_l2ptp_evt(skb_hsr)) {
+		/* Rx timestamp */
 		skb_hwtstamps(skb)->hwtstamp = skb_hwtstamps(skb_hsr)->hwtstamp;
+		/* Cut-through tx timestamp */
+		skb_redinfo_hwtstamps(skb)->hwtstamp =
+			skb_redinfo_hwtstamps(skb_hsr)->hwtstamp;
+	}
 
 	if (is_hsr_l2ptp(skb_hsr)) {
 		sred = skb_redinfo(skb);