public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Eric Dumazet <eric.dumazet@gmail.com>
To: David Miller <davem@davemloft.net>
Cc: netdev@vger.kernel.org
Subject: Re: [RFC] truesize lies
Date: Sun, 09 Oct 2011 23:55:20 +0200	[thread overview]
Message-ID: <1318197320.21116.11.camel@edumazet-laptop> (raw)
In-Reply-To: <20111009.172739.2151675769111763947.davem@davemloft.net>

Le dimanche 09 octobre 2011 à 17:27 -0400, David Miller a écrit :
> From: Eric Dumazet <eric.dumazet@gmail.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);

  reply	other threads:[~2011-10-09 21:55 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-09 19:02 [RFC] truesize lies Eric Dumazet
2011-10-09 19:25 ` Andi Kleen
2011-10-09 21:27 ` David Miller
2011-10-09 21:55   ` Eric Dumazet [this message]
2011-10-09 22:10     ` David Miller
2011-10-10  6:54       ` Eric Dumazet

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1318197320.21116.11.camel@edumazet-laptop \
    --to=eric.dumazet@gmail.com \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox