ibv_get_device_guid()
Contents
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:
|
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); |
Comments
Tell us what do you think.
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
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
Thanks for your help,
The issue was caused when i reached the system limit for the number of open files.
Ariel
Thanks!
I updated the post on this issue.
Dotan