Skip to content

net: rds: convert rds to getsockopt_iter

Breno Leitao linux-kselftest linux-next linux-rdma lkml netdev 3 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 20260603-getsock_more-46be8d1c56fd

Versions newest first

  1. v3 Latest2 patches 5 repliesApplied 2/2
  2. v23 patches 3 repliesSuperseded
  3. v12 patches 4 repliesSuperseded

Changes in v3 from the cover letter

- Resolved the conflict with net-next
- Added additional tags (assisted-by and reviewes)
- Link to v2: https://lore.kernel.org/r/[email protected]

Patches in v3 All 2 applied

#Subject and filesSizeRepliesApplied
1/2selftests: net: rds: add getsockopt() conversion testtools/testing/selftests/net/rds/.gitignore tools/testing/selftests/net/rds/Makefile tools/testing/selftests/net/rds/getsockopt.c+213 -00 repliesApplied
2/2rds: convert to getsockopt_iternet/rds/af_rds.c net/rds/info.c net/rds/info.h+65 -505 repliesApplied

Reviews trailers per patch

All 2 patches have a Reviewed-by or Acked-by.

PatchAllison Henderson
1/2R-b
2/2R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v3 thread

Cover letter [PATCH net-next v3 0/2] net: rds: convert rds to getsockopt_iter

This series continues the conversion of the remaining proto_ops getsockopt callbacks to the new getsockopt_iter callback introduced in commit 67fab22a7adc ("net: add getsockopt_iter callback to proto_ops"), this time for RDS.

RDS is a little more involved than the protocols converted so far, because the RDS_INFO_* options snapshot kernel state directly into the destination
buffer: the info producers memcpy into the pages under a spinlock via kmap_atomic() and so must not fault.

The conversion preserves that model — it obtains the same page array and starting offset from opt->iter_out with iov_iter_extract_pages(), preallocating the array so the iterator fills it in place, and leaves the rds_info_iterator / rds_info_copy machinery and all producer callbacks unchanged; kernel (ITER_KVEC) buffers remain unsupported on the RDS_INFO path, as before.

I've vibe-coded a kselftest exercising both the simple options and the RDS_INFO_* snapshot path, feel free to drop it in case this is not useful.

---
Changes in v3:
- Resolved the conflict with net-next
- Added additional tags (assisted-by and reviewes)
- Link to v2: https://lore.kernel.org/r/[email protected]

Changes in v2:
- rds: reject non-user-backed buffers with !user_backed_iter() instead of iov_iter_is_kvec() on the RDS_INFO path (Allison Henderson)
- rds: gate the page unpin on iov_iter_extract_will_pin() and comment the implicit pin (Allison Henderson)
- selftest: size the snapshot mmap from the probed length instead of a fixed two pages (Allison Henderson)
- Add a new patch to fix a concern raised by Sashiko.
- Link to v1:
https://lore.kernel.org/r/[email protected]

---
Breno Leitao (2):
selftests: net: rds: add getsockopt() conversion test
rds: convert to getsockopt_iter

 net/rds/af_rds.c                             |  36 ++---
 net/rds/info.c                               |  76 +++++-----
 net/rds/info.h                               |   3 +-
 tools/testing/selftests/net/rds/.gitignore   |   1 +
 tools/testing/selftests/net/rds/Makefile     |   4 +
 tools/testing/selftests/net/rds/getsockopt.c | 208 +++++++++++++++++++++++++++
 6 files changed, 278 insertions(+), 50 deletions(-)

---
base-commit: 903db046d5579bef0ea699eae4b279dd6455fc9f
change-id: 20260603-getsock_more-46be8d1c56fd

Best regards,

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