From: Evgeniy Polyakov <[EMAIL PROTECTED]>
Date: Mon, 7 Aug 2006 10:01:56 +0400

> +     int order = get_order(size + sizeof(void *));
> +     struct skb_shared_info *sh;
>  
>       cache = fclone ? skbuff_fclone_cache : skbuff_head_cache;
>  
> @@ -156,11 +159,28 @@ struct sk_buff *__alloc_skb(unsigned int
>  
>       /* Get the DATA. Size must match skb_add_mtu(). */
>       size = SKB_DATA_ALIGN(size);
> -     data = ____kmalloc(size + sizeof(struct skb_shared_info), gfp_mask);
> -     if (!data)
> -             goto nodata;
> +     if ((1UL << order) > size + sizeof(void *) + sizeof(struct 
> skb_shared_info)) {

get_order() returns a PAGE_SIZE order not a byte one.  So this test
here at the end is incorrect.  It should probably be something
like "if ((PAGE_SIZE << order) > ..."

I don't know if I want to eat an entire extra allocation for every SKB
just to handle broken e1000 cards that can't be bothered to support
non-power-of-2 receive buffer sizes and a proper MTU setting.

I guess we might have to, but this is extremely unfortunate. :-/

-
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