All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH mptcp-net v4 0/2] mptcp: convert to sockopt_lock_sock
@ 2026-05-09  6:44 Gang Yan
  2026-05-09  6:44 ` [PATCH mptcp-net v4 1/2] mptcp: use sockopt_lock(release)_sock in sockopt Gang Yan
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Gang Yan @ 2026-05-09  6:44 UTC (permalink / raw)
  To: MPTCP Linux; +Cc: Gang Yan

This small series makes the MPTCP sockopt codepaths consistent with
TCP and the core socket layer by using the BPF-aware
sockopt_lock_sock()/sockopt_release_sock() helpers introduced in
commit 24426654ed3a ("bpf: net: Avoid sk_setsockopt() taking sk lock
when called from bpf").

Patch 1 switches all lock_sock()/release_sock()/lock_sock_fast() calls
in MPTCP sockopt handlers to use the BPF-aware wrappers, avoiding the
risk of sleeping in atomic context when lock_sock_fast() is used.

Patch 2 switches ns_capable() to sockopt_ns_capable() in the
congestion control setsockopt path, properly handling the case where
BPF programs invoke setsockopt from softirq context.

Both patches are fixes that should have been part of the original
BPF sockopt series.

Changelog:
v4:
  - As sashiko said, when processing BPF setsockopt requests, the
    msk is already locked, but we need to use lock_sock() to
    protect ssk. If we use sockopt_lock_sock(ssk), it will return
    without acquiring the lock.
  - In 'mptcp_setsockopt_sol_tcp_congestion', the load of
    'tcp_set_congestion_control' is changed from 'true' to
    '!has_current_bpf_ctx()' like tcp does. This determines whether
    tcp_ca_find() or tcp_ca_find_autoload() is called. I agree we
    should keep consistent with the TCP implementation. 

v3:
  - Remove the special symbols in v2.
  - Use sockopt_ns_capable to replace ns_capable.

v2:
  Link: https://patchwork.kernel.org/project/mptcp/patch/20260422091927.77770-3-gang.yan@linux.dev/

Signed-off-by: Gang Yan <yangang@kylinos.cn>
---
Changes in v4:
- EDITME: describe what is new in this series revision.
- EDITME: use bulletpoints and terse descriptions.
- Link to v3: https://lore.kernel.org/r/20260506-sockopt_lock-v3-0-06bd417c6d63@kylinos.cn

---
Gang Yan (2):
      mptcp: use sockopt_lock(release)_sock in sockopt
      mptcp: use sockopt_ns_capable() in setsockopt congestion control

 net/mptcp/sockopt.c | 101 ++++++++++++++++++++++++++--------------------------
 1 file changed, 50 insertions(+), 51 deletions(-)
---
base-commit: aa15c271d79edde595fb6f4eedb52fbc16325a83
change-id: 20260506-sockopt_lock-c46837d6d9d7

Best regards,
--  
Gang Yan <yangang@kylinos.cn>


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

end of thread, other threads:[~2026-05-15 10:51 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-09  6:44 [PATCH mptcp-net v4 0/2] mptcp: convert to sockopt_lock_sock Gang Yan
2026-05-09  6:44 ` [PATCH mptcp-net v4 1/2] mptcp: use sockopt_lock(release)_sock in sockopt Gang Yan
2026-05-15  1:27   ` gang.yan
2026-05-15  9:06     ` Paolo Abeni
2026-05-15  9:39       ` gang.yan
2026-05-15 10:50         ` Paolo Abeni
2026-05-09  6:44 ` [PATCH mptcp-net v4 2/2] mptcp: use sockopt_ns_capable() in setsockopt congestion control Gang Yan
2026-05-09  7:47 ` [PATCH mptcp-net v4 0/2] mptcp: convert to sockopt_lock_sock MPTCP CI

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.