netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Phil Oester <kernel@linuxace.com>
To: Pablo Neira Ayuso <pablo@netfilter.org>
Cc: Florian Westphal <fw@strlen.de>, netfilter-devel@vger.kernel.org
Subject: Re: [PATCH] netfilter: remove redundant skb check in nf_conntrack_put_reasm
Date: Wed, 19 Jun 2013 20:01:35 -0400	[thread overview]
Message-ID: <20130620000135.GB819@gmail.com> (raw)
In-Reply-To: <20130620095846.GA19504@localhost>

On Thu, Jun 20, 2013 at 11:58:46AM +0200, Pablo Neira Ayuso wrote:
> On Thu, Jun 20, 2013 at 11:22:59AM +0200, Florian Westphal wrote:
> > Phil Oester <kernel@linuxace.com> wrote:
> > > kfree_skb already checks for skb existence - remove redundant check from
> > > nf_conntrack_put_reasm.
> > 
> > This is called for every free'd skb, in almost all cases
> > the condition will be false.
> > 
> > So I think its ok to keep this check.
> 
> I see, we'll hit branch mispredictions most of the time. I have kept
> this back. Thanks Florian.

If we're concerned about branch mispredictions, we should change the check to
match the one at the top of kfree_skb:

        if (unlikely(!skb))
                return;

However nf_conntrack_put_reasm is only used in 3 places in the entire tree.
Unclear why we don't just call kfree_skb directly in these 3 places.

Phil

  reply	other threads:[~2013-06-20 13:04 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-19 14:27 [PATCH] netfilter: remove redundant skb check in nf_conntrack_put_reasm Phil Oester
2013-06-20  9:22 ` Florian Westphal
2013-06-20  9:58   ` Pablo Neira Ayuso
2013-06-20  0:01     ` Phil Oester [this message]
2013-06-20 14:15       ` Florian Westphal
2013-06-20  9:49 ` Pablo Neira Ayuso

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=20130620000135.GB819@gmail.com \
    --to=kernel@linuxace.com \
    --cc=fw@strlen.de \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=pablo@netfilter.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;
as well as URLs for NNTP newsgroup(s).