Loading include/net/netns/xfrm.h +3 −3 Original line number Diff line number Diff line Loading @@ -38,9 +38,9 @@ struct netns_xfrm { * mode. Also, it can be used by ah/esp icmp error handler to find * offending SA. */ struct hlist_head *state_bydst; struct hlist_head *state_bysrc; struct hlist_head *state_byspi; struct hlist_head __rcu *state_bydst; struct hlist_head __rcu *state_bysrc; struct hlist_head __rcu *state_byspi; unsigned int state_hmask; unsigned int state_num; struct work_struct state_hash_work; Loading net/xfrm/xfrm_state.c +4 −2 Original line number Diff line number Diff line Loading @@ -799,7 +799,7 @@ xfrm_state_find(const xfrm_address_t *daddr, const xfrm_address_t *saddr, sequence = read_seqcount_begin(&xfrm_state_hash_generation); spin_lock_bh(&net->xfrm.xfrm_state_lock); rcu_read_lock(); h = xfrm_dst_hash(net, daddr, saddr, tmpl->reqid, encap_family); hlist_for_each_entry_rcu(x, net->xfrm.state_bydst + h, bydst) { if (x->props.family == encap_family && Loading Loading @@ -870,6 +870,7 @@ xfrm_state_find(const xfrm_address_t *daddr, const xfrm_address_t *saddr, } if (km_query(x, tmpl, pol) == 0) { spin_lock_bh(&net->xfrm.xfrm_state_lock); x->km.state = XFRM_STATE_ACQ; list_add(&x->km.all, &net->xfrm.state_all); hlist_add_head_rcu(&x->bydst, net->xfrm.state_bydst + h); Loading @@ -883,6 +884,7 @@ xfrm_state_find(const xfrm_address_t *daddr, const xfrm_address_t *saddr, tasklet_hrtimer_start(&x->mtimer, ktime_set(net->xfrm.sysctl_acq_expires, 0), HRTIMER_MODE_REL); net->xfrm.state_num++; xfrm_hash_grow_check(net, x->bydst.next != NULL); spin_unlock_bh(&net->xfrm.xfrm_state_lock); } else { x->km.state = XFRM_STATE_DEAD; to_put = x; Loading @@ -899,7 +901,7 @@ xfrm_state_find(const xfrm_address_t *daddr, const xfrm_address_t *saddr, } else { *err = acquire_in_progress ? -EAGAIN : error; } spin_unlock_bh(&net->xfrm.xfrm_state_lock); rcu_read_unlock(); if (to_put) xfrm_state_put(to_put); Loading Loading
include/net/netns/xfrm.h +3 −3 Original line number Diff line number Diff line Loading @@ -38,9 +38,9 @@ struct netns_xfrm { * mode. Also, it can be used by ah/esp icmp error handler to find * offending SA. */ struct hlist_head *state_bydst; struct hlist_head *state_bysrc; struct hlist_head *state_byspi; struct hlist_head __rcu *state_bydst; struct hlist_head __rcu *state_bysrc; struct hlist_head __rcu *state_byspi; unsigned int state_hmask; unsigned int state_num; struct work_struct state_hash_work; Loading
net/xfrm/xfrm_state.c +4 −2 Original line number Diff line number Diff line Loading @@ -799,7 +799,7 @@ xfrm_state_find(const xfrm_address_t *daddr, const xfrm_address_t *saddr, sequence = read_seqcount_begin(&xfrm_state_hash_generation); spin_lock_bh(&net->xfrm.xfrm_state_lock); rcu_read_lock(); h = xfrm_dst_hash(net, daddr, saddr, tmpl->reqid, encap_family); hlist_for_each_entry_rcu(x, net->xfrm.state_bydst + h, bydst) { if (x->props.family == encap_family && Loading Loading @@ -870,6 +870,7 @@ xfrm_state_find(const xfrm_address_t *daddr, const xfrm_address_t *saddr, } if (km_query(x, tmpl, pol) == 0) { spin_lock_bh(&net->xfrm.xfrm_state_lock); x->km.state = XFRM_STATE_ACQ; list_add(&x->km.all, &net->xfrm.state_all); hlist_add_head_rcu(&x->bydst, net->xfrm.state_bydst + h); Loading @@ -883,6 +884,7 @@ xfrm_state_find(const xfrm_address_t *daddr, const xfrm_address_t *saddr, tasklet_hrtimer_start(&x->mtimer, ktime_set(net->xfrm.sysctl_acq_expires, 0), HRTIMER_MODE_REL); net->xfrm.state_num++; xfrm_hash_grow_check(net, x->bydst.next != NULL); spin_unlock_bh(&net->xfrm.xfrm_state_lock); } else { x->km.state = XFRM_STATE_DEAD; to_put = x; Loading @@ -899,7 +901,7 @@ xfrm_state_find(const xfrm_address_t *daddr, const xfrm_address_t *saddr, } else { *err = acquire_in_progress ? -EAGAIN : error; } spin_unlock_bh(&net->xfrm.xfrm_state_lock); rcu_read_unlock(); if (to_put) xfrm_state_put(to_put); Loading