ibv_req_notify_cq() - RDMAmojo RDMAmojo

描述

ibv_req_notify_cq() 在完成队列 (CQ) 上请求完成通知。
当一个请求的下一个WC添加到 CQ ,ibv_req_notify_cq() 请求一个通知。

(bv_req_notify_cq() requests a notification when the next Work Completion of a requested type is added to the CQ.)

在调用 ibv_req_notify_cq() 之前,存在于 CQ 中的任何WC(工作完成)都不会创建将要用ibv_get_cq_event() 读取的“完成通知”。

可以请求两种类型的完成事件:

Solicited Completion Event (被动完成事件) - 当对面的send 或 带立即数且设置了Solicited Event 指示(即对端send_flags设置为IBV_SEND_SOLICITED ) 的RDMA write 到来产生一个 “接收成功” or “接收失败”的WC加入到CQ。

Unsolicited Completion Event  (主动完成事件) - 当任何WC(工作完成)添加到 CQ 时发生,无论它是发送还是接收WC(工作完成),以及它是成功还是不成功的工作完成。

(Unsolicited :不请自来的,主动的)

如果“请求完成通知”未决,即调用了 ibv_req_notify_cq() 但没有“完成通知”发生,则继续调用 ibv_req_notify_cq() 对同一个 CQ 请求相同的“完成事件”类型将无效;只会生成一个完成通知。只有在“完成通知”发生后,调用 ibv_req_notify_cq() 才会生效。

next completion event的“请求完成通知”(Request Completion Notification)优先于同一 CQ 的 solicited event的“请求完成通知”。

如果对同一个 CQ 多次调用 ibv_req_notify_cq() 并且至少有一个请求将类型设置为下一个完成,则在将下一个“完成”添加到该 CQ 时(即不是为下一个Solicited Completion)生成一个“”完成通知”。

一旦一个“完成通知”发生,如果想要获得更多的“完成通知”,他必须再次调用ibv_req_notify_cq()。

参数

Name Direction Description
cq in CQ that was returned from ibv_create_cq()
solicited_only in Type of the requested Completion Notification.

0 The next Completion whether it is Solicited or Unsolicited
otherwise the next Completion is Solicited only or for any unsuccessful Work Completion

 返回值

Value Description
0 On success
errno On failure.
EINVAL Invalid CQ handle

 例子

1) 请求下一次Completion的通知:

struct ibv_cq *cq;if (ibv_req_notify_cq(cq, 0)) {fprintf(stderr, "Error, ibv_req_notify_cq() failed when requested a ""notification for the next completion\n");return -1;
}

2) 请求下一次Solicited Completion的通知:

struct ibv_cq *cq;if (ibv_req_notify_cq(cq, 1)) {fprintf(stderr, "Error, ibv_req_notify_cq() failed when requested a ""notification for the next solicited completion\n");return -1;
}

常见问题

我可以使用 ibv_poll_cq() 读取WC(工作完成),为什么我要使用 ibv_req_notify_cq()?

使用events 处理WC将减少应用程序的 CPU 消耗;您的线程将休眠,直到新的WC将添加到 CQ。

我可以对每个 CQ 调用 ibv_req_notify_cq() 吗?

是的。尽管请记住,请求Solicited Completions的通知 仅对与接收队列相关联的 CQ 有意义。

当 CQ 中有工作完成(我问过的类型)时,我调用了 ibv_req_notify_cq() 我会收到完成通知吗?
不,你不会。A Completion Notification will be generated for the *next* Completion of the type that you've asked (Solicited or next) that will be added to the CQ *after* you called

我在收到完成通知之前调用了 ibv_req_notify_cq() 几次,这是什么效果?

If all calls to ibv_req_notify_cq() were done when requesting the same Completion type, you will get only one Completion Notification, according to the quested type. If at least one of them requested a Completion Notification for the next Completion, you will get a notification for the next Completion.

我可以要求在将 N 个“完成”添加到 CQ 后收到通知吗
不,这不受支持。

可以让每个添加到 CQ 的“完成”自动获取通知(而不是每次再次调用 ibv_req_notify_cq())?

不,这不受支持。收到通知后,如果想再收到通知,需要再次调用 ibv_req_notify_cq() 。

【vbers】ibv_req_notify_cq()相关推荐

  1. 【verbs】ibv_req_notify_cq()

    ibv_req_notify_cq() - RDMAmojo RDMAmojo 描述 ibv_req_notify_cq() 在完成队列 (CQ) 上请求Completion Notification ...

  2. 【vbers】ibv_get_async_event()

    原文:ibv_get_async_event() - RDMAmojo RDMAmojo 描述 ibv_get_async_event() 读取 RDMA 设备上下文context的下一个异步事件. ...

  3. 【vbers】ibv_poll_cq()|RDMA

    目录 描述 参数 返回值 例子 常见问题 原文:https://www.rdmamojo.com/2013/02/15/ibv_poll_cq/  (强烈建议去看原文) 描述 ibv_poll_cq( ...

  4. 【verbs】ibv_get_cq_event|ibv_ack_cq_events()

    目录 ibv_get_cq_event 概要 描述 返回值 提示 ibv_ack_cq_events 描述 参数 返回值 例子 常见问题 ibv_get_cq_event ibv_get_cq_eve ...

  5. 【RDMA】RDMA编程 和相关资料

    目录 RDMA的学习环境搭建 RDMA与socket的类比 RDMA编程流程 RDMA编程2 RDMA学习路线总结 简介--什么是rdma 编程环境 推荐编程库 编程参考手册 相关资料和代码参考 rd ...

  6. 【RDMA】RDMA 编程实例(rdma_cm API)

    目录 RDMA编程基础 说明 1. RDMA的学习环境搭建 2. RDMA与socket的类比 3. RDMA服务器的代码流程 main() { } 实例 用法 Makefile 服务端server. ...

  7. 【RDMA】优化 RDMA 代码的提示和技巧

    目录 RDMA性能优化理论依据 二.基础概念背后的硬件执行方式和原理 Memory Region RDMA Verbs Queue Pair 三.RDMA性能优化 3.1 关注地址翻译的性能开销 3. ...

  8. 【CentOS】利用Kubeadm部署Kubernetes (K8s)

    [CentOS]利用Kubeadm部署Kubernetes (K8s)[阅读时间:约10分钟] 一.概述 二.系统环境&项目介绍 1.系统环境 2.项目的任务要求 三.具体实验流程 1 系统准 ...

  9. 【Spring】框架简介

    [Spring]框架简介 Spring是什么 Spring是分层的Java SE/EE应用full-stack轻量级开源框架,以IOC(Inverse Of Control:反转控制)和AOP(Asp ...

最新文章

  1. (转载)各Linux发行版本 网络配置文件
  2. 旋转矩阵、欧拉角、四元数、轴/角之间的转换
  3. 【解决方案】requests.exceptions.SSLError: HTTPSConnectionPool
  4. Android之Content和activity、service、Application关系和attachBaseContext函数调用的时候
  5. leetcode 87. 扰乱字符串(dp)
  6. Android平台基于RTMP或RTSP的一对一音视频互动技术方案探讨
  7. pcap_open 和 pcap_open_live
  8. OpenShift 4 - 配置OpenShift集群日志环境EFK
  9. hnu 暑期实训之挖掘机技术哪家强
  10. 20-21-2网络管理quiz5
  11. 纯新手DSP编程--5.29--基础类DSP模块 API
  12. WPF学习之数据绑定
  13. PLSQL Developer使用
  14. [收藏] 抽奖活动的高可用、高并发优化
  15. dp动态规划刷题总结
  16. mooc程序设计与算法(三)C++面向对象程序设计 类和对象提高 编程作业 5:魔兽世界之一:备战
  17. USBserver专业解决用友u8|金蝶等财务加密狗在虚拟机识别动态迁移解决方案
  18. cad2014一打开几秒钟后就卡住无响应了
  19. C++小游戏——恋爱指数测试器O(∩_∩)O
  20. 假货网店主恶意投诉正品商家 被判赔偿210万元

热门文章

  1. 配置文件无法导出问题解决方案
  2. Day9--MATLAB常用绘图命令
  3. 开源项目推荐!2019阿里,腾讯,百度,美团,头条等大厂技术面试题目汇总
  4. 软件测试之MySQL数据库必知必会,面试必备
  5. 使用Python绘制各种方法的词云图
  6. springboot实现简单的注册登录功能
  7. 计算机论文提纲范文样本,论文提纲范文样本
  8. 【喜讯】Apache DolphinScheduler 荣获 “2020 年度十大开源新锐项目”
  9. 核聚变技术的实现,会给人类带来什么?
  10. 倒排索引、正排索引系列一