DOKK / manpages / debian 11 / libibumad-dev / umad_release_port.3.en
UMAD_GET_PORT(3) OpenIB Programmer's Manual UMAD_GET_PORT(3)

umad_get_port, umad_release_port - open and close an InfiniBand port

#include <infiniband/umad.h>

int umad_get_port(char *ca_name, int portnum, umad_port_t *port);

int umad_release_port(umad_port_t *port);

umad_get_port() fills the port structure with the IB port attributes specified by ca_name and portnum , or the default port if ca_name is NULL and portnum is zero. If only one of ca_name and portnum are specified, the other is used as a filter. For example, passing a NULL ca_name and 2 for the portnum means get a port from any of the local IB devices, as long as it is the second port. Note that the library may use some reference scheme to support port caching therefore umad_release_port() should be called before the port structure can be deallocated. The argument port is an umad_port_t struct, as specified in <infiniband/umad.h>.

typedef struct umad_port {

char ca_name[UMAD_CA_NAME_LEN]; /* Name of the device */ int portnum; /* Physical port number */ uint base_lid; /* Base port LID */ uint lmc; /* LMC of LID */ uint sm_lid; /* SM LID */ uint sm_sl; /* SM service level */ uint state; /* Logical port state */ uint phys_state; /* Physical port state */ uint rate; /* Port link bit rate */ uint64_t capmask; /* Port capabilities */ uint64_t gid_prefix; /* Gid prefix of this port */ uint64_t port_guid; /* GUID of this port */
} umad_port_t;

umad_release_port() releases the resources that were allocated by the umad_get_port() function for the specified IB port.

umad_get_port() and umad_release_port() return 0 on success, and a negative value on error.

May 21, 2007 OpenIB