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
a09e2c7f
Commit
a09e2c7f
authored
Jun 18, 2003
by
David S. Miller
Committed by
David S. Miller
Jun 18, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[NET]: Check for flow cache allocation failure.
parent
de04f79b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
7 deletions
+14
-7
net/core/flow.c
net/core/flow.c
+14
-7
No files found.
net/core/flow.c
View file @
a09e2c7f
...
@@ -310,14 +310,11 @@ void flow_cache_flush(void)
...
@@ -310,14 +310,11 @@ void flow_cache_flush(void)
up
(
&
flow_flush_sem
);
up
(
&
flow_flush_sem
);
}
}
static
void
__devinit
flow_cache_cpu_prepare
(
int
cpu
)
static
int
__devinit
flow_cache_cpu_prepare
(
int
cpu
)
{
{
struct
tasklet_struct
*
tasklet
;
struct
tasklet_struct
*
tasklet
;
unsigned
long
order
;
unsigned
long
order
;
flow_hash_rnd_recalc
(
cpu
)
=
1
;
flow_count
(
cpu
)
=
0
;
for
(
order
=
0
;
for
(
order
=
0
;
(
PAGE_SIZE
<<
order
)
<
(
PAGE_SIZE
<<
order
)
<
(
sizeof
(
struct
flow_cache_entry
*
)
*
flow_hash_size
);
(
sizeof
(
struct
flow_cache_entry
*
)
*
flow_hash_size
);
...
@@ -327,18 +324,28 @@ static void __devinit flow_cache_cpu_prepare(int cpu)
...
@@ -327,18 +324,28 @@ static void __devinit flow_cache_cpu_prepare(int cpu)
flow_table
(
cpu
)
=
(
struct
flow_cache_entry
**
)
flow_table
(
cpu
)
=
(
struct
flow_cache_entry
**
)
__get_free_pages
(
GFP_KERNEL
,
order
);
__get_free_pages
(
GFP_KERNEL
,
order
);
if
(
!
flow_table
(
cpu
))
return
NOTIFY_BAD
;
memset
(
flow_table
(
cpu
),
0
,
PAGE_SIZE
<<
order
);
memset
(
flow_table
(
cpu
),
0
,
PAGE_SIZE
<<
order
);
flow_hash_rnd_recalc
(
cpu
)
=
1
;
flow_count
(
cpu
)
=
0
;
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
);
return
NOTIFY_OK
;
}
}
static
void
__devinit
flow_cache_cpu_online
(
int
cpu
)
static
int
__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
++
;
up
(
&
flow_cache_cpu_sem
);
up
(
&
flow_cache_cpu_sem
);
return
NOTIFY_OK
;
}
}
static
int
__devinit
flow_cache_cpu_notify
(
struct
notifier_block
*
self
,
static
int
__devinit
flow_cache_cpu_notify
(
struct
notifier_block
*
self
,
...
@@ -347,10 +354,10 @@ static int __devinit flow_cache_cpu_notify(struct notifier_block *self,
...
@@ -347,10 +354,10 @@ 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
);
return
flow_cache_cpu_prepare
(
cpu
);
break
;
break
;
case
CPU_ONLINE
:
case
CPU_ONLINE
:
flow_cache_cpu_online
(
cpu
);
return
flow_cache_cpu_online
(
cpu
);
break
;
break
;
}
}
return
NOTIFY_OK
;
return
NOTIFY_OK
;
...
...
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