netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 net-next 00/15] inet: socket lock and data-races avoidance
@ 2023-08-11  7:36 Eric Dumazet
  2023-08-11  7:36 ` [PATCH v2 net-next 01/15] inet: introduce inet->inet_flags Eric Dumazet
                   ` (14 more replies)
  0 siblings, 15 replies; 18+ messages in thread
From: Eric Dumazet @ 2023-08-11  7:36 UTC (permalink / raw)
  To: David S . Miller, Jakub Kicinski, Paolo Abeni
  Cc: Simon Horman, Soheil Hassas Yeganeh, netdev, eric.dumazet,
	Eric Dumazet

In this series, I converted 20 bits in "struct inet_sock" and made
them truly atomic.

This allows to implement many IP_ socket options in a lockless
fashion (no need to acquire socket lock), and fixes data-races
that were showing up in various KCSAN reports.

I also took care of IP_TTL/IP_MINTTL, but left few other options
for another series.

v2: addressed a feedback from a build bot in patch 9 by removing
 unused issk variable in mptcp_setsockopt_sol_ip_set_transparent()
 Added Acked-by: tags from Soheil (thanks!)

Eric Dumazet (15):
  inet: introduce inet->inet_flags
  inet: set/get simple options locklessly
  inet: move inet->recverr to inet->inet_flags
  inet: move inet->recverr_rfc4884 to inet->inet_flags
  inet: move inet->freebind to inet->inet_flags
  inet: move inet->hdrincl to inet->inet_flags
  inet: move inet->mc_loop to inet->inet_frags
  inet: move inet->mc_all to inet->inet_frags
  inet: move inet->transparent to inet->inet_flags
  inet: move inet->is_icsk to inet->inet_flags
  inet: move inet->nodefrag to inet->inet_flags
  inet: move inet->bind_address_no_port to inet->inet_flags
  inet: move inet->defer_connect to inet->inet_flags
  inet: implement lockless IP_TTL
  inet: implement lockless IP_MINTTL

 include/net/inet_connection_sock.h  |   4 +-
 include/net/inet_sock.h             |  92 ++++---
 include/net/ipv6.h                  |   3 +-
 include/net/route.h                 |   2 +-
 include/net/tcp.h                   |   2 +-
 net/core/sock.c                     |   2 +-
 net/dccp/ipv4.c                     |   4 +-
 net/ipv4/af_inet.c                  |  16 +-
 net/ipv4/cipso_ipv4.c               |   4 +-
 net/ipv4/igmp.c                     |   2 +-
 net/ipv4/inet_diag.c                |  22 +-
 net/ipv4/inet_timewait_sock.c       |   2 +-
 net/ipv4/ip_output.c                |   7 +-
 net/ipv4/ip_sockglue.c              | 405 +++++++++++++---------------
 net/ipv4/netfilter/nf_defrag_ipv4.c |   2 +-
 net/ipv4/ping.c                     |   7 +-
 net/ipv4/raw.c                      |  26 +-
 net/ipv4/route.c                    |   8 +-
 net/ipv4/tcp.c                      |  12 +-
 net/ipv4/tcp_fastopen.c             |   2 +-
 net/ipv4/tcp_input.c                |   2 +-
 net/ipv4/tcp_ipv4.c                 |   5 +-
 net/ipv4/tcp_minisocks.c            |   3 +-
 net/ipv4/udp.c                      |   7 +-
 net/ipv4/udp_tunnel_core.c          |   2 +-
 net/ipv6/af_inet6.c                 |   8 +-
 net/ipv6/datagram.c                 |   2 +-
 net/ipv6/ip6_output.c               |   5 +-
 net/ipv6/ipv6_sockglue.c            |  12 +-
 net/ipv6/raw.c                      |  16 +-
 net/ipv6/udp.c                      |   2 +-
 net/l2tp/l2tp_ip.c                  |   2 +-
 net/mptcp/protocol.c                |  12 +-
 net/mptcp/sockopt.c                 |  19 +-
 net/netfilter/ipvs/ip_vs_core.c     |   4 +-
 net/sctp/input.c                    |   2 +-
 net/sctp/protocol.c                 |   2 +-
 net/sctp/socket.c                   |   2 +-
 38 files changed, 364 insertions(+), 367 deletions(-)

-- 
2.41.0.640.ga95def55d0-goog


^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2023-08-11 15:48 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-11  7:36 [PATCH v2 net-next 00/15] inet: socket lock and data-races avoidance Eric Dumazet
2023-08-11  7:36 ` [PATCH v2 net-next 01/15] inet: introduce inet->inet_flags Eric Dumazet
2023-08-11  7:36 ` [PATCH v2 net-next 02/15] inet: set/get simple options locklessly Eric Dumazet
2023-08-11  7:36 ` [PATCH v2 net-next 03/15] inet: move inet->recverr to inet->inet_flags Eric Dumazet
2023-08-11  7:36 ` [PATCH v2 net-next 04/15] inet: move inet->recverr_rfc4884 " Eric Dumazet
2023-08-11  7:36 ` [PATCH v2 net-next 05/15] inet: move inet->freebind " Eric Dumazet
2023-08-11  7:36 ` [PATCH v2 net-next 06/15] inet: move inet->hdrincl " Eric Dumazet
2023-08-11  7:36 ` [PATCH v2 net-next 07/15] inet: move inet->mc_loop to inet->inet_frags Eric Dumazet
2023-08-11 14:10   ` kernel test robot
2023-08-11 15:48     ` Eric Dumazet
2023-08-11  7:36 ` [PATCH v2 net-next 08/15] inet: move inet->mc_all " Eric Dumazet
2023-08-11  7:36 ` [PATCH v2 net-next 09/15] inet: move inet->transparent to inet->inet_flags Eric Dumazet
2023-08-11  7:36 ` [PATCH v2 net-next 10/15] inet: move inet->is_icsk " Eric Dumazet
2023-08-11  7:36 ` [PATCH v2 net-next 11/15] inet: move inet->nodefrag " Eric Dumazet
2023-08-11  7:36 ` [PATCH v2 net-next 12/15] inet: move inet->bind_address_no_port " Eric Dumazet
2023-08-11  7:36 ` [PATCH v2 net-next 13/15] inet: move inet->defer_connect " Eric Dumazet
2023-08-11  7:36 ` [PATCH v2 net-next 14/15] inet: implement lockless IP_TTL Eric Dumazet
2023-08-11  7:36 ` [PATCH v2 net-next 15/15] inet: implement lockless IP_MINTTL Eric Dumazet

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).