* gro: Check for GSO packets and packets with frag_list
@ 2009-01-14 21:56 Herbert Xu
2009-01-14 22:36 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Herbert Xu @ 2009-01-14 21:56 UTC (permalink / raw)
To: David S. Miller, netdev
Hi Dave:
Here's a patch for GRO allowing it to be used on more drivers.
gro: Check for GSO packets and packets with frag_list
As GRO cannot be applied to packets with frag_list we need to
make sure that we reject such packets if they are fed to us,
e.g., through a tunnel device.
Also there is no point in applying GRO on GSO packets so they
too should be rejected. This allows GRO to be used in virtio-net
which may produce GSO packets directly but may still benefit
from GRO if the other end of it doesn't support GSO.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
diff --git a/net/core/dev.c b/net/core/dev.c
index 5f736f1..972a47d 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -2382,6 +2382,9 @@ int dev_gro_receive(struct napi_struct *napi, struct sk_buff *skb)
if (!(skb->dev->features & NETIF_F_GRO))
goto normal;
+ if (skb_is_gso(skb) || skb_shinfo(skb)->frag_list)
+ goto normal;
+
rcu_read_lock();
list_for_each_entry_rcu(ptype, head, list) {
struct sk_buff *p;
Thanks,
--
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: gro: Check for GSO packets and packets with frag_list
2009-01-14 21:56 gro: Check for GSO packets and packets with frag_list Herbert Xu
@ 2009-01-14 22:36 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2009-01-14 22:36 UTC (permalink / raw)
To: herbert; +Cc: netdev
From: Herbert Xu <herbert@gondor.apana.org.au>
Date: Thu, 15 Jan 2009 08:56:39 +1100
> gro: Check for GSO packets and packets with frag_list
>
> As GRO cannot be applied to packets with frag_list we need to
> make sure that we reject such packets if they are fed to us,
> e.g., through a tunnel device.
>
> Also there is no point in applying GRO on GSO packets so they
> too should be rejected. This allows GRO to be used in virtio-net
> which may produce GSO packets directly but may still benefit
> from GRO if the other end of it doesn't support GSO.
>
> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Applied, thanks Herbert.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-01-14 22:36 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-14 21:56 gro: Check for GSO packets and packets with frag_list Herbert Xu
2009-01-14 22:36 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).