From: Jes Sorensen <jes@trained-monkey.org>
To: "David S. Miller" <davem@redhat.com>
Cc: kuznet@ms2.inr.ac.ru, netdev@oss.sgi.com
Subject: [patch] net/core/flow.c
Date: Mon, 17 Nov 2003 10:20:04 -0500 [thread overview]
Message-ID: <16312.59172.153904.436145@gargle.gargle.HOWL> (raw)
Hi Dave and Alexey,
While browsing some of the net dev code I noticed that net/core/flow.c
still uses an unsigned long and test_bit/set_bit for it's cpu mask
instead of cpumask_t.
Patch against 2.6.0-test9 included.
Cheers,
Jes
--- linux-2.6.0-test9/net/core/flow.c~ Sat Oct 25 11:42:49 2003
+++ linux-2.6.0-test9/net/core/flow.c Mon Nov 17 07:27:38 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)
@@ -81,7 +81,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 +178,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 +277,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 +301,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 +341,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);
next reply other threads:[~2003-11-17 15:20 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-11-17 15:20 Jes Sorensen [this message]
2003-11-17 15:38 ` [patch] net/core/flow.c Arnaldo Carvalho de Melo
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=16312.59172.153904.436145@gargle.gargle.HOWL \
--to=jes@trained-monkey.org \
--cc=davem@redhat.com \
--cc=kuznet@ms2.inr.ac.ru \
--cc=netdev@oss.sgi.com \
/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).