1UMAD_GET_PORT(3)          OpenIB Programmer´s Manual          UMAD_GET_PORT(3)
2
3
4

NAME

6       umad_get_port, umad_release_port - open and close an InfiniBand port
7

SYNOPSIS

9       #include <infiniband/umad.h>
10
11       int umad_get_port(char *ca_name, int portnum, umad_port_t *port);
12
13       int umad_release_port(umad_port_t *port);
14

DESCRIPTION

16       umad_get_port()  fills  the  port structure with the IB port attributes
17       specified by ca_name and portnum , or the default port  if  ca_name  is
18       NULL and portnum is zero. If only one of ca_name and portnum are speci‐
19       fied, the other is used as a  filter.   For  example,  passing  a  NULL
20       ca_name and 2 for the portnum means get a port from any of the local IB
21       devices, as long as it is the second port.  Note that the  library  may
22       use   some   reference   scheme   to  support  port  caching  therefore
23       umad_release_port() should be called before the port structure  can  be
24       deallocated.   The argument port is an umad_port_t struct, as specified
25       in <infiniband/umad.h>.
26
27       typedef struct umad_port {
28               char ca_name[UMAD_CA_NAME_LEN];                 /* Name of the device */
29               int portnum;                                    /* Physical port number */
30               uint base_lid;                                  /* Base port LID */
31               uint lmc;                                       /* LMC of LID */
32               uint sm_lid;                                    /* SM LID */
33               uint sm_sl;                                     /* SM service level */
34               uint state;                                     /* Logical port state */
35               uint phys_state;                                /* Physical port state */
36               uint rate;                                      /* Port link bit rate */
37               uint64_t capmask;                               /* Port capabilities */
38               uint64_t gid_prefix;                            /* Gid prefix of this port */
39               uint64_t port_guid;                             /* GUID of this port */
40       } umad_port_t;
41
42       umad_release_port() releases the resources that were allocated  by  the
43       umad_get_port() function for the specified IB port.
44

RETURN VALUE

46       umad_get_port() and umad_release_port() return 0 on success, and a neg‐
47       ative value on error.
48

AUTHORS

50       Hal Rosenstock <halr@voltaire.com>
51
52       Dotan Barak <dotanb@mellanox.co.il>
53
54
55
56OpenIB                           May 21, 2007                 UMAD_GET_PORT(3)
Impressum