mbox series

[net-next,00/15] l2tp: simplify tunnel and session cleanup

Message ID cover.1722265212.git.jchapman@katalix.com (mailing list archive)
Headers show
Series l2tp: simplify tunnel and session cleanup | expand

Message

James Chapman July 29, 2024, 3:37 p.m. UTC
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 pppox socket / session relationship to have the
   session keep the socket alive, not the other way around. Previously
   the pppox socket held a ref on the session, which complicated
   session delete by having to go through the pppox 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(-)

Comments

patchwork-bot+netdevbpf@kernel.org July 31, 2024, 8:30 a.m. UTC | #1
Hello:

This series was applied to netdev/net-next.git (main)
by David S. Miller <davem@davemloft.net>:

On Mon, 29 Jul 2024 16:37:59 +0100 you wrote:
> 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.
> 
> [...]

Here is the summary with links:
  - [net-next,01/15] l2tp: lookup tunnel from socket without using sk_user_data
    https://git.kernel.org/netdev/net-next/c/2e7a280692bf
  - [net-next,02/15] ipv4: export ip_flush_pending_frames
    https://git.kernel.org/netdev/net-next/c/4ff8863419cd
  - [net-next,03/15] l2tp: have l2tp_ip_destroy_sock use ip_flush_pending_frames
    https://git.kernel.org/netdev/net-next/c/ed8ebee6def7
  - [net-next,04/15] l2tp: don't use tunnel socket sk_user_data in ppp procfs output
    https://git.kernel.org/netdev/net-next/c/eeb11209e000
  - [net-next,05/15] l2tp: don't set sk_user_data in tunnel socket
    https://git.kernel.org/netdev/net-next/c/4a4cd70369f1
  - [net-next,06/15] l2tp: remove unused tunnel magic field
    https://git.kernel.org/netdev/net-next/c/0fa51a7c6f54
  - [net-next,07/15] l2tp: simplify tunnel and socket cleanup
    https://git.kernel.org/netdev/net-next/c/29717a4fb7fc
  - [net-next,08/15] l2tp: delete sessions using work queue
    https://git.kernel.org/netdev/net-next/c/fc7ec7f554d7
  - [net-next,09/15] l2tp: free sessions using rcu
    https://git.kernel.org/netdev/net-next/c/d17e89999574
  - [net-next,10/15] l2tp: refactor ppp socket/session relationship
    https://git.kernel.org/netdev/net-next/c/c5cbaef992d6
  - [net-next,11/15] l2tp: prevent possible tunnel refcount underflow
    https://git.kernel.org/netdev/net-next/c/24256415d186
  - [net-next,12/15] l2tp: use rcu list add/del when updating lists
    https://git.kernel.org/netdev/net-next/c/89b768ec2dfe
  - [net-next,13/15] l2tp: add idr consistency check in session_register
    https://git.kernel.org/netdev/net-next/c/0aa45570c324
  - [net-next,14/15] l2tp: cleanup eth/ppp pseudowire setup code
    https://git.kernel.org/netdev/net-next/c/d93b8a63f011
  - [net-next,15/15] l2tp: use pre_exit pernet hook to avoid rcu_barrier
    https://git.kernel.org/netdev/net-next/c/5dfa598b249c

You are awesome, thank you!