函数原型为

int ibv_post_send(struct ibv_qp *qp, struct ibv_send_wr *wr,
struct ibv_send_wr **bad_wr);

其中struct ibv_send_wr结构体的定义为:

struct ibv_send_wr {
uint64_t wr_id;
struct ibv_send_wr *next;
struct ibv_sge *sg_list;
int num_sge;
enum ibv_wr_opcode opcode;
int send_flags;
uint32_t imm_data;
union {
struct {
uint64_t remote_addr;
uint32_t rkey;
} rdma;
struct {
uint64_t remote_addr;
uint64_t compare_add;
uint64_t swap;
uint32_t rkey;
} atomic;
struct {
struct ibv_ah *ah;
uint32_t remote_qpn;
uint32_t remote_qkey;
} ud;
} wr;
};

在ibv_send_wr 结构体中opcode参数决定了数据传输类型,比如说:

IBV_WR_SEND——在这种类型中,The content of the local memory buffers specified in sg_list is being sent to the remote QP. The sender doesn’t know where the data will be written in the remote node. A Receive Request will be consumed from the head of remote QP's Receive Queue and sent data will be written to the memory buffers which are specified in that Receive Request.当前内存buffer中在sg_list中的内容会被发送给远方的QP。发送方并不会知道数据会写到远方节点的何处。接收方要post_recv,并且接收到的数据要放到指定的地址中。

IBV_WR_RDMA_WRITE——在这种类型中,The content of the local memory buffers specified in sg_list is being sent and written to a contiguous block of memory range in the remote QP's virtual space. This doesn't necessarily means that the remote memory is physically contiguous. No Receive Request will be consumed in the remote QP.本地内存buffer中sg_list中的内容会被发送和写到远方节点的QP的虚拟空间中的一段连续内存块中——这并不意味着远方的内存在物理上也是连续的。并且remote QP也不需要post_recv。

RDMA的ibv_post_send() 函数的更多相关文章

  1. [SPDK/NVMe存储技术分析]012 - 用户态ibv_post_send()源码分析

    OFA定义了一组标准的Verbs,并提供了一个标准库libibvers.在用户态实现NVMe over RDMA的Host(i.e. Initiator)和Target, 少不了要跟OFA定义的Ver ...

  2. mellanox RDMA RoCE

    一:首先根据系统发行版本下载对应的驱动,下载地址如下: http://www.mellanox.com/page/products_dyn?product_family=26&mtag=lin ...

  3. 第3阶段——内核启动分析之创建si工程和分析stext启动内核函数(4)

    目标: (1)创建Source Insight 工程,方便后面分析如何启动内核的 (2)分析uboot传递参数,链接脚本如何进入stext的  (3) 分析stext函数如何启动内核:  (3.1) ...

  4. ibv_get_device_name()函数

    const char *ibv_get_device_name(struct ibv_device *device); 描述 函数用来获取一个与RDMA设备相关联的名字 注意 这个名字在一台特定的机器 ...

  5. ibv_open_device()函数

    struct ibv_context *ibv_open_device(struct ibv_device *device); 描述 函数会创建一个RDMA设备相关的context:可以通过ibv_c ...

  6. ibv_get_device_guid()函数

    uint64_t ibv_get_device_guid(struct ibv_device *device); 描述 函数返回RDMA 设备的 GUID(The Global Unique IDen ...

  7. Buffer Data RDMA 零拷贝 直接内存访问

    waylau/netty-4-user-guide: Chinese translation of Netty 4.x User Guide. 中文翻译<Netty 4.x 用户指南> h ...

  8. ibv_close_device()函数

    int ibv_close_device(struct ibv_context *context); 描述 函数用来关闭一个RDMA设备context: 注意: 函数不能用来释放与该Context关联 ...

  9. ibv_free_device_list()函数

    void ibv_free_device_list(struct ibv_device **list); 描述 函数用来释放当前可用的RDMA设备数组. 注意 数组一旦释放,指向设备的指针将不能再由i ...

随机推荐

  1. 引用参数,值参数,ref,out

    1,一个参数只有在引用的时候才能改变其值,这是一种情况 2,一个参数在引用后要永久的改变其值(可以用返回参数的形式) 3,多个参数在引用后要永久的改变其值或者多个参数中的部分(返回参数就适合了,因为只 ...

  2. 实用Redis操作类

    <?php /** * ------------------------------------------ * 统一redis的配置与数据存储规范,便于扩展与修改 * # redis通常用于热 ...

  3. Web Server 配置及上传文件

    第一种方案:从github上面克隆到服务器 1.git上传文件 ( git bash ) ①切换至所要上传的文件夹 cd 文件夹homepage ②告诉系统当前文件夹要进行git管理 git init ...

  4. Java 基础知识 练习题

    利用文本编辑器输入课堂上练习的Hello.java,并在JDK环境下编译和运行.请将程序编译.运行的结果截图.

  5. Java 基础知识 问答

    1,Java为什么能跨平台运行?请简述原理. 因为Java程序编译之后的代码不是能被硬件系统直接运行的代码,而是一种“中间码”——字节码.然后不同的硬件平台上安装有不同的Java虚拟机(JVM),由J ...

  6. Android中插件开发篇之----类加载器

    关于插件,已经在各大平台上出现过很多,eclipse插件.chrome插件.3dmax插件,所有这些插件大概都为了在一个主程序中实现比较通用的功能,把业务相关或者让可以让用户自定义扩展的功能不附加在主 ...

  7. SQL 是什么?

    一.简介   SQL,Structured Query Language,结构化查询语言.  

  8. 计算字符串中al_num,spance_num,digit_num,other_num的个数

    def jisuan(x) : al_num = 0 spance_num = 0 digit_num = 0 other_num = 0 for i in x : if i.isdigit() : ...

  9. SQL Server书籍整理

    1.<Microsoft SQL Server企业级平台管理实践>徐海蔚2.<SQL Server 2005 Performance Tuning性能调校>胡百敬3.<M ...

  10. Dialog , ProgressDialog , PopWindow 区别

    本质区别: Dialog:非阻塞对话框,弹出对话框时时,后台还可以做事情,点击背景时,对话框消失 ProgressDialog:带有圆形进度或者条形进度的对话框,一般结合handler使用.任务完成后 ...