在NVMe over PCIe中,I/O命令支持SGL(Scatter Gather List 分散聚合表)和PRP(Physical Region Page 物理(内存)区域页), 而管理命令只支持PRP;而在NVMe over Fabrics中,无论是管理命令还是I/O命令都只支持SGL。NVMe over Fabrics既支持FC网络,又支持RDMA网络。众所周知,在RDMA编程中,SGL(Scatter/Gather List)是最基本的数据组织形式。 SGL是一个数组,该数组中的元素被称之为SGE(Scatter/Gather Element),每一个SGE就是一个Data Segment(数据段)。其中,SGE的定义如下:
结构ibv_sge {
uint64_t 地址;
uint32_t 长度;
uint32_t lkey;
};
-
addr: 数据段所在的虚拟内存的起始地址 (Virtual Address of the Data Segment (i.e. Buffer))
-
length: 数据段长度(Length of the Data Segment)
-
lkey: 该数据段对应的L_Key (Key of the local Memory Region)
而在数据传输中,发送/接收使用的Verbs API为:
-
ibv_post_send() - post a list of work requests (WRs) to a send queue 将一个WR列表放置到发送队列中
-
ibv_post_recv() - post a list of work requests (WRs) to a receive queue 将一个WR列表放置到接收队列中