linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] - Incorrect cpumask definition in net/core/flow.c
@ 2003-11-07 21:08 Jack Steiner
  2003-11-08  2:57 ` Herbert Xu
  0 siblings, 1 reply; 3+ messages in thread
From: Jack Steiner @ 2003-11-07 21:08 UTC (permalink / raw)
  To: akpm, linux-kernel; +Cc: Jesse Barnes

This fixes a problem in net/core/flow.c. 

The field "cpumap" is defined as a "unsigned long". It 
should be a "cpumask_t".



# This is a BitKeeper generated patch for the following project:
# Project Name: Linux kernel tree
# This patch format is intended for GNU patch command version 2.5 or higher.
# This patch includes the following deltas:
#	           ChangeSet	1.1402  -> 1.1403 
#	     net/core/flow.c	1.15    -> 1.16   
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 03/11/07	steiner@attica.americas.sgi.com	1.1403
# Change cpumap definition from "unsigned long" to "cpumask_t". 
# --------------------------------------------
#



diff -Nru a/net/core/flow.c b/net/core/flow.c
--- a/net/core/flow.c	Fri Nov  7 15:04:08 2003
+++ b/net/core/flow.c	Fri Nov  7 15:04:08 2003
@@ -65,7 +65,7 @@
 
 struct flow_flush_info {
 	atomic_t cpuleft;
-	unsigned long cpumap;
+	cpumask_t cpumap;
 	struct completion completion;
 };
 static DEFINE_PER_CPU(struct tasklet_struct, flow_flush_tasklets) = { NULL };
@@ -73,7 +73,7 @@
 #define flow_flush_tasklet(cpu) (&per_cpu(flow_flush_tasklets, cpu))
 
 static DECLARE_MUTEX(flow_cache_cpu_sem);
-static unsigned long flow_cache_cpu_map;
+static cpumask_t flow_cache_cpu_map;
 static unsigned int flow_cache_cpu_count;
 
 static void flow_cache_new_hashrnd(unsigned long arg)



-- 
Thanks

Jack Steiner (steiner@sgi.com)          651-683-5302
Principal Engineer                      SGI - Silicon Graphics, Inc.



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] - Incorrect cpumask definition in net/core/flow.c
  2003-11-07 21:08 [PATCH] - Incorrect cpumask definition in net/core/flow.c Jack Steiner
@ 2003-11-08  2:57 ` Herbert Xu
  2003-11-09  6:26   ` David S. Miller
  0 siblings, 1 reply; 3+ messages in thread
From: Herbert Xu @ 2003-11-08  2:57 UTC (permalink / raw)
  To: Jack Steiner, davem, linux-kernel, netdev

Jack Steiner <steiner@sgi.com> wrote:
> This fixes a problem in net/core/flow.c. 
> 
> The field "cpumap" is defined as a "unsigned long". It 
> should be a "cpumask_t".

Thanks.  Here is a patch that changes the operations on the maps as well
for consistency.
-- 
Debian GNU/Linux 3.0 is out! ( http://www.debian.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
--
Index: kernel-source-2.5/net/core/flow.c
===================================================================
RCS file: /home/gondolin/herbert/src/CVS/debian/kernel-source-2.5/net/core/flow.c,v
retrieving revision 1.8
diff -u -r1.8 flow.c
--- kernel-source-2.5/net/core/flow.c	11 Oct 2003 06:29:28 -0000	1.8
+++ kernel-source-2.5/net/core/flow.c	8 Nov 2003 02:54:01 -0000
@@ -19,6 +19,7 @@
 #include <linux/bitops.h>
 #include <linux/notifier.h>
 #include <linux/cpu.h>
+#include <linux/cpumask.h>
 #include <net/flow.h>
 #include <asm/atomic.h>
 #include <asm/semaphore.h>
@@ -65,7 +66,7 @@
 
 struct flow_flush_info {
 	atomic_t cpuleft;
-	unsigned long cpumap;
+	cpumask_t cpumap;
 	struct completion completion;
 };
 static DEFINE_PER_CPU(struct tasklet_struct, flow_flush_tasklets) = { NULL };
@@ -73,7 +74,7 @@
 #define flow_flush_tasklet(cpu) (&per_cpu(flow_flush_tasklets, cpu))
 
 static DECLARE_MUTEX(flow_cache_cpu_sem);
-static unsigned long flow_cache_cpu_map;
+static cpumask_t flow_cache_cpu_map;
 static unsigned int flow_cache_cpu_count;
 
 static void flow_cache_new_hashrnd(unsigned long arg)
@@ -81,7 +82,7 @@
 	int i;
 
 	for (i = 0; i < NR_CPUS; i++)
-		if (test_bit(i, &flow_cache_cpu_map))
+		if (cpu_isset(i, flow_cache_cpu_map))
 			flow_hash_rnd_recalc(i) = 1;
 
 	flow_hash_rnd_timer.expires = jiffies + FLOW_HASH_RND_PERIOD;
@@ -178,7 +179,7 @@
 	cpu = smp_processor_id();
 
 	fle = NULL;
-	if (!test_bit(cpu, &flow_cache_cpu_map))
+	if (!cpu_isset(cpu, flow_cache_cpu_map))
 		goto nocache;
 
 	if (flow_hash_rnd_recalc(cpu))
@@ -277,7 +278,7 @@
 	struct tasklet_struct *tasklet;
 
 	cpu = smp_processor_id();
-	if (!test_bit(cpu, &info->cpumap))
+	if (!cpu_isset(cpu, info->cpumap))
 		return;
 
 	tasklet = flow_flush_tasklet(cpu);
@@ -301,7 +302,7 @@
 
 	local_bh_disable();
 	smp_call_function(flow_cache_flush_per_cpu, &info, 1, 0);
-	if (test_bit(smp_processor_id(), &info.cpumap))
+	if (cpu_isset(smp_processor_id(), info.cpumap))
 		flow_cache_flush_tasklet((unsigned long)&info);
 	local_bh_enable();
 
@@ -341,7 +342,7 @@
 static int __devinit flow_cache_cpu_online(int cpu)
 {
 	down(&flow_cache_cpu_sem);
-	set_bit(cpu, &flow_cache_cpu_map);
+	cpu_set(cpu, flow_cache_cpu_map);
 	flow_cache_cpu_count++;
 	up(&flow_cache_cpu_sem);
 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] - Incorrect cpumask definition in net/core/flow.c
  2003-11-08  2:57 ` Herbert Xu
@ 2003-11-09  6:26   ` David S. Miller
  0 siblings, 0 replies; 3+ messages in thread
From: David S. Miller @ 2003-11-09  6:26 UTC (permalink / raw)
  To: Herbert Xu; +Cc: steiner, linux-kernel, netdev

On Sat, 08 Nov 2003 13:57:57 +1100
Herbert Xu <herbert@gondor.apana.org.au> wrote:

> Here is a patch that changes the operations on the maps as well
> for consistency.

This is the correct patch, applied thanks.

I have another patch that cleans up this stuff in a better
albeit intrusive way from Rusty, but let's be safe for 2.6.0

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2003-11-09  6:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-11-07 21:08 [PATCH] - Incorrect cpumask definition in net/core/flow.c Jack Steiner
2003-11-08  2:57 ` Herbert Xu
2003-11-09  6:26   ` David S. Miller

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).