Zach Brown <[EMAIL PROTECTED]> wrote:
> 
> Index: 2.6.16-mm2-bigmtu/net/ipv4/ip_output.c
> ===================================================================
> --- 2.6.16-mm2-bigmtu.orig/net/ipv4/ip_output.c
> +++ 2.6.16-mm2-bigmtu/net/ipv4/ip_output.c
> @@ -891,13 +891,26 @@ alloc_new_skb:
>                        datalen = length + fraggap;
>                        if (datalen > mtu - fragheaderlen)
>                                datalen = maxfraglen - fragheaderlen;
> +
> +                       alloclen = fragheaderlen + hh_len + 15;
> +
> +                       /* avoid multi page allocs */
> +                       if ((rt->u.dst.dev->features&NETIF_F_SG) &&
> +                           (SKB_DATA_KMALLOC_BYTES(alloclen + datalen)
> +                                                               > PAGE_SIZE)) 
> {
> +                               datalen = SKB_MAX_ORDER(alloclen, 0);
> +                               /* watch out for trailer_len */
> +                               if (datalen == length)
> +                                       datalen -= 2;
> +                       }
> +
>                        fraglen = datalen + fragheaderlen;
> 
>                        if ((flags & MSG_MORE) && 
>                            !(rt->u.dst.dev->features&NETIF_F_SG))
> -                               alloclen = mtu;
> +                               alloclen += mtu - fragheaderlen;
>                        else
> -                               alloclen = datalen + fragheaderlen;
> +                               alloclen += datalen + fragheaderlen;

For the else clause wouldn't we be counting fragheaderlen twice if
the multi page if falls through above despite NETIF_F_SG being true?

Cheers,
-- 
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
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to