1UMAD_GET_PORT(3) OpenIB Programmer´s Manual UMAD_GET_PORT(3)
2
3
4
6 umad_get_port, umad_release_port - open and close an InfiniBand port
7
9 #include <infiniband/umad.h>
10
11 int umad_get_port(char *ca_name, int portnum, umad_port_t *port);
12 int umad_release_port(umad_port_t *port);
13
15 umad_get_port() fills the port structure with the IB port attributes
16 specified by ca_name and portnum , or the default port if ca_name is
17 NULL and portnum is zero. If only one of ca_name and portnum are speci‐
18 fied, the other is used as a filter. For example, passing a NULL
19 ca_name and 2 for the portnum means get a port from any of the local IB
20 devices, as long as it is the second port. Note that the library may
21 use some reference scheme to support port caching therefore
22 umad_release_port() should be called before the port structure can be
23 deallocated. The argument port is an umad_port_t struct, as specified
24 in <infiniband/umad.h>.
25
26 typedef struct umad_port {
27 char ca_name[UMAD_CA_NAME_LEN]; /* Name of the device */
28 int portnum; /* Physical port number */
29 uint base_lid; /* Base port LID */
30 uint lmc; /* LMC of LID */
31 uint sm_lid; /* SM LID */
32 uint sm_sl; /* SM service level */
33 uint state; /* Logical port state */
34 uint phys_state; /* Physical port state */
35 uint rate; /* Port link bit rate */
36 uint64_t capmask; /* Port capabilities */
37 uint64_t gid_prefix; /* Gid prefix of this port */
38 uint64_t port_guid; /* GUID of this port */
39 } umad_port_t;
40
41 umad_release_port() releases the resources that were allocated by the
42 umad_get_port() function for the specified IB port.
43
45 umad_get_port() and umad_release_port() return 0 on success, and a neg‐
46 ative value on error.
47
49 Hal Rosenstock <halr@voltaire.com>
50
51 Dotan Barak <dotanb@mellanox.co.il>
52
53
54
55OpenIB May 21, 2007 UMAD_GET_PORT(3)