[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1318197320.21116.11.camel@edumazet-laptop>
Date: Sun, 09 Oct 2011 23:55:20 +0200
From: Eric Dumazet <eric.dumazet@...il.com>
To: David Miller <davem@...emloft.net>
Cc: netdev@...r.kernel.org
Subject: Re: [RFC] truesize lies
Le dimanche 09 octobre 2011 à 17:27 -0400, David Miller a écrit :
> From: Eric Dumazet <eric.dumazet@...il.com>
> Date: Sun, 09 Oct 2011 21:02:28 +0200
>
> > I guess most driver writers adjust truesize to please TCP stack and get
> > nice performance numbers.
> >
> > skb->truesize = frame_len + sizeof(sk_buff);
> >
> > What should we do exactly ?
>
> We should pick a specification that accounts for all the metadata as well
> as unused data areas properly, and enforce this in netif_receive_skb().
>
> That will get the inaccurate cases fixed real fast.
>
> We've had similar problems in the past and dealt with it in the same
> exact way.
Some drivers splits a page in two (or more) pieces, so we cant know what
was really reserved by a driver for paged skbs.
Only thing we could enforce at the moment is the proper accounting for
skb head :
WARN_ON(skb->truesize < (skb_end_pointer(skb) - skb->head) + sizeof(sk_buff) + skb->data_len);
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists