mediatek: Add support for Xiaomi Redmi Router AX6S
[openwrt/staging/mkresin.git] / target / linux / layerscape / patches-5.4 / 701-net-0063-sdk_dpaa-propagate-the-skb-ownership-information.patch
1 From 1a5fe4c83c7ba997a7fc433fcfc4818d48689ecc Mon Sep 17 00:00:00 2001
2 From: Madalin Bucur <madalin.bucur@nxp.com>
3 Date: Wed, 25 Apr 2018 18:49:32 +0300
4 Subject: [PATCH] sdk_dpaa: propagate the skb ownership information
5
6 Some skbs on the Tx path may be reallocated by the driver
7 due to insufficient headroom, in which case the socket
8 value gets lost.
9
10 Make sure we propagate the skb ownership information to the
11 new skb, since it's needed by the Tx timestamp function in
12 the kernel.
13
14 Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com>
15 Signed-off-by: Madalin Bucur <madalin.bucur@nxp.com>
16 ---
17 drivers/net/ethernet/freescale/sdk_dpaa/dpaa_eth_sg.c | 5 +++++
18 1 file changed, 5 insertions(+)
19
20 --- a/drivers/net/ethernet/freescale/sdk_dpaa/dpaa_eth_sg.c
21 +++ b/drivers/net/ethernet/freescale/sdk_dpaa/dpaa_eth_sg.c
22 @@ -1113,6 +1113,11 @@ int __hot dpa_tx_extended(struct sk_buff
23 percpu_stats->tx_errors++;
24 return NETDEV_TX_OK;
25 }
26 +
27 + /* propagate the skb ownership information */
28 + if (skb->sk)
29 + skb_set_owner_w(skb_new, skb->sk);
30 +
31 dev_kfree_skb(skb);
32 skb = skb_new;
33 }