Skip to content

RFC rgw,osd,osdc: S3-over-RDMA served directly from the OSDs (advisory RDMA delivery on MOSDOp) - #71209

Closed
mmgaggle wants to merge 55 commits into
ceph:mainfrom
mmgaggle:wip-rgw-cuobj-osd
Closed

mmgaggle wants to merge 55 commits into
ceph:mainfrom
mmgaggle:wip-rgw-cuobj-osd

Conversation

@mmgaggle

@mmgaggle mmgaggle commented Aug 21, 2026 •

Copy link
Copy Markdown
Member

This is a variant of #70458 (which it includes as its first commit) that moves the GET
data path off the gateway entirely, evolved after architecture review into a generic
out-of-band delivery layer for RADOS reads.

Instead of staging the object in RGW memory and issuing one RDMA_WRITE from the
gateway's cuObjServer, RGW forwards the client's opaque x-amz-rdma-token to the
OSDs: each stripe read carries an advisory delivery descriptor — a first-class,
versioned field on MOSDOp (v10) holding the token, the stripe's offset within the
requested range, and a lease. An OSD that can push builds an op-aware placement plan
and RDMA-writes the reply data straight into client memory — including GPU memory via
GPUDirect — and the reply (v9) reports per-op pushed byte counts in a new oob_bytes
vector. An OSD that cannot push — older release, built without cuObject, disabled,
expired lease, retransmitted request, unknown flags — returns the data inline as a
perfectly normal read
. Every degradation path is plain, correct, in-band data:
there is no protocol error to handle and mixed-version clusters need no ceremony.

This matches the cuObject architecture's reference data flow — NVIDIA's docs describe
the S3 gateway "instruct[ing] specific data nodes" which "push the data via RDMA
(RDMA_WRITE) directly to the client GPU or system memory" [1]. The DC transport makes
the descriptor location-independent: any node holding the token and the cluster
dc_key can write into the client's registered window, with the library validating
every write against the token's range. Benefits over the staged mode:

  • object data never traverses the OSD→RGW network hop, halving fabric traffic per GET;
  • no per-request full-object staging buffer on the gateway;
  • aggregate GET bandwidth scales with the number of OSDs, not gateways — the gateway
    handles control plane only, and in passthrough deployments needs no RDMA NIC and
    no cuObject library at all
    (only the OSDs do; cuobjserver requires no GPU).

Placement: op-aware plans, generic transport

All successful data-bearing read replies funnel through one reply-time chokepoint,
where the OSD builds a placement plan and a batched-async cuObject executor pushes it:

  • linear for READ/SYNC_READ — and for erasure-coded primary reads, whose
    reply is already reconstructed logical data, so plain EC pools work for the RGW
    path with no client changes at all;
  • extent-map-driven for SPARSE_READ (the extent map stays inline, data goes out
    of band);
  • chunk-interleaved for EC direct reads (the client split-read path): each shard
    OSD scatters its ~16K chunks to their logical positions in the client window, so
    the shards' concurrent writes interleave into the client's buffer and client-side
    reassembly disappears into the NIC's address arithmetic.

The plan builders are pure functions unit-tested against the client-side stripe walk
(ECStripeIterator) as the oracle across 200+ randomized geometries. SplitOp fans
the descriptor out: replica sub-reads get the window shifted to their own origin, EC
direct sub-reads share it; mixed inline/OOB sub-replies retry to the primary, where
the resend is guaranteed inline. The series also carries a standalone fix for a
pre-existing SplitOp replica-slicing bug (chunk count could exceed the OSD count,
wrapping the round-robin and silently overwriting a sub-read's data through aliased
out-buffers).

Correctness: the lease + interlock scheme

One-sided RDMA plus an at-least-once RPC layer needs explicit fencing:

  • The OSD-side push completes before the op reply is sent, so a drained reply is
    the interlock
    for every OSD still in contact; RGW drains all stripe ops before
    any HTTP response (the client's only completion signal).
  • Retransmitted requests always deliver inline, so a stripe is never double-pushed
    across peering changes.
  • For OSDs that vanish mid-request, each op carries a lease (rgw_cuobj_lease_ms,
    default 5s) bounding how long after receipt a write may still start; RGW fences
    fallback restarts with rgw_cuobj_fence_wait_ms (default 3s, sized to the RDMA
    transport's retry budget) so no stale write can land after the fallback rewrites
    the same client ranges. The lease is wall-clock and documented as best-effort
    across clock steps.
  • A cuobj status OSD admin-socket command exposes plan/byte/in-flight counters.

Wire compatibility: the descriptor encodes only to SERVER_UMBRELLA peers and the
Objecter refuses to attach it unless require_osd_release >= umbrella (older OSDs
garbage-decode unknown MOSDOp versions, so both gates are load-bearing); the reply's
oob_bytes is trailing and downgrade-safe. librados gains
ObjectReadOperation::set_rdma_delivery() (C++ only, omap_rm_range precedent).

RGW behavior

rgw_cuobj_osd_passthrough gates a per-request mode ladder: passthrough → (on any
inline stripe) whole-GET restart in the staged mode from the base integration →
plain HTTP body with x-amz-rdma-reply: 501. Eligibility: plain objects only (no
compression/encryption/lua/flight), no DLO/SLO, no d3n, response fits the client
window; replicated and EC pools both qualify. Multipart and range GETs use the
ordinary manifest walk; the existing 16MiB aio window throttles OSD-side RDMA
pressure per client NIC. RDMA bytes are accounted in the access, ops and usage logs
toward the direction the data actually moved.

Testing

  • unittest_rdma_delivery — pins the descriptor's exact wire bytes.
  • unittest_oob_placement — pins the EC interleave against the client stripe-walk
    oracle (randomized geometries).
  • unittest_rdma_token — token parsing.
  • ceph_test_rados_api_misc_pp gains RdmaDeliveryInlineFallbackPP, pinning the
    inline-degradation contract the RGW fallback keys on; the full suite (EC fixtures
    included) passes against a 3-OSD vstart cluster over the new wire, no RDMA
    hardware required.
  • RDMA-path testing requires ConnectX-5+ hardware and the NVIDIA cuobjserver
    package; vstart recipe in doc/radosgw/s3-rdma.rst — same client procedure as
    rgw: add experimental cuObject S3 RDMA server support #70458 (s3perf.js --rdma), plus -o rgw_cuobj_osd_passthrough=true and
    -o osd_cuobj_enabled=true.

Limitations / follow-ups

  • The OSD-side push blocks the op worker until the batch drains (submissions are
    already batched asynchronously); moving it fully off the reply path is planned.
  • EC-direct SPARSE_READ delivers inline (shard-space extent maps).
  • crimson is out of scope (classic OSD only).
  • The stripe takes one memcpy into a registered staging buffer on the OSD; the
    planned fix registers the BlueStore hugepage read-buffer pool (blk, os/bluestore: introduce huge page-based read buffers #43849's
    ExplicitHugePagePool) with the NIC for per-segment zero copy.
  • Multi-initiator writes into a single client window are architecturally supported
    (DC target + per-op range validation; NooBaa's server does offset-addressed
    partial writes with one token in production) but NVIDIA's docs never state it in
    one sentence — the first hardware PoC should validate a 2-OSD GET before this
    graduates from RFC.

[1] https://docs.nvidia.com/gpudirect-storage/cuobject/index.html §1.3.3

Checklist

  • Tracker (select at least one)
    • New feature (ticket optional)
  • Component impact
    • No impact that needs to be tracked
  • Documentation (select at least one)
    • Updates relevant documentation
  • Tests (select at least one)
    • Includes unit test(s)

mkogan1 and others added 2 commits August 20, 2026 21:28
Integrate NVIDIA cuObject library for out-of-band RDMA data transfer
on S3 PUT and GET operations. When enabled, object data bypasses TCP
and transfers directly via RDMA between client and server memory,
while the S3 control plane (auth, headers, metadata) stays on HTTP.

Key components:
- RGWCuObjServer singleton managing cuObjServer lifecycle, a pool of
  pre-registered RDMA buffers, and per-thread channel IDs
- PUT path: RDMA_READ from client into registered buffer, then feed
  through the existing filter chain (checksums, compression, encryption)
- GET path: accumulate data into RDMA buffer from the filter chain,
  then RDMA_WRITE to client at EOF
- RDMA bytes included in beast access log and ops log accounting

Enabled via cmake flag WITH_RADOSGW_CUOBJ and runtime config
rgw_cuobj_enabled, rgw_cuobj_rdma_ip, rgw_cuobj_rdma_port.

Signed-off-by: Mark Kogan <[email protected]>
Assisted-by: Claude:claude-opus-4-6
The x-amz-rdma-token descriptor is opaque except for its leading
addr:size hex fields. Move the parsing that rgw_cuobj.cc hand-rolled
into common/rdma_token.{h,cc} so the OSD-side cuObject integration can
share it without linking any RGW or cuObject code, bound the accepted
token length, and reject malformed hex instead of throwing from
std::stoull. The token's remaining fields (rkey:lid:qp:has_gid:gid)
stay uninterpreted and are forwarded verbatim.

Signed-off-by: Kyle Bader <[email protected]>
Assisted-by: claude:claude-fable-5
@github-actions

github-actions Bot commented Aug 21, 2026 •

Copy link
Copy Markdown

Config Diff Tool Output

+ added: rgw_cuobj_osd_push (rgw.yaml.in)
+ added: rgw_cuobj_buffer_size (rgw.yaml.in)
+ added: rgw_cuobj_rdma_port (rgw.yaml.in)
+ added: rgw_cuobj_put_passthrough (rgw.yaml.in)
+ added: rgw_cuobj_buffer_count (rgw.yaml.in)
+ added: rgw_cuobj_num_dcis (rgw.yaml.in)
+ added: rgw_cuobj_fence_drain_ms (rgw.yaml.in)
+ added: rgw_cuobj_crc64nvme (rgw.yaml.in)
+ added: rgw_cuobj_rdma_ip (rgw.yaml.in)
+ added: rgw_cuobj_enabled (rgw.yaml.in)
+ added: rgw_cuobj_client_config (rgw.yaml.in)
+ added: rgw_cuobj_osd_passthrough (rgw.yaml.in)
+ added: rdma_network_interface (global.yaml.in)
+ added: rdma_network (global.yaml.in)
+ added: osd_cuobj_gather_config (osd.yaml.in)
+ added: osd_cuobj_gather_slots (osd.yaml.in)
+ added: osd_cuobj_rdma_port (osd.yaml.in)
+ added: osd_cuobj_gather_quarantine (osd.yaml.in)
+ added: osd_cuobj_buffer_count (osd.yaml.in)
+ added: osd_cuobj_fanout_delivery (osd.yaml.in)
+ added: osd_cuobj_gather_slot_size (osd.yaml.in)
+ added: osd_cuobj_pull_writes_direct (osd.yaml.in)
+ added: osd_cuobj_dc_key (osd.yaml.in)
+ added: osd_cuobj_rdma_ip (osd.yaml.in)
+ added: osd_cuobj_pull_writes (osd.yaml.in)
+ added: osd_cuobj_num_dcis (osd.yaml.in)
+ added: osd_cuobj_register_in_place (osd.yaml.in)
+ added: osd_cuobj_enabled (osd.yaml.in)
+ added: osd_cuobj_gather_enabled (osd.yaml.in)
+ added: osd_cuobj_buffer_size (osd.yaml.in)
! changed: bluestore_csum_type: old: ['none', 'crc32c', 'crc32c_16', 'crc32c_8', 'xxhash32', 'xxhash64'] (global.yaml.in)
! changed: bluestore_csum_type: new: ['none', 'crc32c', 'crc32c_16', 'crc32c_8', 'xxhash32', 'xxhash64', 'crc64nvme'] (global.yaml.in)
! changed: bluestore_csum_type: old: Algorithms crc32c, xxhash32, and xxhash64 are available.  The _16 and _8 variants use only a subset of the bits for more compact (but less reliable) checksumming. (global.yaml.in)
! changed: bluestore_csum_type: new: Algorithms crc32c, xxhash32, xxhash64, and crc64nvme are available.  The _16 and _8 variants use only a subset of the bits for more compact (but less reliable) checksumming. crc64nvme stores the canonical CRC-64/NVME value of each block (8 bytes), the checksum family used by S3 full-object checksums and NVMe protection information; adjacent block values can be combined without rereading data. (global.yaml.in)

The above configuration changes are found in the PR. Please update the relevant release documentation if necessary.
Ignore this comment if docs are already updated. To make the "Check ceph config changes" CI check pass, please comment /config check ok and re-run the test.

@mmgaggle mmgaggle changed the title RFC rgw,osd: S3-over-RDMA GET served directly from the OSDs (cuObject passthrough) RFC rgw,osd,osdc: S3-over-RDMA served directly from the OSDs (advisory RDMA delivery on MOSDOp) Aug 22, 2026
@mmgaggle

Copy link
Copy Markdown
Member Author

@bill-scales I know you took a look at the first pass of this PR, but I've updated it based on your comments. I also created #71295, which lays the groundwork for using bluestore checksums to calculate the x-amz-checksum-crc64nvme from checksum information returned by the OSD layer.

@markhpc

markhpc commented Aug 27, 2026

Copy link
Copy Markdown
Member

You are on fire Kyle! :) Not sure how to review this one though. We probably need to have some high level architectural discussion here or on the mailing list. Do you have any performance tests yet?

@mmgaggle

mmgaggle commented Sep 1, 2026

Copy link
Copy Markdown
Member Author

jenkins test make check arm64

@github-actions github-actions Bot added the mon label Sep 10, 2026
@mmgaggle

Copy link
Copy Markdown
Member Author

Pushed three commits following the lease discussion with @bill-scales:

  • rdma_delivery_lease pool option (mon,osd): the delivery lease is now a pool property, set with ceph osd pool set <pool> rdma_delivery_lease <seconds>, modelled on read_lease_interval. Unset means a built-in 5 s default; the default is a constant rather than an osd_pool_default_* option so clients and OSDs cannot disagree on it.
  • Lease taken from the pool, lease_ms dropped from the descriptor (msgr,osdc,librados,osd,rgw): the OSD enforces the pool value from receipt of the op as before. RGW reads it from the OSDMap through a new IoCtx::pool_rdma_delivery_lease(), tracks the longest lease among the pools a GET's stripes went to, and on fallback waits lease + rgw_cuobj_fence_drain_ms (renamed from rgw_cuobj_fence_wait_ms) before rewriting client ranges. rgw_cuobj_lease_ms is gone. The descriptor is unreleased, so its v1 layout changed in place and the wire-format test is re-pinned.
  • readable_until re-check before the push (osd): check_laggy only runs at dispatch; the push now re-checks the PG read lease immediately before starting and delivers inline if it has lapsed, so the lost-OSD case is fenced by the PG lease alone.

Validation: wire-format unit test, guarded OSD code compiled with WITH_OSD_CUOBJ, and a 3-OSD vstart run covering the pool option CLI, the inline-fallback librados test, a new librados round trip of the option through the OSDMap, and the full ceph_test_rados_api_misc_pp suite (62/62).

@mmgaggle

Copy link
Copy Markdown
Member Author

Hardware validation on ConnectX-6 Dx

Built and tested this series (at 4043ee33b7c, before the two fixes below) on a pair
of RHEL 10.1 hosts with ConnectX-6 Dx NICs, RoCE v2 over a bonded 100GbE fabric.
DC transport confirmed host-to-host at ~11.6 GiB/s with ib_send_bw -c DC.

A 3-OSD vstart cluster and the gateway ran on one host; the cuObject client ran on
the second, so every RDMA write crossed the wire. rgw_cuobj_enabled=false
throughout, so the gateway had no cuObjServer of its own — staged mode was
impossible and every RDMA byte went OSD → client.

Built with -DWITH_OSD_CUOBJ=ON -DWITH_RADOSGW_CUOBJ=ON.

Results

  • unittest_rdma_token, unittest_crc64nvme, unittest_rdma_delivery,
    unittest_oob_placement — 15 tests, all pass
  • ceph_test_rados_api_misc_pp *RdmaDelivery* — 4/4, including the new
    RdmaDeliveryLeasePP
  • rdma_delivery_lease pool option: unset by default, set and read back, negative
    rejected with ERANGE, 0 clears it

End-to-end GETs, md5 of the client's registered window compared against the source
object:

object OSDs pushing delivered out of band HTTP body md5
8 MiB 2 (4 MiB each) 8388608 0 exact
64 MiB 3 (12/24/28 MiB, 16 stripes) 67108864 0 exact

cuobj status reported plans_failed: 0, writes_inflight: 0 (drained before the
reply) and buffers_leaked: 0 on every OSD.

That covers the multi-initiator question raised in the description: several OSDs
writing concurrently into a single client window at their own logical offsets, with
the result reassembling byte-exact.

Degradation paths:

  • no token — full body over HTTP
  • request larger than the client's window — x-amz-rdma-reply: 501 plus the full
    body, and zero bytes written into the undersized window (eligibility rejects
    before any OSD is contacted, so no plan starts)
  • expired delivery lease — the OSD declines and delivers inline, which surfaced the
    first fix below

Two fixes

rgw: clear op_ret before the out-of-band fallback restart

When stripes come back inline and the GET restarts in a fallback mode, op_ret still
held the -EOPNOTSUPP that ended the passthrough attempt. send_response_data()
takes the response status from op_ret on the retry's first handle_data() and
skips the body when it is set, so the header went out as 500 UnknownError with no
content — even though the retry itself succeeded and read every stripe. The client
got a protocol error where the design promises plain in-band data.

Reproduce with a delivery lease short enough that the OSDs decline the push. The
check runs against the op's receipt time, so on a fast pool it has to be well under a
millisecond — at 1 ms the push still succeeds:

  ceph osd pool set <data pool> rdma_delivery_lease 0.000001

Before: HTTP 500, 239-byte error body. After: HTTP 200, x-amz-rdma-reply: 501, and
the full object, verified byte-identical to the source.

rgw: link cuobjserver into rgw_common_standalone too

rgw_cuobj.cc is appended to librgw_common_srcs, which builds both rgw_common
and rgw_common_standalone, but only rgw_common was linked against
CUOBJSERVER_LIBRARY. Building with -DWITH_RADOSGW_CUOBJ=ON failed to link
rgw-standalone and rgw-standalone-admin with undefined references to
cuObjServer::*.

Not covered

  • Erasure-coded pools — exercised only by the unit-test oracle, not on hardware
  • PUT / staged mode
  • The new readable_until re-check in deliver_oob — it compiles and does not
    regress anything, but making the PG read lease lapse mid-read needs fault
    injection rather than configuration
  • Single fabric hop and a single client, so the throughput figures say nothing about
    how this scales

@mmgaggle

mmgaggle commented Sep 10, 2026 •

Copy link
Copy Markdown
Member Author

EC validation

Follow-on to the hardware testing above, covering erasure coding. Same rig: 3-OSD
vstart cluster and gateway on one host, cuObject client on a second, RoCE v2 between
them, rgw_cuobj_enabled=false so all RDMA is OSD passthrough and staged mode is
impossible.

Base geometry: EC profile k=2 m=1 crush-failure-domain=osd, with
rgw_obj_stripe_size=rgw_max_chunk_size=2097152. An 8 MiB object is therefore 4
rados stripes of 2 MiB, confirmed as 4 objects / 8 MiB in the pool. All four cases
below delivered the full 8388608 bytes out of band with x-amz-rdma-reply: 200,
zero HTTP body, and a client-window md5 identical to the source object.

# pool read policy stripe_unit split_op_reads plan shape md5
1 EC default 1M 0 4 x 1 writes, 2097152 bytes exact
2 EC + allow_ec_optimizations default 1M 0 4 x 1 writes, 2097152 bytes exact
3 EC + allow_ec_optimizations balance 1M 8 8 x 1 writes, 1048576 bytes exact
4 EC + allow_ec_optimizations balance 64K 8 8 x 16 writes, 1048576 bytes exact

Per-OSD bytes_pushed sums to exactly 8388608 in every case, and plans_failed,
writes_inflight and buffers_leaked were 0 throughout.

Linear placement, EC primary reads (cases 1 and 2)

Plain EC pools work through the passthrough path with no client changes, as the
description says: the primary's reply is already reconstructed logical data, so the
OSD builds a linear placement -- one contiguous 2 MiB write per RGW stripe. Nothing
about EC is visible to the gateway.

Chunk-interleaved placement, EC split reads (cases 3 and 4)

Reaching the shard-direct path from RGW needs two things, neither on by default:

  • allow_ec_optimizations=true on the pool. On EC this is what sets split_reads
    (OSDMonitor.cc: pool.is_replicated() || pool.allows_ecoptimizations()).
    Replicated pools get split_reads unconditionally, which is why it appears there
    without any opt-in. allow_ec_optimizations needs
    require_osd_release >= tentacle; split_reads needs >= umbrella.
  • rados_replica_read_policy=balance on the gateway. SplitOp::validate_flags()
    rejects any op without CEPH_OSD_FLAG_BALANCE_READS before it looks at geometry,
    and RGW does not set that flag on its own. This is the global option in
    global.yaml.in (the Objecter folds it into extra_read_flags for every read op),
    not the librbd-only rbd_read_from_replica_policy.

The pool flag is only permission -- the client still decides per op -- so both are
required. With just the pool flag (case 2) reads still go to the primary and the
linear builder runs.

Case 4 is the one that actually exercises the interleave. At stripe_unit=64K a
2 MiB RGW stripe spans 16 EC stripes, so each data shard holds 16 non-contiguous
64 KiB chunks of the logical range. Each shard OSD built a plan with 16 scattered
writes
, i.e. 128 individual RDMA writes across 3 OSDs interleaving into a single
client window, and the reassembled buffer matched the source byte for byte.

Case 3 is worth recording as a trap: at stripe_unit=1M with a 2 MiB stripe, each
shard holds exactly one contiguous 1 MiB logical range, so the interleaved builder
emits a single write per plan and looks indistinguishable from linear. Testing only
that geometry would appear to validate the interleave while never exercising the
scatter. It needs rgw_obj_stripe_size well above stripe_width.

Suggested doc addition

doc/radosgw/s3-rdma.rst currently describes chunk-interleaved placement for
"erasure-coded direct reads" without saying how a GET reaches that path. Since it
needs both allow_ec_optimizations on the pool and rados_replica_read_policy on
the gateway, and defaults to the linear path otherwise, it would be worth stating
the two prerequisites next to the placement description -- otherwise operators will
reasonably assume shard-direct is what S3 GETs do on an EC pool.

Not covered

  • EC direct SPARSE_READ, which the PR already documents as delivering inline
  • Checksum verification on the EC split path -- per the description these omit
    per-stripe CRC64 because interleaved layouts do not concatenation-combine, so
    cases 3 and 4 skipped verification by design; integrity here rests on the md5
    comparison above rather than on the gateway's check
  • Multipart and range GETs on EC
  • Degraded reads (all three shards were up throughout)

@github-actions

Copy link
Copy Markdown

This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved

@mmgaggle

Copy link
Copy Markdown
Member Author

Pushed six commits (5543b2f..94853da) that firm up the out-of-band delivery
interfaces before more code depends on them, add per-range CRC so scattered
EC-direct deliveries can be verified end to end, and fix an unrelated build
issue that kept biting the RDMA test host.

Interface and semantics

These are mostly docs plus small, behavior-preserving code changes, made now
because they get more expensive to change once the descriptor and the pool
option have consumers.

  • Placement plan is direction-neutral. placement_triple::reply_data_ofs
    -> local_ofs; a plan is described as a correspondence between OSD-side
    bytes and a client-window offset rather than a delivery. No functional
    change (the builders were already positional, and execute_plan() already
    called this quantity local_ofs).
  • rdma_delivery_lease is defined by initiation. The option was specified
    as two coincident halves (how long an OSD may still start, and how long a
    client waits before window reuse); those only coincide on the read path.
    It is now stated as an OSD-side bound, with the client-reuse rule demoted to
    a read-path consequence. Docs/comments only; enforcement already implemented
    exactly this.
  • delivery_t described without a direction. The fields were already
    neutral; only the docstring committed the descriptor to reads.
  • CRC validity split from combinability. oob_result_t::FLAG_CRC64NVME
    had meant both "this checksum covers the bytes I moved" and "it
    concatenate-combines with its neighbours". Only the second needs a
    contiguous logical extent. Split into FLAG_CRC64NVME (valid) and
    FLAG_CRC64_COMBINABLE, the latter keyed on the placement rather than the
    op type.

Per-range CRC for scattered delivery

A shard OSD serving a shard-direct EC read pushes every other chunk of the
logical range, so its single crc64 is over a non-contiguous subsequence and
cannot fold into the object checksum. Previously that left the most-scattered
path with no integrity value at all: SplitOp stripped the CRC request from
sub-reads.

The blob is non-combinable; the individual chunks are not. Every placement
triple is one contiguous logical extent by construction, so the OSD now
reports one {ofs, len, crc64} per triple (FLAG_CRC64_RANGES) and derives
the whole-payload crc64 from the same pass. SplitOp keeps the request on
sub-reads and folds every sub-read's ranges, in window order, into the
parent's combinable crc64; RGW's existing per-stripe fold then needs nothing
new for shard-direct reads. FLAG_CRC64_COMBINABLE keys on plan.size() == 1,
which also fixes the degenerate EC case (a range that fits in one chunk is
contiguous and now marked combinable). fold_crc64_ranges() sorts by offset
and rejects gaps/overlaps.

The single crc64 is the N=1 case of this format. For a future direction
where an OSD pulls its own chunks out of client memory, per-chunk is the
natural verification unit, so the result shape is the same there.

oob_result_t stays struct v1 (this series has not shipped, so there is no
peer to stay compatible with). The librados result struct grows the ranges
vector and so is no longer layout-mirrored onto the wire struct;
ObjectOperation gained a callback form of set_rdma_delivery() that owns the
wire result and copies it out when the reply is processed.

Build fix (unrelated, could be split out)

cmake/modules/CheckNasm.cmake assembled its feature probes with
-o /dev/null. nasm remove()s its output when a probe fails to assemble,
which is exactly what a probe on an older instruction set does, so a probe run
as root unlinks the device node; the next >/dev/null then creates a regular
file there. The probes now write under build/CMakeFiles/CheckNasm. Happy to
pull this into its own PR if preferred.

Testing

Built with -DWITH_OSD_CUOBJ=ON -DWITH_RADOSGW_CUOBJ=ON -DWITH_RDMA=ON.

Unit:

  • unittest_oob_placement 4/4; unittest_rdma_delivery 6/6 (adds
    OobResultRangesRoundTrip and FoldCrc64Ranges; wire-format pins updated).
  • ceph_test_rados_api_misc_pp *Rdma* 4/4 against a live vstart.
  • Pool option get/set/reject-negative/clear correct.

Hardware (3-OSD vstart on one host over loopback, cuObject client on a second,
ConnectX RoCE, rgw_cuobj_enabled=false so all RDMA is OSD passthrough):

  • Replicated 8 MiB GET: md5 exact; rdma passthrough crc64nvme verified
    (linear/combinable path).
  • EC shard-direct 8 MiB GET (k=2 m=1, stripe_unit=64K,
    rados_replica_read_policy=balance, 2 MiB RGW stripe so each read spans 16
    EC stripes): md5 exact; OSD plans show 16 scattered writes per data shard;
    rdma passthrough crc64nvme verified via the per-range fold. This
    configuration produced no CRC verification at all before these changes.

Add a read-class op that asks the OSD to deliver an extent out of
band: instead of returning data inline, the OSD RDMA-writes it into
the client memory window identified by an opaque descriptor token
(the S3 x-amz-rdma-token forwarded by RGW) at the token's base
address plus a caller-supplied offset. The reply carries only a byte
count, so per-stripe replies stay tiny and reply ordering stops
mattering to the caller.

The extent rides in op.extent as usual; a versioned payload (token,
client offset, reserved flags) rides in indata. OSDs that predate the
op, are built without cuObject support, or have it disabled all fail
the op with -EOPNOTSUPP, which callers use to fall back to ordinary
reads - the new librados test pins that contract, and a unit test
pins the exact payload byte layout (it is hand-encoded, so the
encoding corpus cannot catch drift, and CI has no RDMA hardware to
catch it at runtime).

The librados surface follows the omap_rm_range precedent: C++ method
only, no C API, no version bump (the linker map wildcard exports it).

Signed-off-by: Kyle Bader <[email protected]>
Assisted-by: claude:claude-fable-5
Signed-off-by: Kyle Bader <[email protected]>
Give each OSD an optional cuObject DC endpoint (WITH_OSD_CUOBJ +
osd_cuobj_enabled) mirroring the RGW-side integration: one cuObjServer
bound to the OSD's RDMA NIC, a pool of pre-registered host staging
buffers with a capped one-shot registration overflow path (transient
registrations pin client-controlled amounts of memory, so they are
bounded at 4x the pool buffer size), and lazily allocated
per-op-thread channels (DCIs).

CEPH_OSD_OP_READ_RDMA reads the extent through the same do_read()
path as CEPH_OSD_OP_READ (identical clamping, digest verification and
read accounting), then hands the data to cuObjServer::handleGetObject,
which RDMA-writes it into the client window named by the forwarded
descriptor token at token base + client offset; the reply carries only
the byte count, and the pushed bytes are accounted toward the OSD's
client-read throughput counters. The target range is validated against
the token's window here and again inside the library.

Because the RDMA write is a side effect the resend machinery knows
nothing about, the op refuses retransmitted requests (retry_attempt >
0) with -EOPNOTSUPP: a resent op after a peering change could
double-execute against client memory while the superseded attempt's
write is still in flight on another OSD, so the caller falls back to
a single-writer path instead. Nonzero reserved payload flags are
refused the same way so future clients get a clean fallback rather
than silent misbehavior.

The RDMA write is synchronous on the op worker thread for now - the
same shape as the RGW integration's beast-thread calls - bounded by
the transport's timeout/retry budget; a dead client NIC can stall a
shard for a couple of seconds worst case. Moving it behind
-EINPROGRESS + OpFinisher with a dedicated completion Finisher is the
planned follow-up, as is EC pool support (erasure pools currently
return -EOPNOTSUPP, as do OSDs with the feature absent or disabled,
and clusters whose require_osd_release predates this op).

The dc_key must match the cuObject client library cluster-wide
(default 0xffeeddcc); osd_cuobj_rdma_ip defaults to the OSD's public
address and must be overridden when the RDMA NIC is a different
interface. WITH_OSD_CUOBJ finds ibverbs itself so it does not depend
on WITH_RDMA being enabled.

Signed-off-by: Kyle Bader <[email protected]>
Assisted-by: claude:claude-fable-5
Signed-off-by: Kyle Bader <[email protected]>
When rgw_cuobj_osd_passthrough is enabled and a GET carries
x-amz-rdma-token, forward the token to the OSDs instead of staging the
object in RGW memory: the manifest walk issues CEPH_OSD_OP_READ_RDMA
per stripe, each OSD RDMA-writes its stripe into client memory at the
stripe's logical offset within the requested range, and RGW aggregates
the returned byte counts before answering with x-amz-rdma-reply: 200.
Object data never touches the radosgw, so a passthrough deployment
needs no cuObject library or RDMA NIC on the gateway - only on the
OSDs. The existing aio window (rgw_get_obj_window_size) now throttles
OSD-side RDMA pressure on the client NIC.

A request is eligible only when no data transform is engaged (no
compression, encryption, lua or flight filter), the object is not a
Swift DLO/SLO, d3n caching is off, and the whole response fits the
client's registered window; head-object prefetch is disabled when a
token is present so inline head data cannot sneak back into the
RGW-side path. Everything else - and any stripe answered with
-EOPNOTSUPP by an OSD that lacks the op (old OSDs, EC pools, cuObject
absent or disabled) - restarts the whole GET in the staged mode from
the base cuObject integration, or plain HTTP with x-amz-rdma-reply:
501 (the protocol's documented fallback signal, now also sent whenever
a token arrives and RDMA is unavailable). The restart is safe because
passthrough never commits HTTP bytes and rewriting partially written
client ranges is idempotent; outstanding stripe ops are always drained
before any reply. Two guards make the passthrough contract enforceable
against SAL stores and filters that predate params.rdma_token: the
filter driver forwards the token at iterate() time (it is set after
prepare()), and get_data_cb() rejects unexpected inline data with
-EOPNOTSUPP before any HTTP bytes are committed, which routes such
configurations into the same transparent fallback.

The staged mode inherited from the base integration now reserves its
staging buffer at mode-selection time - after the response headers are
out there is no way left to signal a staging failure, and the previous
first-chunk acquisition could silently drop the whole body while still
reporting success; acquisition failure now downgrades to plain HTTP
before headers commit, and overflow aborts the response.

Multipart objects and range GETs work unchanged (same manifest walk;
client offset = stripe logical offset - range start). RDMA bytes are
accounted in the usage log and the ops log toward the direction the
object data actually moved.

Signed-off-by: Kyle Bader <[email protected]>
Assisted-by: claude:claude-fable-5
Signed-off-by: Kyle Bader <[email protected]>
check_nasm_support() assembles three probe sources with -o /dev/null
to learn which instruction sets the installed nasm handles. nasm
deletes its output file when assembly fails, and a failing probe is
the point of a probe: on a nasm without VPCLMUL support the third
one fails, nasm calls remove() on its output, and when the configure
step runs as root that unlinks the device node. The next process to
redirect to /dev/null then creates a regular file there, and sshd
stops accepting connections until someone recreates the node from a
console.

Point the probes at a scratch file under CMakeFiles instead.

Assisted-by: Claude:claude-opus-5
Signed-off-by: Kyle Bader <[email protected]>
The vendored isa-l already carries CRC-64/NVME ("rocksoft") kernels for
x86 (PCLMULQDQ/AVX2/AVX512) and aarch64 (PMULL, incl. SVE) behind a
runtime-dispatch multibinary, and ceph already builds all of isa-l as
the ISAL::ISAL target for the EC plugin. Route ceph::crc64nvme through
crc64_rocksoft_refl whenever WITH_EC_ISA_PLUGIN is on: same convention
as the madler tables (seed 0 canonical, inversion internal), so it is a
drop-in backend. The madler tables remain the portable fallback and
still provide the combine math, which isa-l does not implement.

On one Zen 5 core (Ryzen AI MAX+ 395) this takes a 4 MiB-buffer
checksum loop from 2.45 GB/s (tables) to 78 GB/s, which matters once
every BlueStore write can be checksumming 4K blocks with it.

A new unit test pins the isa-l backend against the portable tables
across lengths, alignments and chaining seeds (and degrades to a
tables-vs-tables identity when isa-l is not built).

Signed-off-by: Kyle Bader <[email protected]>
Assisted-by: claude:claude-fable-5
Signed-off-by: Kyle Bader <[email protected]>
New CSumType CSUM_CRC64NVME (=7, appended before CSUM_MAX so existing
on-disk values are untouched) with the usual Alg struct and cases in
the four helper switches. Values are 8 bytes per csum block, like
xxhash64.

The one framework change: calculate()'s default-init overload and
verify() hardcoded an init value of -1, which every existing algorithm
wants but crc64nvme must not use - its canonical convention seeds with
0 so that each stored block value equals the standard CRC-64/NVME of
that block. Each Alg now declares its default_init (unchanged -1 for
the existing five) and the framework uses it. Keeping the stored
values canonical is the point of the type: they combine linearly
across blocks and match the checksum family used end to end by S3
x-amz-checksum-crc64nvme, the RDMA passthrough path and NVMe's 64-bit
protection-information guard tags.

Unit tests cover the helper mappings, canonical per-block values, the
block-to-whole combine property, and bad-block pinpointing in verify.

Signed-off-by: Kyle Bader <[email protected]>
Assisted-by: claude:claude-fable-5
Signed-off-by: Kyle Bader <[email protected]>
Wire CSUM_CRC64NVME through blob checksum calculation and
verification, the bluestore_csum_type enum values, and the pool
csum_type path (which validates through Checksummer's string mapping
and needed no change). Costs 8 bytes per csum block like xxhash64.

The draw is not the wider checksum so much as what the value is:
each block's stored checksum is the canonical CRC-64/NVME of that
block, the same family as S3's x-amz-checksum-crc64nvme and NVMe's
64-bit PI guard tag, and values combine linearly. That makes the
on-disk checksum metadata a source higher layers can derive range
checksums from without rereading data - e.g. serving the RDMA
passthrough path's per-stripe CRCs from metadata instead of a second
data pass, or matching guard tags on a PI-formatted NVMe-oF
namespace. Those consumers need a range-checksum read API, which is
left for the ObjectStore read-interface work; this commit makes the
stored values the right ones so that data written now benefits later.

The synthetic-workload csum matrix in ceph_test_objectstore gains the
new algorithm (passes along with the existing six permutations).
Blobs written with crc64nvme read as -EOPNOTSUPP on older OSDs, so
enabling it is a commitment against downgrade; noted in the release
notes.

Signed-off-by: Kyle Bader <[email protected]>
Assisted-by: claude:claude-fable-5
Signed-off-by: Kyle Bader <[email protected]>
Deriving a range checksum from stored per-block values needs the
checksum of unwritten (hole) bytes, which read as zeros. Zero runs
are order-independent, so fold in one 2^k-byte run per set bit of the
length using the existing combine math - no zero buffer, no O(n) pass.

Signed-off-by: Kyle Bader <[email protected]>
Assisted-by: claude:claude-fable-5
Signed-off-by: Kyle Bader <[email protected]>
New ObjectStore method: return the checksum of an object range, equal
to what checksumming the bytes of read(offset, len) would produce
(clamped at object size, holes as zeros). BlueStore derives it purely
from stored checksum metadata - no data read - when the blobs store
combinable full-width values of the requested type: crc64nvme
(canonical values, combined with the carry-less-multiply math) and
crc32c (seeded -1, folded with the same zeros-operator identity
bufferlist's cached-crc combine uses). xxhash does not combine and
the truncated crc32c variants store too little state, so those types
are never derived.

When the range is not derivable (compressed blobs, another stored
csum type, csum-less blobs, partially covered csum blocks), the
caller may pass the bytes it already read - the same bufferlist a
preceding read() filled, so nothing is copied or reread - and the
checksum is computed over them by the base implementation. The return
value reports which happened: 0 derived from metadata, 1 computed
over the caller's data. With no data supplied the call remains a pure
metadata probe returning -EOPNOTSUPP, leaving the fallback strategy
with the caller: compute in software over bytes in hand, or let
transport hardware (e.g. RDMA NIC signature offload) produce the
value in flight.

This is the metadata-read seam the RDMA passthrough path and an
NVMe-oF 64-bit-PI gateway can serve range checksums from; it is
deliberately narrow so the broader ObjectStore read-interface rework
can absorb or replace it.

The store_test covers whole-object, sub-range, hole, straddling and
past-eof ranges for both algorithms against checksums of the
actually-read data, the refusal cases, the data fallback (including
that derivable ranges still prefer metadata and that errors like
ENOENT are not papered over), and that in-place overwrites keep
deriving correctly (an existing blob recalculates under its own csum
type even when the store default has changed).

Signed-off-by: Kyle Bader <[email protected]>
Assisted-by: claude:claude-fable-5
Signed-off-by: Kyle Bader <[email protected]>
ObjectOperation::set_rdma_delivery(on_result) stores the result slot in
rdma_oob_storage, a deque owned by the ObjectOperation, and hands its
address to the Op through rdma_oob_result and to the out handler. The
Objecter's read()/prepare_read_op() swap those into the Op and then
call op.clear(), which resets rdma_oob_storage and frees the slots
while the Op still points at them. The reply handler then writes the
delivered byte count into freed memory, and tcmalloc eventually hands
that block out again: radosgw crashed in tc_newarray with the freed
block's free-list pointer overwritten by a 4 MiB stripe length.

Move the storage into the Op with the pointers that reference it.
Moving the unique_ptr keeps the slot addresses stable, so the handler
captures stay valid; SplitOp writes through orig_op->rdma_oob_result
and is covered too.

Assisted-by: Claude:claude-fable-5-1
Signed-off-by: Kyle Bader <[email protected]>
cuObject 2.x split setTelemFlags() into path flags and op flags and
defines CUOBJ_SERVER_MAJOR_VERSION; the 1.x header has one argument
and no version macros. Select the call on the macro so radosgw builds
against either.

Signed-off-by: Kyle Bader <[email protected]>
RGWCuObjServer handed each frontend thread its own cuObject channel on
first use and never released it, and did not check the allocation. A
channel may not be shared by concurrent callers, but the library only
has rgw_cuobj_num_dcis of them (128 by default) while the beast
frontend runs rgw_thread_pool_size threads (1024): once the channels
ran out, every RDMA transfer on a later thread failed with -EIO in
under a millisecond and the PUT came back as a 500.

Allocate the channels once at startup into a free list and have each
transfer take one for its duration, waiting when none is free. Fail
initialization when no channel can be allocated, warn when fewer than
configured, and free them at shutdown.

Assisted-by: Claude:claude-fable-5-1
Signed-off-by: Kyle Bader <[email protected]>
Since isa-l 2.32 the folding CRC kernels include crc_const_extern.asm
from the crc directory, which the probe did not put on nasm's include
path. The probe therefore always failed, HAVE_NASM_X64_AVX512_VPCLMUL
was never set, and the AVX512 crc32c kernel (crc32_iscsi_by16_10) was
silently left out of every build.

Add the directory to the probe and to the crc32 object library's
assembler flags. The kernel's constants live in crc_const.asm; add it
when ceph-common is not already linking libisal (which carries them,
and which the crc64nvme backend pulls in under WITH_EC_ISA_PLUGIN).

Assisted-by: Claude:claude-fable-5-1
Signed-off-by: Kyle Bader <[email protected]>
A shard OSD declines out-of-band delivery for a short window before
each read-lease renewal (readable_until on a non-primary shard is the
primary's lease minus the clock-delta bound), and returns that stripe
inline. RGW treated any inline stripe as a signal that an RDMA write
it lost track of might still land, so it waited the pool's delivery
lease plus rgw_cuobj_fence_drain_ms (8 s with the defaults) and then
restarted the whole GET in staged mode. About 0.25% of GETs paid that
8 s, which set the last-thread completion time of every benchmark.

The wait is only needed when the op was sent more than once: a single
attempt that replied inline has, by construction, initiated no write.
Have the Objecter mark a delivery result FLAG_RESENT when op->attempts
is greater than one, propagate it through SplitOp's aggregate, and
expose it to librados callers as RDMA_DELIVERY_RESENT. RGW then
RDMA-writes a stripe that came back inline from a never-resent op into
the client window itself, from a staging buffer, recording its byte
count and CRC64 in that stripe's slot; a resent op or a failed patch
still takes the fence and the staged restart.

Assisted-by: Claude:claude-fable-5-1
Signed-off-by: Kyle Bader <[email protected]>
execute_plan() copied every read payload into a pre-registered staging
buffer before the NIC read it. On a canister with 4 of 12 DIMM
channels populated the copy is a full extra pass of the delivered
bytes over the memory bus, and memory bandwidth turned out to be what
bounded RDMA reads.

Add osd_cuobj_register_in_place: register each buffer of the payload
where it lies and issue one RDMA write per buffer, falling back to the
copy when a payload is in more than 64 pieces or a registration
fails. Staging is restructured around a list of registered segments
(staged_payload), and plan_xfers() splits the placement plan so that no
write crosses a segment. With 4 MiB BlueStore blobs a 4 MiB shard read
arrives as one or two buffers, and the registration costs about 200 us
per read; with the default 64 KiB blobs a read arrives in about a
dozen pieces and the copy is cheaper, so the option is off by default.

On the test canister (6+2, 4 MiB stripe unit, 4 MiB blobs) DRAM
traffic per delivered byte fell from about 4.8 passes to about 3 and
sustained RDMA GETs from disk went from 24.8 to 26.4 GiB/s. cuobj
status gains payload_segments, plans_in_place, plans_copied and
register_in_place_ns.

Assisted-by: Claude:claude-fable-5-1
Signed-off-by: Kyle Bader <[email protected]>
Split deliver_oob()/deliver_op_oob() into oob_delivery_allowed(), which
holds the per-request checks (descriptor shape, retries, the read
lease, the delivery lease), plan_op_oob(), which builds the placement
plan and the payload it indexes for one op, and strip_oob_delivered(),
which removes pushed data from the reply. No functional change; a
following commit needs the plan builder on its own.

Assisted-by: Claude:claude-fable-5-1
Signed-off-by: Kyle Bader <[email protected]>
The per-range CRC-64/NVME an OSD returns with an out-of-band delivery
was computed over the payload after BlueStore had already read every
byte to verify its own checksum: a second pass over the data on a path
that memory bandwidth bounds. Turning the second pass off was worth
about 17% on the test canister.

When the pool's csum_type is crc64nvme, BlueStore stores the canonical
CRC-64/NVME of every csum block, and read_range_checksum() folds those
into the checksum of any block-aligned range without touching the
data. Have plan_op_oob() report where the payload starts in the local
(shard) object - the same shard-offset arithmetic as
objects_read_local() - and ask the store for each placed range's
checksum from metadata alone; only a range it cannot serve (another
csum type, a partial csum block, a compressed blob) is hashed from the
payload.

On a 6+2 pool with a 4 MiB stripe unit about 99% of delivered ranges
take their checksum from metadata, and sustained RDMA GETs from disk
went from 27-28 to 32-34 GiB/s with the checksum still returned.
cuobj status reports crc64_from_metadata and crc64_computed.

Assisted-by: Claude:claude-fable-5-1
Signed-off-by: Kyle Bader <[email protected]>
When a primary reads an erasure-coded object on behalf of a client,
each peer returns its chunks in an MOSDECSubOpReadReply: a messenger
copy on the peer, a receive copy on the primary, and the CPU to drive
both. Let the peers RDMA-write the chunks into the primary instead.

The primary becomes an RDMA target through the client half of cuObject
(libcuobjclient, the same role a GPU data loader plays towards RGW):
OSDCuObjGather registers one arena and mints one descriptor token for
it at startup, then hands out fixed-size slots per sub-read extent.
ECSubRead (v5) carries the token and a window offset per extent; a
peer that can push does so with the very code path it uses to deliver
to a client (OSDCuObj::execute_plan), under the same read-lease and
delivery-lease fences, and reports the pushed extents in ECSubReadReply
(v4) instead of returning the data. The primary wraps each landed slot
as a zero-copy buffer and folds it into the read result as if it had
arrived inline. A peer that cannot push replies inline as before.

A slot is recycled when the last reference to its buffer drops. One
whose push was never confirmed - the peer did not reply, replied with
an error, or fell back inline after a failed push - is quarantined for
longer than a peer may take to start and finish a write, so a late
RDMA write can never land in memory that has been handed to another
read. Only client reads use the gather (ReadCompleter::allows_rdma_gather):
RMW and recovery reads park their buffers in the extent cache, which
would pin slots indefinitely.

The build finds the client library next to the CUDA toolkit and enables
the role as WITH_OSD_CUOBJ_GATHER (the detection is shared with the
gateway, which takes the same role in a later change). Options:
osd_cuobj_gather_enabled, _slot_size, _slots, _quarantine, _config.
Counters appear under the "gather" section of "cuobj status".

On the CS1 canister (16 OSDs, EC 6+2, 24 MiB objects, 64 threads, cold)
primary-delivered reads went from 11.1 to 18.5 GiB/s at a 4 MB stripe
unit and 9.0 to 12.4 GiB/s at 16 KB, with host CPU dropping from 74% to
22%; with one OSD down, degraded split reads went from 17.9 to 23.6
GiB/s and degraded primary delivery from 9.2 to 16.1 GiB/s. Every run
verified end to end with zero checksum mismatches.

Assisted-by: Claude:claude-fable-5-1
Signed-off-by: Kyle Bader <[email protected]>
In the staged S3-over-RDMA mode the response has no body: the header
is the client's signal that the object is in its memory. RGWGetObj
committed that header on the first data chunk, as it does for an HTTP
body, and performed the single RDMA write into the client only at the
end of the request. A client that trusted the response could therefore
read a partially written buffer.

Nothing on the storage side can see this - the bytes are correct in
every buffer the gateway checks - and it went unnoticed until elbencho
verified the delivered bytes against x-amz-checksum-crc64nvme and got
a different CRC on every attempt. Stage every chunk as it arrives,
perform the RDMA write on the final (empty) call, and only then emit
the header, which now reports the write's error if it failed.

Assisted-by: Claude:claude-fable-5-1
Signed-off-by: Kyle Bader <[email protected]>
OSD passthrough takes the gateway off the data path only for clients
that can receive RDMA and only for requests that fit the passthrough
contract. Everything else - plain HTTP clients, staged S3-over-RDMA
requests - still pulls every stripe through the messenger into RGW
memory.

Give the gateway the same target role an OSD primary now has for its
peers. With rgw_cuobj_osd_push the staging pool's buffers get a second
registration through the cuObject client library and one descriptor
token each. RGWGetObj then attaches a buffer's token to its stripe
reads exactly as it would attach a client's, and the OSDs RDMA-write
the stripes into the buffer; the OSD side is unchanged. get_obj_data
places any stripe that comes back inline itself and hands the callback
zero-copy aliases of the buffer in logical order, so an HTTP body
streams as stripes land and a staged request ends with the same single
RDMA write it always did. A buffer an OSD might still write into (a
stripe from a resent op, a fallback after descriptor-bearing ops were
sent) is quarantined for the delivery lease plus the transport drain
bound instead of making the request wait, since the memory is the
gateway's own. The whole-object CRC64-NVME verification of the
passthrough path applies unchanged.

Options: rgw_cuobj_osd_push, rgw_cuobj_client_config. The build enables
the role as WITH_RADOSGW_CUOBJ_TARGET when the client library is found.

On the CS1 canister (24 MiB objects, 64 threads, cold) HTTP GETs went
from 9.8 to 13.7 GiB/s (14.8 at a 16 KB stripe unit) and staged RDMA
GETs from 7.2 to 20.4 GiB/s (20.0 at 16 KB); with one OSD down, 8.9 to
12.4 and 17.8 GiB/s respectively. Verified with the AWS CLI's checksum
validation and an independent CRC of the downloaded bytes.

Assisted-by: Claude:claude-fable-5-1
Signed-off-by: Kyle Bader <[email protected]>
With the gather in place a primary-delivered read's payload is mostly
chunks that already sit in registered memory (the peers' slots), plus
the primary's own chunk. Delivery still treated the payload as ordinary
buffers: at a 4 MB stripe unit it registered each of the six chunks in
place per read, and at 16 KB the 9,216-segment rados-order assembly
exceeded the in-place limit and was copied into a pooled buffer first.

Register the gather arena with the server library once at startup and
teach stage_payload about registered regions: a buffer inside one is
addressed through the region's handle at its offset, with no
registration and no copy. Buffers outside a region are registered per
underlying allocation rather than per piece, so the many interleaved
pieces of one chunk cost one registration, and transfers are expanded
per segment with a deeper submission pipeline for the small-chunk case.

On the CS1 canister (24 MiB objects, 64 threads, cold) primary-delivered
reads at a 16 KB stripe unit went from 12.4 to 17.8 GiB/s and the
cache-resident case from 20.2 to 25.6 GiB/s; 4 MB was unchanged within
noise. All runs client-verified with zero mismatches.

Assisted-by: Claude:claude-fable-5-1
Signed-off-by: Kyle Bader <[email protected]>
…imary

An erasure-coded write fans out from the primary to k+m-1 peers as
MOSDECSubOpWrite messages carrying each shard's bytes: a messenger send
on the primary and a receive copy on every peer. Let the peers pull the
bytes instead.

The per-shard transactions are now built in the aligned format, whose
page-aligned write payload is one headless stream that ops consume
positionally. With osd_cuobj_pull_writes the primary takes that stream
out of each peer's transaction, registers the allocations under it
with the cuObject client library (the data shards are views of the
client's buffer, so one registration serves every peer) and sends
ECSubWrite (v6) with PUT tokens and (token, offset, length) pieces in
stream order. The peer RDMA-reads the pieces into gather slots
(OSDCuObj::pull_into, the arena being registered with the server
library too), installs the stream and applies the transaction; with
buffered writes off BlueStore writes straight out of the slot and
drops it after the aio. Registrations are held until the peer's commit
reply and quarantined for osd_cuobj_gather_quarantine if the op is
dropped first, so no peer can read reused memory; a peer may start a
pull up to half that period after receiving the sub-write.

A peer that cannot pull (no slot, a transport error) replies
pull_failed (ECSubWriteReply v2) and the primary resends the
transaction whole. Because the peer must apply sub-writes in log order,
it holds every sub-write that arrives behind one it is waiting for and
requeues them, in order, once the resend has been applied.

On the CS1 canister (24 MiB objects, 128 writers, EC 6+2) RDMA PUTs went
from 2.93 to 3.65 GiB/s and HTTP PUTs from 2.88 to 3.47 GiB/s, with no
errors and client-verified reads of the written data afterwards.

Assisted-by: Claude:claude-fable-5-1
Signed-off-by: Kyle Bader <[email protected]>
… client

When a primary reads an erasure-coded object for a client that asked
for out-of-band delivery, every data shard's chunks travel to the
primary and then to the client, and the primary's NIC carries the
whole object. With osd_cuobj_fanout_delivery the primary attaches the
client's window and the read's logical range to the sub-reads
(ECSubRead v7); a peer holding a data shard RDMA-writes its chunks into
the client at their logical positions - the same interleave a
shard-direct read uses - and reports the ranges and their CRC64-NVME
values in the reply (ECSubReadReply v5). It sends the chunks to the
primary as well only when a reconstruction needs them, which is the
case exactly when a parity shard is being read. The primary aliases a
registered block of zeros where peers delivered, so the read result
keeps its shape without carrying the bytes, delivers only its own and
any reconstructed chunks, and folds every range's checksum into one
whole-range value for the client.

Peers place under the fences of the client op itself (its retry count,
receipt time and the read lease), and never for a retried op. Once a
peer has delivered, the read has no inline fallback: a failure of the
primary's own delivery fails the read, and the client retries without
fan-out. RGW reads objects as stripe-sized ops, most of which start
mid-stripe, so the placement accepts any range that starts at a
shard's first chunk, not only stripe-aligned ones.

On the CS1 canister (24 MiB objects, 64 threads, cold) primary-path
reads went from 18.9 to 31.3 GiB/s at a 4 MB stripe unit and from 17.8
to 29.4 GiB/s at 16 KB - the split-read figures - and the cache-resident
case reaches line rate (45.2 GiB/s). With one OSD down, degraded
primary-path reads went from 16.1 to 26.1 GiB/s, equal to degraded
split reads. All runs client-verified.

Assisted-by: Claude:claude-fable-5-1
Signed-off-by: Kyle Bader <[email protected]>
An S3-over-RDMA PUT so far had the gateway RDMA-read the object out of
the client's buffer, checksum it, and send it to the primary over the
messenger: two passes over every byte on the gateway, which held it to
about 3.5 GiB/s on 22 cores while the OSDs idled.

With rgw_cuobj_put_passthrough the gateway never touches the bytes. For
a plain object that fits the head object it feeds its pipeline a
placeholder of the right length and attaches the client's RDMA token,
plus the CRC64-NVME the client sent in x-amz-checksum-crc64nvme, to the
head write (ObjectWriteOperation::set_rdma_source, a delivery_t with
FLAG_SOURCE; the Objecter strips the placeholder before sending). The
primary pulls the payload into its gather arena, verifies the CRC there
- a mismatch fails the write with EBADMSG and the PUT with BadDigest
before anything is written - reports the CRC back in the oob result,
and carries on as if the bytes had arrived inline. The ETag becomes the
verified CRC, since there is no MD5 to compute. Any object the gateway
cannot hand over (compression, encryption, retention, a checksum the
OSD cannot verify, larger than the head) takes the staged path as
before.

The arena also learns a PUT token of its own, so a peer that pulls its
shard of such a write reads it straight out of the primary's slots
without a second registration; neorados::Op grows by one word for the
larger ObjectOperation.

On the CS1 canister, 24 MiB RDMA PUTs at 128 writers went from 3.56 to
9.03 GiB/s with peers pulling from the primary (6.32 on the messenger)
and the gateway from 22 cores to one.

Assisted-by: Claude:claude-fable-5-1
Signed-off-by: Kyle Bader <[email protected]>
…lient

When the primary pulled a write payload out of the client itself, the
data shards it sends its peers are views of that same client memory,
and the primary is one hop too many for them. With
osd_cuobj_pull_writes_direct the gather arena remembers, per slot,
which client token and offset filled it; prepare_pull hands a peer the
client's token for any buffer that is such a view, and only the parity
shards (and any padding) still come out of the primary's arena. Nothing
changes on the wire: ECSubWrite already carries arbitrary tokens.

The trade is client egress for primary egress: the client now serves
its k data chunks twice, once to the primary, which still needs all of
them to encode, and once to the peers. On the CS1 canister that came to
7.96 GiB/s against 9.03 with the primary as the only source, at 46%
instead of 62% host CPU.

Assisted-by: Claude:claude-fable-5-1
Signed-off-by: Kyle Bader <[email protected]>
… the primary

Pull only once require_osd_release is umbrella: a Tentacle peer decodes
ECSubWrite v6 past rdma_pull and would apply a transaction whose data
was taken out. And build the decline path (pull_pending, pull_held,
send_pull_failed, requeue_held_ops) into every OSD, not just the gather
build, so an umbrella peer without the cuObject client replies
pull_failed instead of applying t without its payload.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Kyle Bader <[email protected]>
The cuObject endpoints bind to one explicit address per daemon
(osd_cuobj_rdma_ip, rgw_cuobj_rdma_ip), so configuring a cluster means
a per-host setting on every OSD and gateway. Add rdma_network, the
RDMA counterpart of public_network: a comma-separated list of subnets
from which a daemon without an explicit address picks a local one. A
rail-optimized fabric lists one subnet per rail; an OSD with addresses
on several rails prefers the interface on its object store's NUMA node
when osd_numa_prefer_iface is set, the rule its public address already
follows.

An explicit address still wins. Unlike public_network, an entry that
does not parse, or a host with no address in the list, costs the
daemon its RDMA endpoint rather than stopping it: the OSD delivers
every read inline and the gateway runs without its RDMA server.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Kyle Bader <[email protected]>
…ress

Add rdma_network_interface, the counterpart of public_network_interface
and cluster_network_interface: it narrows rdma_network's candidates to
the named interfaces. Set without rdma_network it logs an error and
leaves the daemon without its RDMA endpoint, rather than exiting as
find_ip_in_subnet_list would.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Kyle Bader <[email protected]>
…work

rdma_network names the address a daemon's cuObject server binds, but
the OSD gather arena and radosgw's push target also build a cuObject
client, and that library takes its NICs only from rdma_dev_addr_list in
cufile.json: no API or environment variable sets them. So every host
still needed a hand-written file.

When rdma_network is set and the deployment names no file of its own
(CUFILE_ENV_PATH_JSON, osd_cuobj_gather_config, rgw_cuobj_client_config),
copy /etc/cufile.json with rdma_dev_addr_list replaced by the daemon's
RDMA address to $run_dir/$cluster-$name.cufile.json and export that
path. The host file's other settings (DMABuf, DC key, logging) carry
over; its // comments, which NVIDIA ships and json_spirit rejects, are
stripped first. The run directory, not /etc/ceph, because the daemons
run as ceph and one file per daemon lets OSDs on different rails name
different NICs. The OSD resolves its RDMA address once for both the
server and the gather, so the arena registers on the same NIC the
endpoint pushes from.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Kyle Bader <[email protected]>
@mmgaggle mmgaggle mentioned this pull request Oct 27, 2026
5 of 14 tasks
@mmgaggle

Copy link
Copy Markdown
Member Author

Closing in favor of the successor - #73164

@mmgaggle mmgaggle closed this Oct 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants