blob: f906dc977149fc841b0521d3f2902623b854a421 [file] [log] [blame]
b.liue9582032025-04-17 19:18:16 +08001From 1a5fe4c83c7ba997a7fc433fcfc4818d48689ecc Mon Sep 17 00:00:00 2001
2From: Madalin Bucur <madalin.bucur@nxp.com>
3Date: Wed, 25 Apr 2018 18:49:32 +0300
4Subject: [PATCH] sdk_dpaa: propagate the skb ownership information
5
6Some skbs on the Tx path may be reallocated by the driver
7due to insufficient headroom, in which case the socket
8value gets lost.
9
10Make sure we propagate the skb ownership information to the
11new skb, since it's needed by the Tx timestamp function in
12the kernel.
13
14Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com>
15Signed-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 }