首页 技术 正文
技术 2022年11月9日
0 收藏 385 点赞 2,490 浏览 1172 个字
const char *ibv_get_device_name(struct ibv_device *device);

描述

函数用来获取一个与RDMA设备相关联的名字

注意

  • 这个名字在一台特定的机器中是唯一的(相同的名字不会分配给其他设备);
  • 这个名字在跨InfiniBand fabric并不是唯一的;
  • 当一台电脑上拥有多于一台的RDMA设备时,修改RDMA设备在电脑上的位置(例如,总线上的位置),可能会导致关联的name改变;
  • 为了区分设备,建议使用设备的GUID进行区分,函数ibv_get_device_guid()可以返回该值;

参数(struct ibv_device *device)

函数ibv_get_device_list()返回值中的某一项。(函数ibv_get_device_list()返回当前可用的RDMA设备数组)

返回值(const char *)

函数返回一个指向设备名的指针,如果出错,返回NULL。

名字的组成

  • prefix前缀—描述RDMA设备供应商和样式
    • cxgb3 —Chelsio Communications, T3 RDMA family
    • cxgb4 – Chelsio Communications, T4 RDMA family
    • ehca – IBM, eHCA family
    • ipathverbs – QLogic
    • mlx4 – Mellanox Technologies, ConnectX family
    • mthca – Mellanox Technologies, InfiniHost family
    • nes – Intel, Intel-NE family
  • index索引-用来在同一台电脑中区分相同供应商的一个数字

例子

函数ibv_get_device_name()可能返回的RDMA设备名的例子

  • mlx4_0
  • mlx4_1
  • mthca0
#include <stdio.h>
#include <infiniband/verbs.h>int main(void)
{
struct ibv_device **device_list;
int num_devices;
int i; device_list = ibv_get_device_list(&num_devices);
if (!device_list) {
fprintf(stderr, "Error, ibv_get_device_list() failed\n");
return -;
} printf("%d RDMA device(s) found:\n\n", num_devices); for (i = ; i < num_devices; ++ i)
printf("RDMA device[%d]: name=%s\n", i,
ibv_get_device_name(device_list[i])); ibv_free_device_list(device_list); return ;
}
相关推荐
python开发_常用的python模块及安装方法
adodb:我们领导推荐的数据库连接组件bsddb3:BerkeleyDB的连接组件Cheetah-1.0:我比较喜欢这个版本的cheeta…
日期:2022-11-24 点赞:878 阅读:9,086
Educational Codeforces Round 11 C. Hard Process 二分
C. Hard Process题目连接:http://www.codeforces.com/contest/660/problem/CDes…
日期:2022-11-24 点赞:807 阅读:5,561
下载Ubuntn 17.04 内核源代码
zengkefu@server1:/usr/src$ uname -aLinux server1 4.10.0-19-generic #21…
日期:2022-11-24 点赞:569 阅读:6,410
可用Active Desktop Calendar V7.86 注册码序列号
可用Active Desktop Calendar V7.86 注册码序列号Name: www.greendown.cn Code: &nb…
日期:2022-11-24 点赞:733 阅读:6,183
Android调用系统相机、自定义相机、处理大图片
Android调用系统相机和自定义相机实例本博文主要是介绍了android上使用相机进行拍照并显示的两种方式,并且由于涉及到要把拍到的照片显…
日期:2022-11-24 点赞:512 阅读:7,820
Struts的使用
一、Struts2的获取  Struts的官方网站为:http://struts.apache.org/  下载完Struts2的jar包,…
日期:2022-11-24 点赞:671 阅读:4,903