Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
linux-davinci
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
linux
linux-davinci
Commits
21ece08c
Commit
21ece08c
authored
Jul 26, 2009
by
Thomas Gleixner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
net: fix the xtables smp_processor_id assumptions for -rt
Signed-off-by:
Thomas Gleixner
<
tglx@linutronix.de
>
parent
bf794775
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
12 deletions
+17
-12
include/linux/netfilter/x_tables.h
include/linux/netfilter/x_tables.h
+2
-2
net/ipv4/netfilter/arp_tables.c
net/ipv4/netfilter/arp_tables.c
+3
-2
net/ipv4/netfilter/ip_tables.c
net/ipv4/netfilter/ip_tables.c
+5
-4
net/ipv6/netfilter/ip6_tables.c
net/ipv6/netfilter/ip6_tables.c
+7
-4
No files found.
include/linux/netfilter/x_tables.h
View file @
21ece08c
...
...
@@ -473,14 +473,14 @@ static inline void xt_info_rdlock_bh(void)
struct
xt_info_lock
*
lock
;
local_bh_disable
();
lock
=
&
__get_cpu_var
(
xt_info_locks
);
lock
=
&
__
raw_
get_cpu_var
(
xt_info_locks
);
if
(
likely
(
!
lock
->
readers
++
))
spin_lock
(
&
lock
->
lock
);
}
static
inline
void
xt_info_rdunlock_bh
(
void
)
{
struct
xt_info_lock
*
lock
=
&
__get_cpu_var
(
xt_info_locks
);
struct
xt_info_lock
*
lock
=
&
__
raw_
get_cpu_var
(
xt_info_locks
);
if
(
likely
(
!--
lock
->
readers
))
spin_unlock
(
&
lock
->
lock
);
...
...
net/ipv4/netfilter/arp_tables.c
View file @
21ece08c
...
...
@@ -709,7 +709,7 @@ static void get_counters(const struct xt_table_info *t,
{
unsigned
int
cpu
;
unsigned
int
i
;
unsigned
int
curcpu
;
unsigned
int
curcpu
=
NR_CPUS
;
/* Instead of clearing (by a previous call to memset())
* the counters and using adds, we set the counters
...
...
@@ -719,6 +719,7 @@ static void get_counters(const struct xt_table_info *t,
* if new softirq were to run and call ipt_do_table
*/
local_bh_disable
();
#ifndef CONFIG_PREEMPT_RT
curcpu
=
smp_processor_id
();
i
=
0
;
...
...
@@ -727,7 +728,7 @@ static void get_counters(const struct xt_table_info *t,
set_entry_to_counter
,
counters
,
&
i
);
#endif
for_each_possible_cpu
(
cpu
)
{
if
(
cpu
==
curcpu
)
continue
;
...
...
net/ipv4/netfilter/ip_tables.c
View file @
21ece08c
...
...
@@ -348,7 +348,7 @@ ipt_do_table(struct sk_buff *skb,
IP_NF_ASSERT
(
table
->
valid_hooks
&
(
1
<<
hook
));
xt_info_rdlock_bh
();
private
=
table
->
private
;
table_base
=
private
->
entries
[
smp_processor_id
()];
table_base
=
private
->
entries
[
raw_
smp_processor_id
()];
e
=
get_entry
(
table_base
,
private
->
hook_entry
[
hook
]);
...
...
@@ -892,7 +892,7 @@ get_counters(const struct xt_table_info *t,
{
unsigned
int
cpu
;
unsigned
int
i
;
unsigned
int
curcpu
;
unsigned
int
curcpu
=
NR_CPUS
;
/* Instead of clearing (by a previous call to memset())
* the counters and using adds, we set the counters
...
...
@@ -902,6 +902,7 @@ get_counters(const struct xt_table_info *t,
* if new softirq were to run and call ipt_do_table
*/
local_bh_disable
();
#ifndef CONFIG_PREEMPT_RT
curcpu
=
smp_processor_id
();
i
=
0
;
...
...
@@ -910,7 +911,7 @@ get_counters(const struct xt_table_info *t,
set_entry_to_counter
,
counters
,
&
i
);
#endif
for_each_possible_cpu
(
cpu
)
{
if
(
cpu
==
curcpu
)
continue
;
...
...
@@ -1391,7 +1392,7 @@ do_add_counters(struct net *net, void __user *user, unsigned int len, int compat
i
=
0
;
/* Choose the copy that is on our node */
curcpu
=
smp_processor_id
();
curcpu
=
raw_
smp_processor_id
();
loc_cpu_entry
=
private
->
entries
[
curcpu
];
xt_info_wrlock
(
curcpu
);
IPT_ENTRY_ITERATE
(
loc_cpu_entry
,
...
...
net/ipv6/netfilter/ip6_tables.c
View file @
21ece08c
...
...
@@ -921,7 +921,7 @@ get_counters(const struct xt_table_info *t,
{
unsigned
int
cpu
;
unsigned
int
i
;
unsigned
int
curcpu
;
unsigned
int
curcpu
=
NR_CPUS
;
/* Instead of clearing (by a previous call to memset())
* the counters and using adds, we set the counters
...
...
@@ -931,6 +931,8 @@ get_counters(const struct xt_table_info *t,
* if new softirq were to run and call ipt_do_table
*/
local_bh_disable
();
#ifndef CONFIG_PREEMPT_RT
curcpu
=
smp_processor_id
();
i
=
0
;
...
...
@@ -939,7 +941,7 @@ get_counters(const struct xt_table_info *t,
set_entry_to_counter
,
counters
,
&
i
);
#endif
for_each_possible_cpu
(
cpu
)
{
if
(
cpu
==
curcpu
)
continue
;
...
...
@@ -960,12 +962,13 @@ static struct xt_counters *alloc_counters(struct xt_table *table)
unsigned
int
countersize
;
struct
xt_counters
*
counters
;
struct
xt_table_info
*
private
=
table
->
private
;
int
node
=
cpu_to_node
(
raw_smp_processor_id
());
/* We need atomic snapshot of counters: rest doesn't change
(other than comefrom, which userspace doesn't care
about). */
countersize
=
sizeof
(
struct
xt_counters
)
*
private
->
number
;
counters
=
vmalloc_node
(
countersize
,
n
uma_node_id
()
);
counters
=
vmalloc_node
(
countersize
,
n
ode
);
if
(
counters
==
NULL
)
return
ERR_PTR
(
-
ENOMEM
);
...
...
@@ -1423,7 +1426,7 @@ do_add_counters(struct net *net, void __user *user, unsigned int len,
i
=
0
;
/* Choose the copy that is on our node */
curcpu
=
smp_processor_id
();
curcpu
=
raw_
smp_processor_id
();
xt_info_wrlock
(
curcpu
);
loc_cpu_entry
=
private
->
entries
[
curcpu
];
IP6T_ENTRY_ITERATE
(
loc_cpu_entry
,
...
...
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