Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
de04f79b
Commit
de04f79b
authored
Jun 18, 2003
by
Herbert Xu
Committed by
David S. Miller
Jun 18, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[NET]: Fix per-cpu flow cache initialization.
parent
77518190
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
3 deletions
+17
-3
net/core/flow.c
net/core/flow.c
+17
-3
No files found.
net/core/flow.c
View file @
de04f79b
...
@@ -301,6 +301,7 @@ void flow_cache_flush(void)
...
@@ -301,6 +301,7 @@ void flow_cache_flush(void)
local_bh_disable
();
local_bh_disable
();
smp_call_function
(
flow_cache_flush_per_cpu
,
&
info
,
1
,
0
);
smp_call_function
(
flow_cache_flush_per_cpu
,
&
info
,
1
,
0
);
if
(
test_bit
(
smp_processor_id
(),
&
info
.
cpumap
))
flow_cache_flush_tasklet
((
unsigned
long
)
&
info
);
flow_cache_flush_tasklet
((
unsigned
long
)
&
info
);
local_bh_enable
();
local_bh_enable
();
...
@@ -309,12 +310,13 @@ void flow_cache_flush(void)
...
@@ -309,12 +310,13 @@ void flow_cache_flush(void)
up
(
&
flow_flush_sem
);
up
(
&
flow_flush_sem
);
}
}
static
void
__devinit
flow_cache_cpu_
onlin
e
(
int
cpu
)
static
void
__devinit
flow_cache_cpu_
prepar
e
(
int
cpu
)
{
{
struct
tasklet_struct
*
tasklet
;
struct
tasklet_struct
*
tasklet
;
unsigned
long
order
;
unsigned
long
order
;
flow_hash_rnd_recalc
(
cpu
)
=
1
;
flow_hash_rnd_recalc
(
cpu
)
=
1
;
flow_count
(
cpu
)
=
0
;
for
(
order
=
0
;
for
(
order
=
0
;
(
PAGE_SIZE
<<
order
)
<
(
PAGE_SIZE
<<
order
)
<
...
@@ -329,7 +331,10 @@ static void __devinit flow_cache_cpu_online(int cpu)
...
@@ -329,7 +331,10 @@ static void __devinit flow_cache_cpu_online(int cpu)
tasklet
=
flow_flush_tasklet
(
cpu
);
tasklet
=
flow_flush_tasklet
(
cpu
);
tasklet_init
(
tasklet
,
flow_cache_flush_tasklet
,
0
);
tasklet_init
(
tasklet
,
flow_cache_flush_tasklet
,
0
);
}
static
void
__devinit
flow_cache_cpu_online
(
int
cpu
)
{
down
(
&
flow_cache_cpu_sem
);
down
(
&
flow_cache_cpu_sem
);
set_bit
(
cpu
,
&
flow_cache_cpu_map
);
set_bit
(
cpu
,
&
flow_cache_cpu_map
);
flow_cache_cpu_count
++
;
flow_cache_cpu_count
++
;
...
@@ -342,6 +347,9 @@ static int __devinit flow_cache_cpu_notify(struct notifier_block *self,
...
@@ -342,6 +347,9 @@ static int __devinit flow_cache_cpu_notify(struct notifier_block *self,
unsigned
long
cpu
=
(
unsigned
long
)
cpu
;
unsigned
long
cpu
=
(
unsigned
long
)
cpu
;
switch
(
action
)
{
switch
(
action
)
{
case
CPU_UP_PREPARE
:
case
CPU_UP_PREPARE
:
flow_cache_cpu_prepare
(
cpu
);
break
;
case
CPU_ONLINE
:
flow_cache_cpu_online
(
cpu
);
flow_cache_cpu_online
(
cpu
);
break
;
break
;
}
}
...
@@ -354,6 +362,8 @@ static struct notifier_block __devinitdata flow_cache_cpu_nb = {
...
@@ -354,6 +362,8 @@ static struct notifier_block __devinitdata flow_cache_cpu_nb = {
static
int
__init
flow_cache_init
(
void
)
static
int
__init
flow_cache_init
(
void
)
{
{
int
i
;
flow_cachep
=
kmem_cache_create
(
"flow_cache"
,
flow_cachep
=
kmem_cache_create
(
"flow_cache"
,
sizeof
(
struct
flow_cache_entry
),
sizeof
(
struct
flow_cache_entry
),
0
,
SLAB_HWCACHE_ALIGN
,
0
,
SLAB_HWCACHE_ALIGN
,
...
@@ -371,8 +381,12 @@ static int __init flow_cache_init(void)
...
@@ -371,8 +381,12 @@ static int __init flow_cache_init(void)
flow_hash_rnd_timer
.
expires
=
jiffies
+
FLOW_HASH_RND_PERIOD
;
flow_hash_rnd_timer
.
expires
=
jiffies
+
FLOW_HASH_RND_PERIOD
;
add_timer
(
&
flow_hash_rnd_timer
);
add_timer
(
&
flow_hash_rnd_timer
);
flow_cache_cpu_online
(
smp_processor_id
());
register_cpu_notifier
(
&
flow_cache_cpu_nb
);
register_cpu_notifier
(
&
flow_cache_cpu_nb
);
for
(
i
=
0
;
i
<
NR_CPUS
;
i
++
)
if
(
cpu_online
(
i
))
{
flow_cache_cpu_prepare
(
i
);
flow_cache_cpu_online
(
i
);
}
return
0
;
return
0
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment