All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net] net-gro: reset skb->truesize in napi_reuse_skb()
@ 2014-04-03 16:28 Eric Dumazet
  2014-04-03 20:18 ` David Miller
  0 siblings, 1 reply; 3+ messages in thread
From: Eric Dumazet @ 2014-04-03 16:28 UTC (permalink / raw)
  To: David Miller; +Cc: netdev

From: Eric Dumazet <edumazet@google.com>

Recycling skb always had been very tough...

This time it appears GRO layer can accumulate skb->truesize
adjustments made by drivers when they attach a fragment to skb.

skb_gro_receive() can only subtract from skb->truesize the used part
of a fragment.

I spotted this problem seeing TcpExtPruneCalled and
TcpExtTCPRcvCollapsed that were unexpected with a recent kernel, where
TCP receive window should be sized properly to accept traffic coming
from a driver not overshooting skb->truesize.

Signed-off-by: Eric Dumazet <edumazet@google.com>
---
 net/core/dev.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/net/core/dev.c b/net/core/dev.c
index 757063420ce0..8770984e1ddc 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -4043,6 +4043,7 @@ static void napi_reuse_skb(struct napi_struct *napi, struct sk_buff *skb)
 	skb->vlan_tci = 0;
 	skb->dev = napi->dev;
 	skb->skb_iif = 0;
+	skb->truesize = SKB_TRUESIZE(skb_end_offset(skb));
 
 	napi->skb = skb;
 }

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH net] net-gro: reset skb->truesize in napi_reuse_skb()
  2014-04-03 16:28 [PATCH net] net-gro: reset skb->truesize in napi_reuse_skb() Eric Dumazet
@ 2014-04-03 20:18 ` David Miller
  2014-05-16 21:27   ` Cong Wang
  0 siblings, 1 reply; 3+ messages in thread
From: David Miller @ 2014-04-03 20:18 UTC (permalink / raw)
  To: eric.dumazet; +Cc: netdev

From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Thu, 03 Apr 2014 09:28:10 -0700

> From: Eric Dumazet <edumazet@google.com>
> 
> Recycling skb always had been very tough...
> 
> This time it appears GRO layer can accumulate skb->truesize
> adjustments made by drivers when they attach a fragment to skb.
> 
> skb_gro_receive() can only subtract from skb->truesize the used part
> of a fragment.
> 
> I spotted this problem seeing TcpExtPruneCalled and
> TcpExtTCPRcvCollapsed that were unexpected with a recent kernel, where
> TCP receive window should be sized properly to accept traffic coming
> from a driver not overshooting skb->truesize.
> 
> Signed-off-by: Eric Dumazet <edumazet@google.com>

Nasty...

Applied, thanks Eric.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH net] net-gro: reset skb->truesize in napi_reuse_skb()
  2014-04-03 20:18 ` David Miller
@ 2014-05-16 21:27   ` Cong Wang
  0 siblings, 0 replies; 3+ messages in thread
From: Cong Wang @ 2014-05-16 21:27 UTC (permalink / raw)
  To: David Miller; +Cc: Eric Dumazet, netdev

On Thu, Apr 3, 2014 at 1:18 PM, David Miller <davem@davemloft.net> wrote:
> From: Eric Dumazet <eric.dumazet@gmail.com>
> Date: Thu, 03 Apr 2014 09:28:10 -0700
>
>> From: Eric Dumazet <edumazet@google.com>
>>
>> Recycling skb always had been very tough...
>>
>> This time it appears GRO layer can accumulate skb->truesize
>> adjustments made by drivers when they attach a fragment to skb.
>>
>> skb_gro_receive() can only subtract from skb->truesize the used part
>> of a fragment.
>>
>> I spotted this problem seeing TcpExtPruneCalled and
>> TcpExtTCPRcvCollapsed that were unexpected with a recent kernel, where
>> TCP receive window should be sized properly to accept traffic coming
>> from a driver not overshooting skb->truesize.
>>
>> Signed-off-by: Eric Dumazet <edumazet@google.com>
>
> Nasty...
>
> Applied, thanks Eric.

I think this patch should be queued for -stable as well?
Looking at your stable queue [1], it's not there. :)

Thanks!

1. http://patchwork.ozlabs.org/bundle/davem/stable/?state=*

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-05-16 21:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-04-03 16:28 [PATCH net] net-gro: reset skb->truesize in napi_reuse_skb() Eric Dumazet
2014-04-03 20:18 ` David Miller
2014-05-16 21:27   ` Cong Wang

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.