Avoid multi-page allocs for large mtu datagram sends
Subsystems (3)
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 3 lines · Zach Brown
2) I changed the final-frag test to be length + fraggap as the math later on seemed to match that.. is that OK?
Yes that's a real bug introduced by a previous rework. Could you please split that off into a separate patch?
Thanks,
Signature · 4 lines
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txtQuoted 6 lines · Herbert Xu
Quoted 2 lines · Zach Brown
2) I changed the final-frag test to be length + fraggap as the math later on seemed to match that.. is that OK?
Yes that's a real bug introduced by a previous rework. Could you please split that off into a separate patch?
Sure, here it is by itself. I lightly tested this but didn't actually use anything that has a non-zero trailer len, I don't think.
Did you have an opinion of the rest of the original patch?
- z
[PATCH] ip_output: account for fraggap when checking to add trailer_len
During other work I noticed that ip_append_data() seemed to be forgetting to include the frag gap in its calculation of a fragment that consumes the rest of the payload. Herbert confirmed that this was a bug that snuck in during a previous rework.
net/ipv4/ip_output.c +1 -1
@@ -904,7 +904,7 @@ alloc_new_skb:* because we have no idea what fragment will be * the last. */ -if (datalen == length) +if (datalen == length + fraggap) alloclen += rt->u.dst.trailer_len;if (transhdrlen) {
Quoted 2 lines · Zach Brown
Did you have an opinion of the rest of the original patch?
Sorry, I've been busy lately so I've only just started reading it. I should have something to say by tomorrow :)
Signature · 4 lines
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txtHi Zach:
Quoted 4 lines · Zach Brown
(quoted diff) +3
-0+ if ((rt->u.dst.dev->features&NETIF_F_SG) && + (SKB_DATA_KMALLOC_BYTES(alloclen + datalen) + > PAGE_SIZE)) {
Review
Quoted 10 lines
(quoted diff) +10
-0+ /* + * datalen is shrinking so there won't be a + * trailer, but alloclen already accounted for + * it. use that space for payload but only if + * it wasn't the trailer_len itself that pushed + * the alloc beyond a single page. + */ + if (datalen - SKB_MAX_ORDER(alloclen, 0) > + rt->u.dst.trailer_len) + alloclen -= rt->u.dst.trailer_len;
I think this should be done unconditionally. First of all at this time ESP doesn't know how to deal with this anyway so it's just going to reallocate and linearise the whole thing. However, when we do fix it we can just get it to allocate the trailer in its own frag so we don't need to worry about trailer_len at all.
Cheers,
Signature · 4 lines
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt