描述
ibv_query_port()返回RDMA设备上下文(context)的端口的属性。
这是struct ibv_port_attr的完整描述:
* supported, but not really relevant
Most of the port attributes, returned byibv_query_port(), aren't constant and may be changed, mainly by the SM (in InfiniBand), or by the Hardware. It is highly recommended avoiding saving the result of this query, or to flush them when a new SM (re)configures the subnet.
Parameters
Return Values
Examples
Query a port attributes:
show_port_attr.c
FAQs
I'm using iWarp/IBoE, do I need all of the values that ibv_query_port() returns?
No. Check the protocol columns, to understand which attributes are relevant for you.
I'm using IB, do I need all of the valuesthatibv_query_port() returns?
No. There are fields that you will use more often (such as state), some you may use when debugging problems (the counters) and some of them are informative for other services.
Calling every time toibv_query_port() when I need a port attribute takes time, can I cache some of the attributes?
Actually, yes. The attributes, which indicates the port supported attributes (such as supported table length and capabilities) won't change, but others, which are configured by the SM, state and counters may change.
In InfiniBand, if you want, you can cache the returned structure and query it only when an unaffiliated asynchronous event occurred (this will be discussed later on in other posts).
如果觉得《【verbs】ibv_query_port()》对你有帮助,请点赞、收藏,并留下你的观点哦!