cd4f6f422baf7cf5fc8ea3dee4ccebc404d5af9d
[openwrt/openwrt.git] / target / linux / layerscape / patches-5.4 / 701-net-0118-dpaa_eth-ERR010022-preserve-timestamping.patch
1 From 2039a9ff462d50251fd800ce4418f76230373783 Mon Sep 17 00:00:00 2001
2 From: Camelia Groza <camelia.groza@nxp.com>
3 Date: Mon, 22 Jul 2019 14:50:36 +0300
4 Subject: [PATCH] dpaa_eth: ERR010022: preserve timestamping
5
6 Maintain all timestamping fields when copying the skb.
7
8 Signed-off-by: Camelia Groza <camelia.groza@nxp.com>
9 Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
10 ---
11 drivers/net/ethernet/freescale/dpaa/dpaa_eth.c | 9 +++++++++
12 1 file changed, 9 insertions(+)
13
14 --- a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
15 +++ b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
16 @@ -2196,6 +2196,15 @@ static struct sk_buff *dpaa_errata_a0100
17 }
18 skb_copy_header(nskb, skb);
19
20 + /* Copy relevant timestamp info from the old skb to the new */
21 + if (priv->tx_tstamp) {
22 + skb_shinfo(nskb)->tx_flags = skb_shinfo(skb)->tx_flags;
23 + skb_shinfo(nskb)->hwtstamps = skb_shinfo(skb)->hwtstamps;
24 + skb_shinfo(nskb)->tskey = skb_shinfo(skb)->tskey;
25 + if (skb->sk)
26 + skb_set_owner_w(nskb, skb->sk);
27 + }
28 +
29 /* We move the headroom when we align it so we have to reset the
30 * network and transport header offsets relative to the new data
31 * pointer. The checksum offload relies on these offsets.