Netdev List
 help / color / mirror / Atom feed
From: chas williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
To: Eric Dumazet <eric.dumazet@gmail.com>
Cc: netdev <netdev@vger.kernel.org>
Subject: Re: [PATCH net-next] atm: use SKB_TRUESIZE() in atm_guess_pdu2truesize()
Date: Tue, 22 Nov 2011 17:42:05 -0500	[thread overview]
Message-ID: <20111122174205.6ef2021d@thirdoffive.cmf.nrl.navy.mil> (raw)
In-Reply-To: <1321994034.19663.9.camel@edumazet-laptop>

On Tue, 22 Nov 2011 21:33:54 +0100
Eric Dumazet <eric.dumazet@gmail.com> wrote:

> Le mardi 22 novembre 2011 à 15:22 -0500, chas williams - CONTRACTOR a
> écrit :
> > it doesnt seem like a good idea to create a wrapper for a one to one
> > call.  perhaps this whole bit of nonsense should be removed.  the
> > iphase driver should be returning skb->truesize like everyone.  
> > 
> > if atm_alloc_charge() just uses SKB_TRUESIZE() then we konw that guess
> > will be the same as skb->truesize and atm_alloc_charge() can be
> > simplified by removing atomic_add(skb->truesize - guess, which will be
> > 0 in all cases.
> > 
> 
> Please note I didnt create a wrapper, only correct existing one :)
> 
> Feel free to send a (tested) patch, but be warned that following code is
> not correct :
> 
> int size = something;
> 
> struct sk_buff *skb = skb_alloc(size);
> 
> ASSERT(skb->truesize == SKB_TRUESIZE(size));
> 
> (It might be true with SLOB only)

perhaps it is best to say that you discovered an inadvertent wrapper.

given skb->truesize != SKB_TRUESIZE() for all cases, it is certainly
wrong in the iphase driver to return the guessed value.  it should be
returning skb->truesize.  i will send along a patch shortly to just get
rid of this function.

      reply	other threads:[~2011-11-22 22:43 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-22  5:51 [PATCH net-next] atm: use SKB_TRUESIZE() in atm_guess_pdu2truesize() Eric Dumazet
2011-11-22 20:16 ` David Miller
2011-11-22 20:22 ` chas williams - CONTRACTOR
2011-11-22 20:33   ` Eric Dumazet
2011-11-22 22:42     ` chas williams - CONTRACTOR [this message]

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=20111122174205.6ef2021d@thirdoffive.cmf.nrl.navy.mil \
    --to=chas@cmf.nrl.navy.mil \
    --cc=eric.dumazet@gmail.com \
    --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