All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 2.6 1/19]: Clean up ip_conntrack stats
@ 2004-10-25  0:48 Patrick McHardy
  0 siblings, 0 replies; only message in thread
From: Patrick McHardy @ 2004-10-25  0:48 UTC (permalink / raw)
  To: David S. Miller; +Cc: Netfilter Development Mailinglist

[-- Attachment #1: Type: text/plain, Size: 50 bytes --]

Use CONNTRACK_STAT_INC for changing statistics.



[-- Attachment #2: 01.diff --]
[-- Type: text/x-patch, Size: 1338 bytes --]

# This is a BitKeeper generated diff -Nru style patch.
#
# ChangeSet
#   2004/10/19 02:06:42+02:00 pablo@eurodev.net 
#   [NETFILTER]: Clean up ip_conntrack stats
#   
#   Signed-off-by: Pablo Neira <pablo@eurodev.net>
#   Signed-off-by: Patrick McHardy <kaber@trash.net>
# 
# net/ipv4/netfilter/ip_conntrack_core.c
#   2004/10/19 02:06:14+02:00 pablo@eurodev.net +2 -4
#   [NETFILTER]: Clean up ip_conntrack stats
#   
#   Signed-off-by: Pablo Neira <pablo@eurodev.net>
#   Signed-off-by: Patrick McHardy <kaber@trash.net>
# 
diff -Nru a/net/ipv4/netfilter/ip_conntrack_core.c b/net/ipv4/netfilter/ip_conntrack_core.c
--- a/net/ipv4/netfilter/ip_conntrack_core.c	2004-10-22 03:36:57 +02:00
+++ b/net/ipv4/netfilter/ip_conntrack_core.c	2004-10-22 03:36:57 +02:00
@@ -352,16 +352,14 @@
 {
 	struct ip_conntrack_tuple_hash *h;
 	unsigned int hash = hash_conntrack(tuple);
-	/* use per_cpu() to avoid multiple calls to smp_processor_id() */
-	unsigned int cpu = smp_processor_id();
 
 	MUST_BE_READ_LOCKED(&ip_conntrack_lock);
 	list_for_each_entry(h, &ip_conntrack_hash[hash], list) {
 		if (conntrack_tuple_cmp(h, tuple, ignored_conntrack)) {
-			per_cpu(ip_conntrack_stat, cpu).found++;
+			CONNTRACK_STAT_INC(found);
 			return h;
 		}
-		per_cpu(ip_conntrack_stat, cpu).searched++;
+		CONNTRACK_STAT_INC(searched);
 	}
 
 	return NULL;

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2004-10-25  0:48 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-10-25  0:48 [PATCH 2.6 1/19]: Clean up ip_conntrack stats Patrick McHardy

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.