summaryrefslogtreecommitdiff
path: root/include/rdma/opa_addr.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/rdma/opa_addr.h')
-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 */