From: Martin Josefsson <gandalf@wlug.westbo.se>
To: Netfilter-devel <netfilter-devel@lists.samba.org>
Subject: [PATCH] small optimization in __ip_conntrack_find()
Date: 08 Jun 2002 01:00:59 +0200 [thread overview]
Message-ID: <1023490707.19838.14.camel@tux> (raw)
[-- Attachment #1: Type: text/plain, Size: 352 bytes --]
Hi,
Attached is a small optimization for __ip_conntrack_find().
The way I read the use of the LIST_FIND macro it seems that we are
calling hash_conntrack() for each iteration with the same inparameters.
My change calls it once before looping.
--
/Martin
Never argue with an idiot. They drag you down to their level, then beat
you with experience.
[-- Attachment #2: ip_conntrack_core.c-find-diff --]
[-- Type: text/plain, Size: 601 bytes --]
--- linux-2.4.19-pre10/net/ipv4/netfilter/ip_conntrack_core.c.orig Sat Jun 8 00:48:59 2002
+++ linux-2.4.19-pre10/net/ipv4/netfilter/ip_conntrack_core.c Sat Jun 8 00:49:56 2002
@@ -292,9 +292,10 @@
const struct ip_conntrack *ignored_conntrack)
{
struct ip_conntrack_tuple_hash *h;
+ size_t hash = hash_conntrack(tuple);
MUST_BE_READ_LOCKED(&ip_conntrack_lock);
- h = LIST_FIND(&ip_conntrack_hash[hash_conntrack(tuple)],
+ h = LIST_FIND(&ip_conntrack_hash[hash],
conntrack_tuple_cmp,
struct ip_conntrack_tuple_hash *,
tuple, ignored_conntrack);
next reply other threads:[~2002-06-07 23:00 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-06-07 23:00 Martin Josefsson [this message]
2002-06-11 7:51 ` [PATCH] small optimization in __ip_conntrack_find() Harald Welte
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=1023490707.19838.14.camel@tux \
--to=gandalf@wlug.westbo.se \
--cc=netfilter-devel@lists.samba.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.