ibv_query_gid

Gets GID, which is the NIC's MAC address.

Syntax

#include <rdma/verbs.h>
int ibv_query_gid(struct ibv_context *context, uint8_t port_num, int index, union ibv_gid *gid)

Description

The ibv_query_gid() routine returns the NIC's MAC address in subnet_prefix and 0 in the interface_id.

Input Parameters

context Specifies the context pointer returned by ibv_open_device().
port_num Specifies port number for the device returned by ibv_query_device().
index Specifies index for port_num deduced from attributes returned by ibv_query_port().

Output Parameter

gid Specifies the pointer to store GID.

Return Values

0 On success.
-1 If the request fails because, the context or gid parameter is NULL or the open or write operation failed on the OFED admin device /dev/rdma/ofed_adm.
ibv_gid
union ibv_gid 
{ 
       uint8_t      raw[16]; 
       struct 
       { 
           uint64_t subnet_prefix; 
           uint64_t interface_id; 
       } global; 
}; 
[ Feedback ]