xfrm: move the checking for old xfrm_policy hold_queue to beginning
Subsystems (3)
PATCH 1/1 xfrm: move the checking for old xfrm_policy hold_queue to beginning
From: Li RongQing <[email protected]>
if hold_queue of old xfrm_policy is NULL, return directly, then not need to run other codes, especially take the spin lock
Signed-off-by Li RongQing <[email protected]>
--- net/xfrm/xfrm_policy.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
net/xfrm/xfrm_policy.c +3 -3
@@ -708,6 +708,9 @@ static void xfrm_policy_requeue(struct xfrm_policy *old,struct xfrm_policy_queue *pq = &old->polq;struct sk_buff_head list; +if (skb_queue_empty (&pq->hold_queue)) +return ; +__skb_queue_head_init (&list);spin_lock_bh (&pq->hold_queue.lock);
@@ -716,9 +719,6 @@ static void xfrm_policy_requeue(struct xfrm_policy *old,xfrm_pol_put (old);spin_unlock_bh (&pq->hold_queue.lock); -if (skb_queue_empty (&list)) -return ; - pq = &new->polq;spin_lock_bh (&pq->hold_queue.lock);
Signature · 1 line
2.1.0
Steffen Klassert
maintainerQuoted 6 lines · On Thu, Apr 30, 2015 at 05:25:19PM +0800, [email protected] wrote:
From: Li RongQing <[email protected]>
if
hold_queueof oldxfrm_policyis NULL, return directly, then not need to run other codes, especially take the spin lockSigned-off-by Li RongQing <[email protected]>
Also applied to ipsec-next, thanks a lot!