summaryrefslogtreecommitdiffstats
path: root/include/rdma
diff options
context:
space:
mode:
authorHiatt, Don <don.hiatt@intel.com>2017-06-08 13:38:02 -0400
committerDoug Ledford <dledford@redhat.com>2017-08-08 14:50:25 -0400
commite92aa00a518971fca6b79aa87a1a9c5e5aa51f3b (patch)
tree5c5af9e2c932e7008f3cfc0ad776544ea16b9e38 /include/rdma
parent7db20ecd1d9700e2c240dee505162eb56ab55b5b (diff)
downloadlinux-stable-e92aa00a518971fca6b79aa87a1a9c5e5aa51f3b.tar.gz
linux-stable-e92aa00a518971fca6b79aa87a1a9c5e5aa51f3b.tar.bz2
linux-stable-e92aa00a518971fca6b79aa87a1a9c5e5aa51f3b.zip
IB/CM: Add OPA Path record support to CM
Add OPA path record support to the Connection Manager. Signed-off-by: Don Hiatt <don.hiatt@intel.com> Reviewed-by: Ira Weiny <ira.weiny@intel.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
Diffstat (limited to 'include/rdma')
-rw-r--r--include/rdma/opa_addr.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/include/rdma/opa_addr.h b/include/rdma/opa_addr.h
index 46d0567fffea..9b5e642cf550 100644
--- a/include/rdma/opa_addr.h
+++ b/include/rdma/opa_addr.h
@@ -77,4 +77,22 @@ static inline u32 opa_get_lid_from_gid(union ib_gid *gid)
{
return be64_to_cpu(gid->global.interface_id) & 0xFFFFFFFF;
}
+
+/**
+ * opa_is_extended_lid: Returns true if dlid or slid are
+ * extended.
+ *
+ * @dlid: The DLID
+ * @slid: The SLID
+ */
+static inline bool opa_is_extended_lid(u32 dlid, u32 slid)
+{
+ if ((be32_to_cpu(dlid) >=
+ be16_to_cpu(IB_MULTICAST_LID_BASE)) ||
+ (be32_to_cpu(slid) >=
+ be16_to_cpu(IB_MULTICAST_LID_BASE)))
+ return true;
+ else
+ return false;
+}
#endif /* OPA_ADDR_H */