* [PATCH] dpaa_eth: copy timestamp fields to new skb in A-050385 workaround
@ 2020-12-01 7:52 Yangbo Lu
2020-12-02 13:17 ` Camelia Alexandra Groza
0 siblings, 1 reply; 3+ messages in thread
From: Yangbo Lu @ 2020-12-01 7:52 UTC (permalink / raw)
To: netdev; +Cc: Yangbo Lu, Madalin Bucur, David S . Miller
The timestamp fields should be copied to new skb too in
A-050385 workaround for later TX timestamping handling.
Fixes: 3c68b8fffb48 ("dpaa_eth: FMan erratum A050385 workaround")
Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
---
drivers/net/ethernet/freescale/dpaa/dpaa_eth.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
index d9c2859..cb7c028 100644
--- a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
+++ b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
@@ -2120,6 +2120,15 @@ 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.
@@ -2127,7 +2136,6 @@ static int dpaa_a050385_wa(struct net_device *net_dev, struct sk_buff **s)
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;
--
2.7.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* RE: [PATCH] dpaa_eth: copy timestamp fields to new skb in A-050385 workaround
2020-12-01 7:52 [PATCH] dpaa_eth: copy timestamp fields to new skb in A-050385 workaround Yangbo Lu
@ 2020-12-02 13:17 ` Camelia Alexandra Groza
2020-12-02 19:52 ` Jakub Kicinski
0 siblings, 1 reply; 3+ messages in thread
From: Camelia Alexandra Groza @ 2020-12-02 13:17 UTC (permalink / raw)
To: Y.b. Lu, netdev; +Cc: Madalin Bucur, David S . Miller
> -----Original Message-----
> From: Yangbo Lu <yangbo.lu@nxp.com>
> Sent: Tuesday, December 1, 2020 09:53
> To: netdev@vger.kernel.org
> Cc: Y.b. Lu <yangbo.lu@nxp.com>; Madalin Bucur
> <madalin.bucur@nxp.com>; David S . Miller <davem@davemloft.net>
> Subject: [PATCH] dpaa_eth: copy timestamp fields to new skb in A-050385
> workaround
>
> The timestamp fields should be copied to new skb too in
> A-050385 workaround for later TX timestamping handling.
>
> Fixes: 3c68b8fffb48 ("dpaa_eth: FMan erratum A050385 workaround")
> Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
> ---
Acked-by: Camelia Groza <camelia.groza@nxp.com>
> drivers/net/ethernet/freescale/dpaa/dpaa_eth.c | 10 +++++++++-
> 1 file changed, 9 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
> b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
> index d9c2859..cb7c028 100644
> --- a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
> +++ b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
> @@ -2120,6 +2120,15 @@ 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.
> @@ -2127,7 +2136,6 @@ static int dpaa_a050385_wa(struct net_device
> *net_dev, struct sk_buff **s)
> 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;
>
> --
> 2.7.4
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] dpaa_eth: copy timestamp fields to new skb in A-050385 workaround
2020-12-02 13:17 ` Camelia Alexandra Groza
@ 2020-12-02 19:52 ` Jakub Kicinski
0 siblings, 0 replies; 3+ messages in thread
From: Jakub Kicinski @ 2020-12-02 19:52 UTC (permalink / raw)
To: Camelia Alexandra Groza; +Cc: Y.b. Lu, netdev, Madalin Bucur, David S . Miller
On Wed, 2 Dec 2020 13:17:46 +0000 Camelia Alexandra Groza wrote:
> > The timestamp fields should be copied to new skb too in
> > A-050385 workaround for later TX timestamping handling.
> >
> > Fixes: 3c68b8fffb48 ("dpaa_eth: FMan erratum A050385 workaround")
> > Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
>
> Acked-by: Camelia Groza <camelia.groza@nxp.com>
Applied, thanks!
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-12-02 19:53 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-01 7:52 [PATCH] dpaa_eth: copy timestamp fields to new skb in A-050385 workaround Yangbo Lu
2020-12-02 13:17 ` Camelia Alexandra Groza
2020-12-02 19:52 ` Jakub Kicinski
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.