Skip to content

ibv_get_device_guid()

5.00 avg. rating (97% score) - 1 vote
uint64_t ibv_get_device_guid(struct ibv_device *device);

Description

ibv_get_device_guid() returns the Global Unique IDentifier (GUID) of the RDMA device device.

This GUID, that was assigned to this device by its vendor during the manufacturing, is unique and can be used as an identifier to an RDMA device.

From the prefix of the RDMA device GUID, one can know who is the vendor of that device using the following URL: IEEE OUI

Parameters

Name Direction Description
device in RDMA device entry that was returned from ibv_get_device_list()

Return Values

Value Description
Device GUID in network byte order On success
0 On failure, errno indicates the failure reason:

EMFILE Too many files are opened by this process

Examples

Show all existing RDMA device GUID numbers:

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");
        exit(1);
}
 
for (i = 0; i < num_devices; ++ i)
        printf("RDMA device[%d]: GUID=%016llx\n", i,
               (unsigned long long)ntohll(ibv_get_device_guid(device_list[i])));
 
ibv_free_device_list(device_list);

show_devices_guid.c

Share Our Posts

Share this post through social bookmarks.

  • Delicious
  • Digg
  • Newsvine
  • RSS
  • StumbleUpon
  • Technorati

Comments

Tell us what do you think.

  1. Ariel says: December 18, 2014

    Hi Dotan,
    I'm experiencing an error where ibv_get_device_guid is returning zero. Is there some way to find out what is causing the error?
    There is nothing on the man page regarding errors.
    Thanks,
    Ariel

    • Dotan Barak says: December 18, 2014

      ibv_get_device_guid() is only a wrapper to /sys/class/infiniband//ports//gids/.
      You should check manually if there is a value.
      (This can give a hint on what is going on).

      Theoretically, this verb should never fail..

      Thanks
      Dotan

      • Ariel says: December 21, 2014

        Thanks for your help,
        The issue was caused when i reached the system limit for the number of open files.
        Ariel

      • Dotan Barak says: December 27, 2014

        Thanks!

        I updated the post on this issue.

        Dotan

Add a Comment

Fill in the form and submit.

Time limit is exhausted. Please reload CAPTCHA.