diff options
author | Michael Wang <yun.wang@profitbricks.com> | 2015-05-05 08:50:19 -0400 |
---|---|---|
committer | Doug Ledford <dledford@redhat.com> | 2015-05-18 13:35:03 -0400 |
commit | de66be94749d75c2f3578f3d01f91d31a8eb85ef (patch) | |
tree | a69c833f25a507451f11ea57347ca4c7d1d29fea /include/rdma | |
parent | 6b90a6d66b17bfe09351e18c705cb4a2ed147300 (diff) |
IB/Verbs: Implement raw management helpers
Add raw helpers:
rdma_protocol_ib
rdma_protocol_iboe
rdma_protocol_iwarp
rdma_ib_or_iboe (transition, clean up later)
To help us detect which technology the port supported.
Signed-off-by: Michael Wang <yun.wang@profitbricks.com>
Reviewed-by: Ira Weiny <ira.weiny@intel.com>
Tested-by: Ira Weiny <ira.weiny@intel.com>
Reviewed-by: Sean Hefty <sean.hefty@intel.com>
Reviewed-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
Tested-by: Doug Ledford <dledford@redhat.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
Diffstat (limited to 'include/rdma')
-rw-r--r-- | include/rdma/ib_verbs.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h index 080f204273e4..e6dd9846b6c2 100644 --- a/include/rdma/ib_verbs.h +++ b/include/rdma/ib_verbs.h | |||
@@ -1752,6 +1752,28 @@ int ib_query_port(struct ib_device *device, | |||
1752 | enum rdma_link_layer rdma_port_get_link_layer(struct ib_device *device, | 1752 | enum rdma_link_layer rdma_port_get_link_layer(struct ib_device *device, |
1753 | u8 port_num); | 1753 | u8 port_num); |
1754 | 1754 | ||
1755 | static inline bool rdma_protocol_ib(struct ib_device *device, u8 port_num) | ||
1756 | { | ||
1757 | return device->query_protocol(device, port_num) == RDMA_PROTOCOL_IB; | ||
1758 | } | ||
1759 | |||
1760 | static inline bool rdma_protocol_iboe(struct ib_device *device, u8 port_num) | ||
1761 | { | ||
1762 | return device->query_protocol(device, port_num) == RDMA_PROTOCOL_IBOE; | ||
1763 | } | ||
1764 | |||
1765 | static inline bool rdma_protocol_iwarp(struct ib_device *device, u8 port_num) | ||
1766 | { | ||
1767 | return device->query_protocol(device, port_num) == RDMA_PROTOCOL_IWARP; | ||
1768 | } | ||
1769 | |||
1770 | static inline bool rdma_ib_or_iboe(struct ib_device *device, u8 port_num) | ||
1771 | { | ||
1772 | enum rdma_protocol_type pt = device->query_protocol(device, port_num); | ||
1773 | |||
1774 | return (pt == RDMA_PROTOCOL_IB || pt == RDMA_PROTOCOL_IBOE); | ||
1775 | } | ||
1776 | |||
1755 | int ib_query_gid(struct ib_device *device, | 1777 | int ib_query_gid(struct ib_device *device, |
1756 | u8 port_num, int index, union ib_gid *gid); | 1778 | u8 port_num, int index, union ib_gid *gid); |
1757 | 1779 | ||