使用RDMA ibverbs 编程

  1. 浏览编程手册
    RDMA Aware Networks Programming User Mannual
  2. 上面的例子已经有好心人搬到了Github上RDMA-EXAMPLE
  3. 找了一台ARM64机器准备开始,不知道支不支持
  4. 执行下面的命令:
    unzip RDMA-EXAMPLE-master.zip
    cd RDMA-EXAMPLE-master
    make
    #发现make不行
    me@ubuntu:~/RDMA-EXAMPLE-master/01$ make
    cc service.c -o service -g -libverbs
    service.c:31:10: fatal error: infiniband/verbs.h: No such file or directory
     #include 
              ^~~~~~~~~~~~~~~~~~~~
    compilation terminated.
    Makefile:2: recipe for target 'service' failed
    make: *** [service] Error 1
    
    经过google,发现已经有人遇到过了libvers问题,安装一下就可以了
    me@ubuntu:~/RDMA-EXAMPLE-master/01$ sudo apt-get install libibverbs-dev
    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    The following NEW packages will be installed:
      libibverbs-dev
    0 upgraded, 1 newly installed, 0 to remove and 198 not upgraded.
    Need to get 103 kB of archives.
    After this operation, 287 kB of additional disk space will be used.
    Get:1 http://cn.ports.ubuntu.com/ubuntu-ports bionic/main arm64 libibverbs-dev arm64 17.1-1 [103 kB]
    Fetched 103 kB in 2s (48.2 kB/s)
    Selecting previously unselected package libibverbs-dev:arm64.
    (Reading database ... 72384 files and directories currently installed.)
    Preparing to unpack .../libibverbs-dev_17.1-1_arm64.deb ...
    Unpacking libibverbs-dev:arm64 (17.1-1) ...
    Processing triggers for man-db (2.8.3-2) ...
    Setting up libibverbs-dev:arm64 (17.1-1) ...
    
    再make发现成功了。
    me@ubuntu:~/RDMA-EXAMPLE-master/01$ make
    cc service.c -o service -g -libverbs
    me@ubuntu:~/RDMA-EXAMPLE-master/01$
    me@ubuntu:~/RDMA-EXAMPLE-master/01$ ls
    Makefile  README.md  service  service.c
    
  5. 不管三七二十一先跑一下再说:
    me@ubuntu:~/RDMA-EXAMPLE-master/01$ ./service -g 0 &
    [1] 11011
    me@ubuntu:~/RDMA-EXAMPLE-master/01$  ------------------------------------------------
     Device name : "(null)"
     IB port : 1
     TCP port : 19875
     GID index : 0
     ------------------------------------------------
    
    waiting on port 19875 for TCP connection
    
    me@ubuntu:~/RDMA-EXAMPLE-master/01$ ./service -g 0 192.168.1.201
    servername=192.168.1.201
     ------------------------------------------------
     Device name : "(null)"
     IB port : 1
     IP : 192.168.1.201
     TCP port : 19875
     GID index : 0
     ------------------------------------------------
    
    TCP connection was established
    searching for IB devices in host
    TCP connection was established
    searching for IB devices in host
    failed to get IB devices list
    failed to get IB devices list
    failed to create resources
    
    test result is 1
    failed to create resources
    
    test result is 1
    [1]+  Exit 1                  ./service -g 0
    
    
  6. 结论这台机器不支持ib verbs操作

你可能感兴趣的:(C)