Skip to content

Commit

Permalink
dpaa_eth: copy timestamp fields to new skb in A-050385 workaround
Browse files Browse the repository at this point in the history
[ Upstream commit 07500a6 ]

The timestamp fields should be copied to new skb too in
A-050385 workaround for later TX timestamping handling.

Fixes: 3c68b8f ("dpaa_eth: FMan erratum A050385 workaround")
Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
Acked-by: Camelia Groza <camelia.groza@nxp.com>
Link: https://lore.kernel.org/r/20201201075258.1875-1-yangbo.lu@nxp.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
yangbolu1991 authored and gregkh committed Dec 8, 2020
1 parent d9897bb commit 6eb5ed2
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
Original file line number Diff line number Diff line change
Expand Up @@ -2120,14 +2120,22 @@ static int dpaa_a050385_wa(struct net_device *net_dev, struct sk_buff **s)
skb_copy_header(new_skb, skb);
new_skb->dev = skb->dev;

/* Copy relevant timestamp info from the old skb to the new */
if (priv->tx_tstamp) {
skb_shinfo(new_skb)->tx_flags = skb_shinfo(skb)->tx_flags;
skb_shinfo(new_skb)->hwtstamps = skb_shinfo(skb)->hwtstamps;
skb_shinfo(new_skb)->tskey = skb_shinfo(skb)->tskey;
if (skb->sk)
skb_set_owner_w(new_skb, skb->sk);
}

/* We move the headroom when we align it so we have to reset the
* network and transport header offsets relative to the new data
* pointer. The checksum offload relies on these offsets.
*/
skb_set_network_header(new_skb, skb_network_offset(skb));
skb_set_transport_header(new_skb, skb_transport_offset(skb));

/* TODO: does timestamping need the result in the old skb? */
dev_kfree_skb(skb);
*s = new_skb;

Expand Down

0 comments on commit 6eb5ed2

Please sign in to comment.