diff options
author | Dasaratharaman Chandramouli <dasaratharaman.chandramouli@intel.com> | 2017-03-20 19:38:09 -0400 |
---|---|---|
committer | Doug Ledford <dledford@redhat.com> | 2017-04-28 14:00:17 -0400 |
commit | 94d595c56077fd8b0f61701e03fd4b3dc8c62038 (patch) | |
tree | f4d297869582298814dc6af39732f8d981f27674 | |
parent | ee1c60b1bff8f258fa530def3459726f8e922caf (diff) |
IB/core: Add rdma_cap_opa_ah to expose opa address handles
rdma_cap_opa_ah(..) enables core components to check if the
corresponding port supports OPA extended addressing.
Reviewed-by: Ira Weiny <ira.weiny@intel.com>
Reviewed-by: Don Hiatt <don.hiatt@intel.com>
Signed-off-by: Dasaratharaman Chandramouli <dasaratharaman.chandramouli@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
-rw-r--r-- | include/rdma/ib_verbs.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h index ab2dc5284e8c..b6a0b5fa7f15 100644 --- a/include/rdma/ib_verbs.h +++ b/include/rdma/ib_verbs.h | |||
@@ -501,6 +501,7 @@ static inline struct rdma_hw_stats *rdma_alloc_hw_stats_struct( | |||
501 | /* Address format 0x000FF000 */ | 501 | /* Address format 0x000FF000 */ |
502 | #define RDMA_CORE_CAP_AF_IB 0x00001000 | 502 | #define RDMA_CORE_CAP_AF_IB 0x00001000 |
503 | #define RDMA_CORE_CAP_ETH_AH 0x00002000 | 503 | #define RDMA_CORE_CAP_ETH_AH 0x00002000 |
504 | #define RDMA_CORE_CAP_OPA_AH 0x00004000 | ||
504 | 505 | ||
505 | /* Protocol 0xFFF00000 */ | 506 | /* Protocol 0xFFF00000 */ |
506 | #define RDMA_CORE_CAP_PROT_IB 0x00100000 | 507 | #define RDMA_CORE_CAP_PROT_IB 0x00100000 |
@@ -2605,6 +2606,21 @@ static inline bool rdma_cap_eth_ah(const struct ib_device *device, u8 port_num) | |||
2605 | } | 2606 | } |
2606 | 2607 | ||
2607 | /** | 2608 | /** |
2609 | * rdma_cap_opa_ah - Check if the port of device supports | ||
2610 | * OPA Address handles | ||
2611 | * @device: Device to check | ||
2612 | * @port_num: Port number to check | ||
2613 | * | ||
2614 | * Return: true if we are running on an OPA device which supports | ||
2615 | * the extended OPA addressing. | ||
2616 | */ | ||
2617 | static inline bool rdma_cap_opa_ah(struct ib_device *device, u8 port_num) | ||
2618 | { | ||
2619 | return (device->port_immutable[port_num].core_cap_flags & | ||
2620 | RDMA_CORE_CAP_OPA_AH) == RDMA_CORE_CAP_OPA_AH; | ||
2621 | } | ||
2622 | |||
2623 | /** | ||
2608 | * rdma_max_mad_size - Return the max MAD size required by this RDMA Port. | 2624 | * rdma_max_mad_size - Return the max MAD size required by this RDMA Port. |
2609 | * | 2625 | * |
2610 | * @device: Device | 2626 | * @device: Device |