IB/Verbs: Use management helper rdma_cap_ib_smi()

Introduce helper rdma_cap_ib_smi() to help us check if the port of an
IB device support Infiniband Subnet Management Interface.

Signed-off-by: Michael Wang <[email protected]>
Reviewed-by: Ira Weiny <[email protected]>
Tested-by: Ira Weiny <[email protected]>
Reviewed-by: Sean Hefty <[email protected]>
Reviewed-by: Jason Gunthorpe <[email protected]>
Tested-by: Doug Ledford <[email protected]>
Signed-off-by: Doug Ledford <[email protected]>
This commit is contained in:
Michael Wang 2015-05-05 14:50:33 +02:00 • committed by Doug Ledford
commit 29541e3add
3 changed files with 17 additions and 2 deletions

View file

@ -1789,6 +1789,21 @@ static inline bool rdma_cap_ib_mad(struct ib_device *device, u8 port_num)
return rdma_ib_or_iboe(device, port_num);
}
/**
* rdma_cap_ib_smi - Check if the port of device has the capability Infiniband
* Subnet Management Interface.
*
* @device: Device to be checked
* @port_num: Port number of the device
*
* Return false when port of the device don't support Infiniband
* Subnet Management Interface.
*/
static inline bool rdma_cap_ib_smi(struct ib_device *device, u8 port_num)
{
return rdma_protocol_ib(device, port_num);
}
int ib_query_gid(struct ib_device *device,
u8 port_num, int index, union ib_gid *gid);