Commit 0b35f60
netfilter: Remove duplicated rcu_read_lock.
This patch removes duplicate rcu_read_lock().
1. IPVS part:
According to Julian Anastasov's mention, contexts of ipvs are described
at: http://marc.info/?l=netfilter-devel&m=149562884514072&w=2, in summary:
- packet RX/TX: does not need locks because packets come from hooks.
- sync msg RX: backup server uses RCU locks while registering new
connections.
- ip_vs_ctl.c: configuration get/set, RCU locks needed.
- xt_ipvs.c: It is a netfilter match, running from hook context.
As result, rcu_read_lock and rcu_read_unlock can be removed from:
- ip_vs_core.c: all
- ip_vs_ctl.c:
- only from ip_vs_has_real_service
- ip_vs_ftp.c: all
- ip_vs_proto_sctp.c: all
- ip_vs_proto_tcp.c: all
- ip_vs_proto_udp.c: all
- ip_vs_xmit.c: all (contains only packet processing)
2. Netfilter part:
There are three types of functions that are guaranteed the rcu_read_lock().
First, as result, functions are only called by nf_hook():
- nf_conntrack_broadcast_help(), pptp_expectfn(), set_expected_rtp_rtcp().
- tcpmss_reverse_mtu(), tproxy_laddr4(), tproxy_laddr6().
- match_lookup_rt6(), check_hlist(), hashlimit_mt_common().
- xt_osf_match_packet().
Second, functions that caller already held the rcu_read_lock().
- destroy_conntrack(), ctnetlink_conntrack_event().
- ctnl_timeout_find_get(), nfqnl_nf_hook_drop().
Third, functions that are mixed with type1 and type2.
These functions are called by nf_hook() also these are called by
ordinary functions that already held the rcu_read_lock():
- __ctnetlink_glue_build(), ctnetlink_expect_event().
- ctnetlink_proto_size().
Applied files are below:
- nf_conntrack_broadcast.c, nf_conntrack_core.c, nf_conntrack_netlink.c.
- nf_conntrack_pptp.c, nf_conntrack_sip.c, nfnetlink_cttimeout.c.
- nfnetlink_queue.c, xt_TCPMSS.c, xt_TPROXY.c, xt_addrtype.c.
- xt_connlimit.c, xt_hashlimit.c, xt_osf.c
Detailed calltrace can be found at:
http://marc.info/?l=netfilter-devel&m=149667610710350&w=2
Signed-off-by: Taehee Yoo <ap420073@gmail.com>
Acked-by: Julian Anastasov <ja@ssi.bg>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>1 parent 9f08ea8 commit 0b35f60
File tree
20 files changed
+13
-128
lines changed- net/netfilter
- ipvs
20 files changed
+13
-128
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
125 | 125 | | |
126 | 126 | | |
127 | 127 | | |
128 | | - | |
129 | 128 | | |
130 | 129 | | |
131 | 130 | | |
132 | 131 | | |
133 | 132 | | |
134 | 133 | | |
135 | | - | |
136 | 134 | | |
137 | 135 | | |
138 | 136 | | |
| |||
159 | 157 | | |
160 | 158 | | |
161 | 159 | | |
162 | | - | |
163 | 160 | | |
164 | 161 | | |
165 | 162 | | |
166 | 163 | | |
167 | 164 | | |
168 | 165 | | |
169 | | - | |
170 | 166 | | |
171 | 167 | | |
172 | 168 | | |
| |||
1222 | 1218 | | |
1223 | 1219 | | |
1224 | 1220 | | |
1225 | | - | |
1226 | 1221 | | |
1227 | 1222 | | |
1228 | 1223 | | |
| |||
1237 | 1232 | | |
1238 | 1233 | | |
1239 | 1234 | | |
1240 | | - | |
1241 | 1235 | | |
1242 | 1236 | | |
1243 | 1237 | | |
| |||
1689 | 1683 | | |
1690 | 1684 | | |
1691 | 1685 | | |
1692 | | - | |
1693 | 1686 | | |
1694 | 1687 | | |
1695 | 1688 | | |
1696 | | - | |
1697 | 1689 | | |
1698 | 1690 | | |
1699 | 1691 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
550 | 550 | | |
551 | 551 | | |
552 | 552 | | |
553 | | - | |
554 | 553 | | |
555 | 554 | | |
556 | 555 | | |
557 | 556 | | |
558 | 557 | | |
559 | 558 | | |
560 | | - | |
561 | 559 | | |
562 | 560 | | |
563 | 561 | | |
564 | | - | |
565 | 562 | | |
566 | 563 | | |
567 | 564 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
269 | 269 | | |
270 | 270 | | |
271 | 271 | | |
272 | | - | |
273 | 272 | | |
274 | 273 | | |
275 | 274 | | |
276 | 275 | | |
277 | 276 | | |
278 | | - | |
279 | 277 | | |
280 | 278 | | |
281 | 279 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | | - | |
42 | 41 | | |
43 | 42 | | |
44 | 43 | | |
| |||
53 | 52 | | |
54 | 53 | | |
55 | 54 | | |
56 | | - | |
57 | 55 | | |
58 | 56 | | |
59 | 57 | | |
| |||
67 | 65 | | |
68 | 66 | | |
69 | 67 | | |
70 | | - | |
71 | 68 | | |
72 | 69 | | |
73 | 70 | | |
74 | | - | |
75 | 71 | | |
76 | 72 | | |
77 | 73 | | |
| |||
526 | 522 | | |
527 | 523 | | |
528 | 524 | | |
529 | | - | |
530 | 525 | | |
531 | 526 | | |
532 | 527 | | |
533 | 528 | | |
534 | | - | |
535 | 529 | | |
536 | 530 | | |
537 | 531 | | |
| |||
544 | 538 | | |
545 | 539 | | |
546 | 540 | | |
547 | | - | |
| 541 | + | |
548 | 542 | | |
549 | 543 | | |
550 | | - | |
551 | | - | |
| 544 | + | |
552 | 545 | | |
553 | 546 | | |
554 | 547 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
66 | | - | |
67 | 66 | | |
68 | 67 | | |
69 | 68 | | |
| |||
80 | 79 | | |
81 | 80 | | |
82 | 81 | | |
83 | | - | |
84 | 82 | | |
85 | 83 | | |
86 | 84 | | |
| |||
95 | 93 | | |
96 | 94 | | |
97 | 95 | | |
98 | | - | |
99 | 96 | | |
100 | 97 | | |
101 | 98 | | |
102 | | - | |
103 | 99 | | |
104 | 100 | | |
105 | 101 | | |
| |||
661 | 657 | | |
662 | 658 | | |
663 | 659 | | |
664 | | - | |
665 | 660 | | |
666 | 661 | | |
667 | 662 | | |
668 | 663 | | |
669 | | - | |
670 | 664 | | |
671 | 665 | | |
672 | 666 | | |
| |||
680 | 674 | | |
681 | 675 | | |
682 | 676 | | |
683 | | - | |
| 677 | + | |
684 | 678 | | |
685 | 679 | | |
686 | | - | |
687 | 680 | | |
688 | | - | |
689 | 681 | | |
690 | 682 | | |
691 | 683 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
56 | | - | |
57 | 56 | | |
58 | 57 | | |
59 | 58 | | |
| |||
69 | 68 | | |
70 | 69 | | |
71 | 70 | | |
72 | | - | |
73 | 71 | | |
74 | 72 | | |
75 | 73 | | |
| |||
84 | 82 | | |
85 | 83 | | |
86 | 84 | | |
87 | | - | |
88 | 85 | | |
89 | 86 | | |
90 | 87 | | |
91 | | - | |
92 | 88 | | |
93 | 89 | | |
94 | 90 | | |
| |||
410 | 406 | | |
411 | 407 | | |
412 | 408 | | |
413 | | - | |
414 | 409 | | |
415 | 410 | | |
416 | 411 | | |
417 | 412 | | |
418 | | - | |
419 | 413 | | |
420 | 414 | | |
421 | 415 | | |
| |||
429 | 423 | | |
430 | 424 | | |
431 | 425 | | |
432 | | - | |
| 426 | + | |
433 | 427 | | |
434 | 428 | | |
435 | | - | |
436 | 429 | | |
437 | | - | |
438 | 430 | | |
439 | 431 | | |
440 | 432 | | |
| |||
0 commit comments