gso: Attempt to handle mega-GRO packets

Herbert Xu
2013-11-06T01:30:49Z

Here is a totally untested patch that tries to trivially process
these new frags + frag_list skbs. It should actually be trivial
to make this generate TSO packets by just adding a gso_ok check
and short-circuit.

diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index 3735fad..ec8e8bc 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -2816,7 +2816,24 @@ struct sk_buff *skb_segment(struct sk_buff *skb, netdev_features_t features)
hsize = len;

if (!hsize && i >= nfrags) {
- BUG_ON(fskb->len != len);
+ if (fskb->len != len) {
+ SKB_FRAG_ASSERT(fskb);
+
+ nskb = skb_segment(fskb, features);
+
+ err = PTR_ERR(nskb);
+ if (IS_ERR(nskb))
+ goto err;
+ err = -ENOMEM;
+
+ if (segs)
+ tail->next = nskb;
+ else
+ segs = nskb;
+ tail = nskb;
+ while (tail->next)
+ tail = tail->next;
+ }

pos += len;
nskb = skb_clone(fskb, GFP_ATOMIC);

Thanks,
--
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt