Skip to content

Commit 575f9c4

Browse files
committed
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/klassert/ipsec-next
Steffen Klassert says: ==================== ipsec-next 2016-09-08 1) Constify the xfrm_replay structures. From Julia Lawall 2) Protect xfrm state hash tables with rcu, lookups can be done now without acquiring xfrm_state_lock. From Florian Westphal. 3) Protect xfrm policy hash tables with rcu, lookups can be done now without acquiring xfrm_policy_lock. From Florian Westphal. 4) We don't need to have a garbage collector list per namespace anymore, so use a global one instead. From Florian Westphal. ==================== Signed-off-by: David S. Miller <[email protected]>
2 parents 0f76d25 + 35db57b commit 575f9c4

File tree

5 files changed

+173
-113
lines changed

5 files changed

+173
-113
lines changed

include/net/netns/xfrm.h

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
struct ctl_table_header;
1212

1313
struct xfrm_policy_hash {
14-
struct hlist_head *table;
14+
struct hlist_head __rcu *table;
1515
unsigned int hmask;
1616
u8 dbits4;
1717
u8 sbits4;
@@ -38,14 +38,12 @@ struct netns_xfrm {
3838
* mode. Also, it can be used by ah/esp icmp error handler to find
3939
* offending SA.
4040
*/
41-
struct hlist_head *state_bydst;
42-
struct hlist_head *state_bysrc;
43-
struct hlist_head *state_byspi;
41+
struct hlist_head __rcu *state_bydst;
42+
struct hlist_head __rcu *state_bysrc;
43+
struct hlist_head __rcu *state_byspi;
4444
unsigned int state_hmask;
4545
unsigned int state_num;
4646
struct work_struct state_hash_work;
47-
struct hlist_head state_gc_list;
48-
struct work_struct state_gc_work;
4947

5048
struct list_head policy_all;
5149
struct hlist_head *policy_byidx;
@@ -73,7 +71,7 @@ struct netns_xfrm {
7371
struct dst_ops xfrm6_dst_ops;
7472
#endif
7573
spinlock_t xfrm_state_lock;
76-
rwlock_t xfrm_policy_lock;
74+
spinlock_t xfrm_policy_lock;
7775
struct mutex xfrm_cfg_mutex;
7876

7977
/* flow cache part */

include/net/xfrm.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ struct xfrm_state {
187187
struct xfrm_replay_state_esn *preplay_esn;
188188

189189
/* The functions for replay detection. */
190-
struct xfrm_replay *repl;
190+
const struct xfrm_replay *repl;
191191

192192
/* internal flag that only holds state for delayed aevent at the
193193
* moment

0 commit comments

Comments
 (0)