Skip to content

RFC l2tp: simplify tunnel and session cleanup

James Chapman netdev 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest15 patches 2 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/15l2tp: lookup tunnel from socket without using sk_user_datanet/l2tp/l2tp_core.c net/l2tp/l2tp_core.h net/l2tp/l2tp_ip.c +1 more+54 -172 replies
2/15ipv4: export ip_flush_pending_framesnet/ipv4/ip_output.c+1 -00 replies
3/15l2tp: have l2tp_ip_destroy_sock use ip_flush_pending_framesnet/l2tp/l2tp_ip.c+3 -30 replies
4/15l2tp: don't use tunnel socket sk_user_data in ppp procfs outputnet/l2tp/l2tp_ppp.c+1 -10 replies
5/15l2tp: don't set sk_user_data in tunnel socketnet/l2tp/l2tp_core.c+6 -40 replies
6/15l2tp: remove unused tunnel magic fieldnet/l2tp/l2tp_core.c net/l2tp/l2tp_core.h+0 -40 replies
7/15l2tp: simplify tunnel and socket cleanupnet/l2tp/l2tp_core.c net/l2tp/l2tp_core.h+21 -620 replies
8/15l2tp: delete sessions using work queuenet/l2tp/l2tp_core.c net/l2tp/l2tp_core.h+21 -160 replies
9/15l2tp: free sessions using rcunet/l2tp/l2tp_core.c net/l2tp/l2tp_core.h+2 -30 replies
10/15l2tp: refactor ppp socket/session relationshipnet/l2tp/l2tp_ppp.c+39 -550 replies
11/15l2tp: prevent possible tunnel refcount underflownet/l2tp/l2tp_core.c net/l2tp/l2tp_core.h net/l2tp/l2tp_netlink.c +1 more+24 -100 replies
12/15l2tp: use rcu list add/del when updating listsnet/l2tp/l2tp_core.c+6 -60 replies
13/15l2tp: add idr consistency check in session_registernet/l2tp/l2tp_core.c+9 -20 replies
14/15l2tp: cleanup eth/ppp pseudowire setup codenet/l2tp/l2tp_eth.c net/l2tp/l2tp_ppp.c+6 -40 replies
15/15l2tp: use pre_exit pernet hook to avoid rcu_barriernet/l2tp/l2tp_core.c+7 -20 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [RFC PATCH 00/15] l2tp: simplify tunnel and session cleanup

This series simplifies and improves l2tp tunnel and session cleanup.

* refactor l2tp management code to not use the tunnel socket's sk_user_data. This allows the tunnel and its socket to be closed and freed without sequencing the two using the socket's sk_destruct hook.

* export ip_flush_pending_frames and use it when closing l2tp_ip sockets.

* move the work of closing all sessions in the tunnel to the work queue so that sessions are deleted using the same codepath whether they are closed by user API request or their parent tunnel is closing.

* refactor l2tp_ppp to have session lifetimes managed by the session's refcount such that the session holds a ref on its pppox socket while it references it. Previously the pppox socket held a ref on the session, which complicated session delete by having to go through the socket destructor.

* free sessions and pppox sockets by rcu.

* fix a possible tunnel refcount underflow.

* avoid using rcu_barrier in net exit handler.

James Chapman (15):
l2tp: lookup tunnel from socket without using sk_user_data
ipv4: export ip_flush_pending_frames
l2tp: have l2tp_ip_destroy_sock use ip_flush_pending_frames
l2tp: don't use tunnel socket sk_user_data in ppp procfs output
l2tp: don't set sk_user_data in tunnel socket
l2tp: remove unused tunnel magic field
l2tp: simplify tunnel and socket cleanup
l2tp: delete sessions using work queue
l2tp: free sessions using rcu
l2tp: refactor ppp socket/session relationship
l2tp: prevent possible tunnel refcount underflow
l2tp: use rcu list add/del when updating lists
l2tp: add idr consistency check in session_register
l2tp: cleanup eth/ppp pseudowire setup code
l2tp: use pre_exit pernet hook to avoid rcu_barrier

 net/ipv4/ip_output.c    |   1 +
 net/l2tp/l2tp_core.c    | 199 ++++++++++++++++++++++------------------
 net/l2tp/l2tp_core.h    |  14 +--
 net/l2tp/l2tp_eth.c     |   2 +-
 net/l2tp/l2tp_ip.c      |  13 ++-
 net/l2tp/l2tp_ip6.c     |   7 +-
 net/l2tp/l2tp_netlink.c |   4 +-
 net/l2tp/l2tp_ppp.c     | 107 ++++++++++-----------
 8 files changed, 179 insertions(+), 168 deletions(-)
Signature · 1 line
2.34.1