feat(rdma): add negotiated zero-copy v2 transport - #235
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add an opt-in, per-connection negotiated RDMA v2 data plane while preserving TCP and the existing RDMA v1 protocol.
IBV_WR_RDMA_WRITE_WITH_IMMinto a process-wide registered receive segment.{addr,rkey,len}targets; the server RDMA-WRITEs payload bytes and completes with a small ordered SEND.DFKV_WITH_RDMA=OFFhas no verbs dependency and retains TCP behavior.The design borrows the proven memory-registration, single-sided payload, topology, and submit/wait principles from Mooncake Transfer Engine without importing Mooncake Store's master/replica/object semantics into dfkv's existing MDS + consistent-hash architecture.
Protocol and compatibility
The existing device bootstrap frame gains an optional versioned DCP tail:
DFKV_RDMA_PROTOCOL=1forces client v1;DFKV_RDMA_SERVER_PROTOCOL=1forces server v1;auto-v2falls back by creating a fresh v1 connection, never by changing protocol on a live QP.An explicit
DFKV_RDMA_DEVis treated as a hard local fabric selection in both RDMA and TCP-only builds: an unsatisfied whitelist returns no transport instead of silently using TCP. Without a whitelist, each peer independently selects its first ACTIVE local HCA; host-local HCA names are not assumed to be peer identities.Memory and lifetime model
RecvSegmentallocates aligneddepth * slot_sizeleases from one process-wide region.Stop()wakes CQ waiters and joins all Serve threads before owner destruction.Capacity and observability
The v2 slot geometry is:
The shared-segment budget is approximately:
New metrics expose v1/v2 connections, v2 PUT/GET writes, per-rail connections, pool/ad-hoc MR usage, registered receive-segment rails/free bytes, completion errors, active connections, and idle reclaims. Documentation includes rollout, rollback, memlock, NUMA and sizing guidance.
Validation
Final branch was rebased onto
upstream/main@eadb3fdand verified as follows:DFKV_WITH_RDMA=ONDebug build on a real ConnectX host: 464/464 CTest passed.DFKV_WITH_RDMA=OFFDebug build: 406/406 CTest passed.TSan note: the unchanged baseline
RamTierdestructor emits a GNU 11 TSandouble lockdiagnostic for its condition-variable stop/join sequence.RdmaLoopback.RamTierZeroCopyServeis therefore covered by the normal 464-test ConnectX run and excluded from the 40-test race matrix; this patch does not modifyram_tier.{h,cc}.Rollout
DFKV_RDMA_SERVER_PROTOCOL=1; restart all changed server processes.auto-v2on one client process, restart it, and verify v2 write/connection counters plus zero completion errors.