[RDMA] 如何让请求 attachment 直接落入满足 NVMe PRP 要求的缓冲区?

Aperta
#3,730 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 2 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
25/100
Tipo di issue
Funzionalità
Chiarezza
Da chiarire
Stato di attività
Attiva
Stack tecnologico
cpp

Direzione di ricerca

The issue points to RdmaEndpoint::PostRecv() and DoPostRecv() as the receive path, and to IOReserveAlignedBuf in #993 and #2942 as related work. Read those implementations and discussions first, then determine whether the current API supports application supplied DMA buffers or constrained receive segments. Done means identifying an existing approach or defining and validating a feasible design for PRP compatible payloads; the issue reports no end to end SPDK write test.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

我们在评估用 bRPC 1.17 RDMA + SPDK NVMe driver 做存储服务,希望网卡收到的 payload 能直接提交给 NVMe,省掉从 attachment 到磁盘 I/O 缓冲区的 CPU 拷贝。

写入的磁盘 offset 和长度始终按 LBA 对齐,不涉及 read-modify-write。我们用 nvme id-ctrl -H 确认测试盘(Samsung PM9A3)报告 SGLS = 0,所以 NVMe 侧需要用 PRP 表示数据布局。

从源码看,RdmaEndpoint::PostRecv() 预先分配固定大小的 IOBuf 接收块,DoPostRecv() 每次提交一个接收 SGE。解析 RPC 后,attachment 可能从块内某个偏移开始,并跨多个接收块。即使这些块来自网卡和 NVMe 都能访问的 DMA 内存池,块间也可能在 NVMe 内存页中间跳到不连续的 DMA 地址;如果这个分段点也不在 LBA 边界,就无法在那里拆成两条写命令。

看到 #993 和 #2942 中的 IOReserveAlignedBuf 可以主动预留对齐空间,但没找到用它指定 incoming attachment 接收位置的接口。目前只核对了源码和控制器能力,还没有做端到端 SPDK 写盘验证。

想请教:

  1. bRPC 目前是否有办法把 RDMA attachment 直接接收到应用提供的 DMA buffer,或约束接收分段,让 payload 满足 PRP 布局?
  2. 如果没有,bRPC 是否适合提供一个可选模式,把 RPC 元数据与按页对齐的 payload 分开接收?还是建议由 bRPC 传控制信息,另用单边 RDMA 把 payload 放到应用预分配的 buffer?

如果已有相关实现或讨论,麻烦指个方向,谢谢!

Lingua principale
C++
Stelle
17.6k
Fork
4.2k
Merge medio
3g 17h
PR unite (30g)
72

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di apache/brpc

Tutte le issue di apache/brpc

Issue simili

Altre issue su C++

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.