Skip to contentSkip to conversation

pull request (net-next): ipsec-next 2016-09-23

PATCH New Steffen Klassert 2 participants 4 messages Sep 23, 2016 – Sep 24, 2016

Subsystems (3)
lore
Share & tools
lore

Steffen Klassert

author maintainer
#0 lore raw

Only two patches this time:

1) Fix a comment reference to struct xfrm_replay_state_esn. From Richard Guy Briggs.

2) Convert xfrm_state_lookup to rcu, we don't need the xfrm_state_lock anymore in the input path. From Florian Westphal.

Please pull or let me know if there are problems.

Thanks!

The following changes since commit 2d2be8cab26ed918e94d2deae89580003242a123:

bpf: fix range propagation on direct packet access (2016-09-08 17:28:37 -0700)

are available in the git repository at:

git://git.kernel.org/pub/scm/linux/kernel/git/klassert/ipsec-next.git master

for you to fetch changes up to c2f672fc94642bae96821a393f342edcfa9794a6:

xfrm: state lookup can be lockless (2016-09-21 12:37:29 +0200)

----------------------------------------------------------------
Florian Westphal (1):
xfrm: state lookup can be lockless

Richard Guy Briggs (1):
xfrm: fix header file comment reference to struct xfrm_replay_state_esn

 include/uapi/linux/xfrm.h | 2 +-
 net/xfrm/xfrm_state.c     | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)
author maintainer
#1 lore raw

PATCH 1/2 xfrm: fix header file comment reference to struct xfrm_replay_state_esn

From: Richard Guy Briggs <[email protected]>

---
 include/uapi/linux/xfrm.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/uapi/linux/xfrm.h +1 -1
index 1433389..1fc62b2 100644
@@ -298,7 +298,7 @@ enum xfrm_attr_type_t {
 	XFRMA_ALG_AUTH_TRUNC,	/* struct xfrm_algo_auth */
 	XFRMA_MARK,		/* struct xfrm_mark */
 	XFRMA_TFCPAD,		/* __u32 */
-	XFRMA_REPLAY_ESN_VAL,	/* struct xfrm_replay_esn */
+	XFRMA_REPLAY_ESN_VAL,	/* struct xfrm_replay_state_esn */
 	XFRMA_SA_EXTRA_FLAGS,	/* __u32 */
 	XFRMA_PROTO,		/* __u8 */
 	XFRMA_ADDRESS_FILTER,	/* struct xfrm_address_filter */
Signature · 1 line
1.9.1
author maintainer
#2 lore raw

PATCH 2/2 xfrm: state lookup can be lockless

In reply to Steffen Klassert

From: Florian Westphal <[email protected]>

This is called from the packet input path, we get lock contention if many cpus handle ipsec in parallel.

After recent rcu conversion it is safe to call __xfrm_state_lookup without the spinlock.

---
 net/xfrm/xfrm_state.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
net/xfrm/xfrm_state.c +2 -2
index ba8bf51..a38fdea 100644
@@ -1431,9 +1431,9 @@ xfrm_state_lookup(struct net *net, u32 mark, const xfrm_address_t *daddr, __be32
 {
 	struct xfrm_state *x;
 
-	spin_lock_bh(&net->xfrm.xfrm_state_lock);
+	rcu_read_lock();
 	x = __xfrm_state_lookup(net, mark, daddr, spi, proto, family);
-	spin_unlock_bh(&net->xfrm.xfrm_state_lock);
+	rcu_read_unlock();
 	return x;
 }
 EXPORT_SYMBOL(xfrm_state_lookup);
Signature · 1 line
1.9.1
maintainer
#3 lore raw
In reply to Steffen Klassert

From: Steffen Klassert <[email protected]>
Date: Fri, 23 Sep 2016 09:14:40 +0200

Quoted 10 lines

Only two patches this time:

1) Fix a comment reference to struct xfrm_replay_state_esn. From Richard Guy Briggs.

2) Convert xfrm_state_lookup to rcu, we don't need the xfrm_state_lock anymore in the input path. From Florian Westphal.

Please pull or let me know if there are problems.

Pulled, thanks Steffen.