| 1 |
.\" -*- nroff -*- |
| 2 |
.\" Licensed under the OpenIB.org BSD license (FreeBSD Variant) - See COPYING.md |
| 3 |
.\" |
| 4 |
.TH IBV_QUERY_PORT 3 2006-10-31 libibverbs "Libibverbs Programmer's Manual" |
| 5 |
.SH "NAME" |
| 6 |
ibv_query_port \- query an RDMA port's attributes |
| 7 |
.SH "SYNOPSIS" |
| 8 |
.nf |
| 9 |
.B #include <infiniband/verbs.h> |
| 10 |
.sp |
| 11 |
.BI "int ibv_query_port(struct ibv_context " "*context" ", uint8_t " "port_num" , |
| 12 |
.BI " struct ibv_port_attr " "*port_attr" "); |
| 13 |
.fi |
| 14 |
.SH "DESCRIPTION" |
| 15 |
.B ibv_query_port() |
| 16 |
returns the attributes of port |
| 17 |
.I port_num |
| 18 |
for device context |
| 19 |
.I context |
| 20 |
through the pointer |
| 21 |
.I port_attr\fR. |
| 22 |
The argument |
| 23 |
.I port_attr |
| 24 |
is an ibv_port_attr struct, as defined in <infiniband/verbs.h>. |
| 25 |
.PP |
| 26 |
.nf |
| 27 |
struct ibv_port_attr { |
| 28 |
.in +8 |
| 29 |
enum ibv_port_state state; /* Logical port state */ |
| 30 |
enum ibv_mtu max_mtu; /* Max MTU supported by port */ |
| 31 |
enum ibv_mtu active_mtu; /* Actual MTU */ |
| 32 |
int gid_tbl_len; /* Length of source GID table */ |
| 33 |
uint32_t port_cap_flags; /* Port capabilities */ |
| 34 |
uint32_t max_msg_sz; /* Maximum message size */ |
| 35 |
uint32_t bad_pkey_cntr; /* Bad P_Key counter */ |
| 36 |
uint32_t qkey_viol_cntr; /* Q_Key violation counter */ |
| 37 |
uint16_t pkey_tbl_len; /* Length of partition table */ |
| 38 |
uint16_t lid; /* Base port LID */ |
| 39 |
uint16_t sm_lid; /* SM LID */ |
| 40 |
uint8_t lmc; /* LMC of LID */ |
| 41 |
uint8_t max_vl_num; /* Maximum number of VLs */ |
| 42 |
uint8_t sm_sl; /* SM service level */ |
| 43 |
uint8_t subnet_timeout; /* Subnet propagation delay */ |
| 44 |
uint8_t init_type_reply;/* Type of initialization performed by SM */ |
| 45 |
uint8_t active_width; /* Currently active link width */ |
| 46 |
uint8_t active_speed; /* Currently active link speed if speed<XDR,NDR otherwise */ |
| 47 |
uint8_t phys_state; /* Physical port state */ |
| 48 |
uint8_t link_layer; /* link layer protocol of the port */ |
| 49 |
uint8_t flags; /* Port flags */ |
| 50 |
uint16_t port_cap_flags2;/* Port capabilities */ |
| 51 |
uint32_t active_speed_ex;/* Currently active link speed, if it is 0 refer to active_speed instead */ |
| 52 |
.in -8 |
| 53 |
}; |
| 54 |
.sp |
| 55 |
possible values for the link layer field are IBV_LINK_LAYER_INFINIBAND, |
| 56 |
IBV_LINK_LAYER_ETHERNET, or IBV_LINK_LAYER_UNSPECIFIED. |
| 57 |
.sp |
| 58 |
supported port flags: |
| 59 |
IBV_QPF_GRH_REQUIRED - When this flag is set, the applications must create all AH with GRH configured. |
| 60 |
.sp |
| 61 |
.fi |
| 62 |
.SH "RETURN VALUE" |
| 63 |
.B ibv_query_port() |
| 64 |
returns 0 on success, or the value of errno on failure (which indicates the failure reason). |
| 65 |
.SH "SEE ALSO" |
| 66 |
.BR ibv_create_qp (3), |
| 67 |
.BR ibv_destroy_qp (3), |
| 68 |
.BR ibv_query_qp (3), |
| 69 |
.BR ibv_create_ah (3) |
| 70 |
.SH "AUTHORS" |
| 71 |
.TP |
| 72 |
Dotan Barak <[email protected]> |