Linux查看网卡是rdma,第 9 章 配置 InfiniBand 和 RDMA 网络

9.1. 了解 InfiniBand 和 RDMA 技术

InfiniBand 是指两种完全不同的东西。一个是 InfiniBand 网络的物理链接层协议,另一个是高级编程 API,名为 InfiniBand Verbs API。InfiniBand Verbs API 是一种远程直接内存访问(RDMA)技术的实施。

RDMA 通讯与一般 IP 通讯不同,原因是他们会绕过通讯过程中的内核干扰,并极大减少一般处理网络通讯所需的 CPU 消耗。在典型的 IP 数据传输中,机器 A 中的应用程序 X 会向机器 B 中的应用程序 Y 发送同样的数据。作为传输的一部分,机器 B 的内核必须首先接收数据,解码数据包标头,确定该数据属于应用程序 Y,然后唤醒应用程序 Y,等待应用程序 Y 在内核中执行读取 syscall,然后必须手动将该数据从内核的自主内部内存空间复制到应用程序 Y 提供的缓存中。这个过程意味着大多数网络流量都必须在系统的主内存总线间至少复制两次(一次是主机适配器使用 DMA 将该数据放到内核提供的内存缓存中,另一次是内核将该数据移动到应用程序的内存缓存中),同时也意味着计算机必须执行大量上下文切换,以便在内核上下文和应用程序 Y 上下文之间进行切换。这些操作都会在网络通讯处于极高频率时造成极高的系统 CPU 负载。

RDMA 协议可让机器中的主机适配器了解网络何时会有数据包,那个应用程序应该接收该数据包,以及该数据应进入该应用程序内存空间的那个部分。这样就不会向内核发送该数据包并进行处理,然后再复制到用户的应用程序内存,而是将该数据包直接放到应用程序的缓存中,没有任何进一步的干预。这样就可以极大减少高速网络通讯的负载。但大多数 IP 联网应用程序依赖的标准伯克利套接字 API 无法实现此功能,因此必须提供其自己的 API,即 InfiniBand Verbs API,同时必须在应用程序可直接使用 RDMA 技术前将其移植到这个 API。

Red Hat Enterprise Linux 7 supports both the InfiniBand hardware and the InfiniBand Verbs API. In addition, there are two additional supported technologies that allow the InfiniBand Verbs API to be utilized on non-InfiniBand hardware. They are iWARP (Internet Wide Area RDMA Protocol) and RoCE/IBoE (RDMA over Converged Ethernet, which was later renamed to InfiniBand over Ethernet). Both of these technologies have a normal IP network link layer as their underlying technology, and so the majority of their configuration is actually covered in the 第 2 章 配置 IP 联网 chapter of this document. For the most part, once their IP networking features are properly configured, their RDMA features are all automatic and will show up as long as the proper drivers for the hardware are installed. The kernel drivers are always included with each kernel Red Hat provides, however the user-space drivers must be installed manually if the InfiniBand package group was not selected at machine install time.

这些是需要的用户空间软件包:iWARPChelsio hardware — libcxgb3 或者 libcxgb4,具体要看硬件版本。RoCE/IBoEMellanox hardware — libmlx4 或者 libmlx5,具体要看硬件版本。另外,要求用户编辑 /etc/rdma/mlx4.conf 或者 /etc/rdma/mlx5.conf,以便为 RoCE/IBoE 使用设定正确的端口类型。要求用户编辑 /etc/modprobe.d/mlx4.conf 或者 /etc/modprobe.d/mlx5.conf 文件,以便在以太网中为无损服务配置数据包优先响应(在一些交换机中称之为 “no-drop”),以此切换连接到该网络的网卡。

With these driver packages installed (in addition to the normal RDMA packages typically installed for any InfiniBand installation), a user should be able to utilize most of the normal RDMA applications to test and see RDMA protocol communication taking place on their adapters. However, not all of the programs included in Red Hat Enterprise Linux 7 will properly support iWARP or RoCE/IBoE devices. This is because the connection establishment protocol on iWARP in particular is different than it is on real InfiniBand link-layer connections. If the program in question uses the librdmacm connection management library, it will handle the differences between iWARP and InfiniBand silently and the program should work. If the application tries to do its own connection management, then it must specifically support iWARP or else it will not work.

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值