Skip to content

net: convert four more protocols to getsockopt_iter

Breno Leitao linux-kselftest linux-x25 lkml netdev 2 versions – Applied

Status from this message: This series was applied to netdev/net-next.git (main)

Get series with b4
b4 am [email protected] change-id 20260505-getsock_two-abad19643336

Versions newest first

  1. v2 Latest5 patches 2 repliesApplied 5/5
  2. v15 patches 2 repliesSuperseded

Changes in v2 from the cover letter

- Fix kdoc as suggested by Jakub.
- Drop the CAN patches; they will be sent separately through the
linux-can tree.
- Add X.25 and KCM conversions, keeping the series at four protocols.
- Link to v1: https://patch.msgid.link/[email protected]

Patches in v2 All 5 applied

#Subject and filesSizeRepliesApplied
1/5mctp: convert to getsockopt_iternet/mctp/af_mctp.c+5 -52 repliesApplied
2/5llc: convert to getsockopt_iternet/llc/af_llc.c+8 -100 repliesApplied
3/5x25: convert to getsockopt_iternet/x25/af_x25.c+6 -100 repliesApplied
4/5kcm: convert to getsockopt_iternet/kcm/kcmsock.c+7 -90 repliesApplied
5/5selftests: net: getsockopt_iter: cleanuptools/testing/selftests/net/getsockopt_iter.c+98 -110 repliesApplied

Reviews trailers per patch

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

Read the v2 thread

Cover letter [PATCH net-next v2 0/5] net: convert four more protocols to getsockopt_iter

Continue the work to convert protocols to the new getsockopt_iter API.

Convert four additional getsockopt implementations to the new sockopt_t/getsockopt_iter callback:

- MCTP
- LLC
- X.25
- KCM

These are mechanical, ABI-preserving conversions following the same pattern as the previously converted protocols (af_packet, can/raw, af_netlink, af_vsock): the (char __user *optval, int __user *optlen) pair is replaced with a single sockopt_t *opt that carries the buffer length on input and the returned size on output, and exposes an iov_iter for the copy-out path. put_user()/copy_to_user() pairs are replaced with a single copy_to_iter() per option, and the wrapper in do_sock_getsockopt() handles writing optlen back to userspace.

I picked these four because each is small and self-contained.

---
Changes in v2:
- Fix kdoc as suggested by Jakub.
- Drop the CAN patches; they will be sent separately through the
linux-can tree.
- Add X.25 and KCM conversions, keeping the series at four protocols.
- Link to v1: https://patch.msgid.link/[email protected]

---
Breno Leitao (5):
mctp: convert to getsockopt_iter
llc: convert to getsockopt_iter
x25: convert to getsockopt_iter
kcm: convert to getsockopt_iter
selftests: net: getsockopt_iter: cleanup

 net/kcm/kcmsock.c                             |  16 ++--
 net/llc/af_llc.c                              |  18 ++---
 net/mctp/af_mctp.c                            |  10 +--
 net/x25/af_x25.c                              |  16 ++--
 tools/testing/selftests/net/getsockopt_iter.c | 109 +++++++++++++++++++++++---
 5 files changed, 124 insertions(+), 45 deletions(-)

---
base-commit: c1e5127b577c6b88fa48e532616932ae978528d5
change-id: 20260505-getsock_two-abad19643336

Best regards,

Signature · 1 line
Breno Leitao <[email protected]>