mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Kris Katterjohn" <kjak@ispwest.com>
To: "Herbert Xu" <herbert@gondor.apana.org.au>
Cc: jschlst@samba.org, torvalds@osdl.org,
	linux-kernel@vger.kernel.org, davem@davemloft.net,
	acme@ghostprotocols.net, netdev@vger.kernel.org
Subject: Re: [PATCH] Merge __load_pointer() and load_pointer() in net/core/filter.c; kernel 2.6.14
Date: Wed, 2 Nov 2005 18:13:47 -0800	[thread overview]
Message-ID: <310a17ad00f84c389e64ae26656ce1a1.kjak@ispwest.com> (raw)

I wasn't actually changing it to add performance, but to make the code look
cleaner. The new load_pointer() is virtually the same as having the seperate
functions that are currently there, but the code, I think, is "better looking".
If you look at the current net/core/filter.c and then my patched version, the
steps are done in the exact same order and same way, but all in that one
function.

That may sound silly, but I just kept looking at it and asking myself, "Why?"

Of course, one way may still out-perform the other.


Thanks


----- Original Message -----
From: Herbert Xu [mailto:herbert@gondor.apana.org.au]
Sent: 11/2/2005 5:50:29 PM
To: kjak@users.sourceforge.net
Cc: jschlst@samba.org; torvalds@osdl.org; linux-kernel@vger.kernel.org; davem@davemloft.net; acme@ghostprotocols.net; netdev@vger.kernel.org
Subject: Re: [PATCH] Merge __load_pointer() and load_pointer() in net/core/filter.c; kernel 2.6.14

> Kris Katterjohn <kjak@ispwest.com> wrote:
> > Another patch for net/core/filter.c by me. I merged __load_pointer() into
> > load_pointer(). I don't see a point in having two seperate functions when
> > both functions are really small and load_pointer() calls __load_pointer().
> > Renamed the variable "k" to "offset" since that's what it is, and in
> > skb_header_pointer() it's "offset".
> > 
> > This patch is a diff from kernel 2.6.14
> 
> This code path is performance-critical so you should benchmark your
> changes.
> 
> In this particular case, __load_pointer is the unlikely case and
> therefore it wasn't inlined.
> 
> Cheers,
> -- 
> Visit Openswan at http://www.openswan.org/
> Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
> Home Page: http://gondor.apana.org.au/~herbert/
> PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt


             reply	other threads:[~2005-11-03  2:13 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-11-03  2:13 Kris Katterjohn [this message]
2005-11-03  2:30 ` Herbert Xu
  -- strict thread matches above, loose matches on Subject: below --
2005-11-03 18:13 [PATCH] Merge __load_pointer() and load_pointer() in net/core/filter.c;kernel 2.6.14 Kris Katterjohn
2005-11-03  6:19 [PATCH] Merge __load_pointer() and load_pointer() in net/core/filter.c; kernel 2.6.14 Kris Katterjohn
2005-11-03  6:58 ` Mitchell Blank Jr
2005-11-03 16:19   ` Patrick McHardy
2005-11-03  5:51 Kris Katterjohn
2005-11-03  2:48 Kris Katterjohn
2005-11-02  8:41 Kris Katterjohn
2005-11-03  1:50 ` Herbert Xu

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=310a17ad00f84c389e64ae26656ce1a1.kjak@ispwest.com \
    --to=kjak@ispwest.com \
    --cc=acme@ghostprotocols.net \
    --cc=davem@davemloft.net \
    --cc=herbert@gondor.apana.org.au \
    --cc=jschlst@samba.org \
    --cc=kjak@users.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=torvalds@osdl.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

all inboxes | Powered by JetHome®