| 1 |
.\" -*- nroff -*- |
| 2 |
.\" Licensed under the OpenIB.org BSD license (FreeBSD Variant) - See COPYING.md |
| 3 |
.\" |
| 4 |
.TH IBV_QUERY_DEVICE_EX 3 2014-12-17 libibverbs "Libibverbs Programmer's Manual" |
| 5 |
.SH "NAME" |
| 6 |
ibv_query_device_ex \- query an RDMA device's attributes including extended |
| 7 |
device properties. |
| 8 |
.SH "SYNOPSIS" |
| 9 |
.nf |
| 10 |
.B #include <infiniband/verbs.h> |
| 11 |
.sp |
| 12 |
.BI "int ibv_query_device_ex(struct ibv_context " "*context", |
| 13 |
.BI " struct ibv_query_device_ex_input " "*input", |
| 14 |
.BI " struct ibv_device_attr_ex " "*attr" ); |
| 15 |
.fi |
| 16 |
.SH "DESCRIPTION" |
| 17 |
.B ibv_query_device_ex() |
| 18 |
returns the attributes of the device with context |
| 19 |
.I context\fR. |
| 20 |
The argument |
| 21 |
.I input |
| 22 |
is a pointer to an ibv_query_device_ex_input structure, used for future extensions |
| 23 |
The argument |
| 24 |
.I attr |
| 25 |
is a pointer to an ibv_device_attr_ex struct, as defined in <infiniband/verbs.h>. |
| 26 |
.PP |
| 27 |
.nf |
| 28 |
struct ibv_device_attr_ex { |
| 29 |
.in +8 |
| 30 |
struct ibv_device_attr orig_attr; |
| 31 |
uint32_t comp_mask; /* Compatibility mask that defines which of the following variables are valid */ |
| 32 |
struct ibv_odp_caps odp_caps; /* On-Demand Paging capabilities */ |
| 33 |
uint64_t completion_timestamp_mask; /* Completion timestamp mask (0 = unsupported) */ |
| 34 |
uint64_t hca_core_clock; /* The frequency (in kHZ) of the HCA (0 = unsupported) */ |
| 35 |
uint64_t device_cap_flags_ex; /* Extended device capability flags */ |
| 36 |
struct ibv_tso_caps tso_caps; /* TCP segmentation offload capabilities */ |
| 37 |
struct ibv_rss_caps rss_caps; /* RSS capabilities */ |
| 38 |
uint32_t max_wq_type_rq; /* Max Work Queue from type RQ */ |
| 39 |
struct ibv_packet_pacing_caps packet_pacing_caps; /* Packet pacing capabilities */ |
| 40 |
uint32_t raw_packet_caps; /* Raw packet capabilities, use enum ibv_raw_packet_caps */ |
| 41 |
struct ibv_tm_caps tm_caps; /* Tag matching capabilities */ |
| 42 |
struct ibv_cq_moderation_caps cq_mod_caps; /* CQ moderation max capabilities */ |
| 43 |
uint64_t max_dm_size; /* Max Device Memory size (in bytes) available for allocation */ |
| 44 |
struct ibv_pci_atomic_caps atomic_caps; /* PCI atomic operations capabilities, use enum ibv_pci_atomic_op_size */ |
| 45 |
uint32_t xrc_odp_caps; /* Mask with enum ibv_odp_transport_cap_bits to know which operations are supported. */ |
| 46 |
uint32_t phys_port_cnt_ex /* Extended number of physical port count, allows exposing more than 255 ports device */ |
| 47 |
.in -8 |
| 48 |
}; |
| 49 |
|
| 50 |
struct ibv_odp_caps { |
| 51 |
uint64_t general_odp_caps; /* Mask with enum ibv_odp_general_cap_bits */ |
| 52 |
struct { |
| 53 |
uint32_t rc_odp_caps; /* Mask with enum ibv_odp_tranport_cap_bits to know which operations are supported. */ |
| 54 |
uint32_t uc_odp_caps; /* Mask with enum ibv_odp_tranport_cap_bits to know which operations are supported. */ |
| 55 |
uint32_t ud_odp_caps; /* Mask with enum ibv_odp_tranport_cap_bits to know which operations are supported. */ |
| 56 |
} per_transport_caps; |
| 57 |
}; |
| 58 |
|
| 59 |
enum ibv_odp_general_cap_bits { |
| 60 |
IBV_ODP_SUPPORT = 1 << 0, /* On demand paging is supported */ |
| 61 |
IBV_ODP_SUPPORT_IMPLICIT = 1 << 1, /* Implicit on demand paging is supported */ |
| 62 |
}; |
| 63 |
|
| 64 |
enum ibv_odp_transport_cap_bits { |
| 65 |
IBV_ODP_SUPPORT_SEND = 1 << 0, /* Send operations support on-demand paging */ |
| 66 |
IBV_ODP_SUPPORT_RECV = 1 << 1, /* Receive operations support on-demand paging */ |
| 67 |
IBV_ODP_SUPPORT_WRITE = 1 << 2, /* RDMA-Write operations support on-demand paging */ |
| 68 |
IBV_ODP_SUPPORT_READ = 1 << 3, /* RDMA-Read operations support on-demand paging */ |
| 69 |
IBV_ODP_SUPPORT_ATOMIC = 1 << 4, /* RDMA-Atomic operations support on-demand paging */ |
| 70 |
IBV_ODP_SUPPORT_SRQ_RECV = 1 << 5, /* SRQ receive operations support on-demand paging */ |
| 71 |
IBV_ODP_SUPPORT_FLUSH = 1 << 6, /* RDMA-Flush operations support on-demand paging */ |
| 72 |
IBV_ODP_SUPPORT_ATOMIC_WRITE = 1 << 7, /* RDMA-Atomic-write operations support on-demand paing */ |
| 73 |
}; |
| 74 |
|
| 75 |
struct ibv_tso_caps { |
| 76 |
uint32_t max_tso; /* Maximum payload size in bytes supported for segmentation by TSO engine.*/ |
| 77 |
uint32_t supported_qpts; /* Bitmap showing which QP types are supported by TSO operation. */ |
| 78 |
}; |
| 79 |
|
| 80 |
struct ibv_rss_caps { |
| 81 |
uint32_t supported_qpts; /* Bitmap showing which QP types are supported RSS */ |
| 82 |
uint32_t max_rwq_indirection_tables; /* Max receive work queue indirection tables */ |
| 83 |
uint32_t max_rwq_indirection_table_size; /* Max receive work queue indirection table size */ |
| 84 |
uint64_t rx_hash_fields_mask; /* Mask with enum ibv_rx_hash_fields to know which incoming packet's field can participates in the RX hash */ |
| 85 |
uint8_t rx_hash_function; /* Mask with enum ibv_rx_hash_function_flags to know which hash functions are supported */ |
| 86 |
}; |
| 87 |
|
| 88 |
struct ibv_packet_pacing_caps { |
| 89 |
uint32_t qp_rate_limit_min; /* Minimum rate limit in kbps */ |
| 90 |
uint32_t qp_rate_limit_max; /* Maximum rate limit in kbps */ |
| 91 |
uint32_t supported_qpts; /* Bitmap showing which QP types are supported. */ |
| 92 |
}; |
| 93 |
|
| 94 |
enum ibv_raw_packet_caps { |
| 95 |
.in +8 |
| 96 |
IBV_RAW_PACKET_CAP_CVLAN_STRIPPING = 1 << 0, /* CVLAN stripping is supported */ |
| 97 |
IBV_RAW_PACKET_CAP_SCATTER_FCS = 1 << 1, /* FCS scattering is supported */ |
| 98 |
IBV_RAW_PACKET_CAP_IP_CSUM = 1 << 2, /* IP CSUM offload is supported */ |
| 99 |
.in -8 |
| 100 |
}; |
| 101 |
|
| 102 |
enum ibv_tm_cap_flags { |
| 103 |
.in +8 |
| 104 |
IBV_TM_CAP_RC = 1 << 0, /* Support tag matching on RC transport */ |
| 105 |
.in -8 |
| 106 |
}; |
| 107 |
|
| 108 |
struct ibv_tm_caps { |
| 109 |
.in +8 |
| 110 |
uint32_t max_rndv_hdr_size; /* Max size of rendezvous request header */ |
| 111 |
uint32_t max_num_tags; /* Max number of tagged buffers in a TM-SRQ matching list */ |
| 112 |
uint32_t flags; /* From enum ibv_tm_cap_flags */ |
| 113 |
uint32_t max_ops; /* Max number of outstanding list operations */ |
| 114 |
uint32_t max_sge; /* Max number of SGEs in a tagged buffer */ |
| 115 |
.in -8 |
| 116 |
}; |
| 117 |
|
| 118 |
struct ibv_cq_moderation_caps { |
| 119 |
uint16_t max_cq_count; |
| 120 |
uint16_t max_cq_period; |
| 121 |
}; |
| 122 |
|
| 123 |
enum ibv_pci_atomic_op_size { |
| 124 |
.in +8 |
| 125 |
IBV_PCI_ATOMIC_OPERATION_4_BYTE_SIZE_SUP = 1 << 0, |
| 126 |
IBV_PCI_ATOMIC_OPERATION_8_BYTE_SIZE_SUP = 1 << 1, |
| 127 |
IBV_PCI_ATOMIC_OPERATION_16_BYTE_SIZE_SUP = 1 << 2, |
| 128 |
.in -8 |
| 129 |
}; |
| 130 |
|
| 131 |
struct ibv_pci_atomic_caps { |
| 132 |
.in +8 |
| 133 |
uint16_t fetch_add; /* Supported sizes for an atomic fetch and add operation, use enum ibv_pci_atomic_op_size */ |
| 134 |
uint16_t swap; /* Supported sizes for an atomic unconditional swap operation, use enum ibv_pci_atomic_op_size */ |
| 135 |
uint16_t compare_swap; /* Supported sizes for an atomic compare and swap operation, use enum ibv_pci_atomic_op_size */ |
| 136 |
.in -8 |
| 137 |
}; |
| 138 |
.fi |
| 139 |
|
| 140 |
Extended device capability flags (device_cap_flags_ex): |
| 141 |
.br |
| 142 |
.TP 7 |
| 143 |
IBV_DEVICE_PCI_WRITE_END_PADDING |
| 144 |
|
| 145 |
Indicates the device has support for padding PCI writes to a full cache line. |
| 146 |
|
| 147 |
Padding packets to full cache lines reduces the amount of traffic |
| 148 |
required at the memory controller at the expense of creating more |
| 149 |
traffic on the PCI-E port. |
| 150 |
|
| 151 |
Workloads that have a high CPU memory load and low PCI-E utilization |
| 152 |
will benefit from this feature, while workloads that have a high PCI-E |
| 153 |
utilization and small packets will be harmed. |
| 154 |
|
| 155 |
For instance, with a 128 byte cache line size, the transfer of any |
| 156 |
packets less than 128 bytes will require a full 128 transfer on PCI, |
| 157 |
potentially doubling the required PCI-E bandwidth. |
| 158 |
|
| 159 |
This feature can be enabled on a QP or WQ basis via the |
| 160 |
IBV_QP_CREATE_PCI_WRITE_END_PADDING or IBV_WQ_FLAGS_PCI_WRITE_END_PADDING |
| 161 |
flags. |
| 162 |
|
| 163 |
.SH "RETURN VALUE" |
| 164 |
.B ibv_query_device_ex() |
| 165 |
returns 0 on success, or the value of errno on failure (which indicates the failure reason). |
| 166 |
.SH "NOTES" |
| 167 |
The maximum values returned by this function are the upper limits of |
| 168 |
supported resources by the device. However, it may not be possible to |
| 169 |
use these maximum values, since the actual number of any resource that |
| 170 |
can be created may be limited by the machine configuration, the amount |
| 171 |
of host memory, user permissions, and the amount of resources already |
| 172 |
in use by other users/processes. |
| 173 |
.SH "SEE ALSO" |
| 174 |
.BR ibv_query_device (3), |
| 175 |
.BR ibv_open_device (3), |
| 176 |
.BR ibv_query_port (3), |
| 177 |
.BR ibv_query_pkey (3), |
| 178 |
.BR ibv_query_gid (3) |
| 179 |
.SH "AUTHORS" |
| 180 |
.TP |
| 181 |
Majd Dibbiny <[email protected]> |