summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorBart Van Assche <bart.vanassche@wdc.com>2018-07-02 10:06:51 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-10-03 16:59:07 -0700
commit2bffdc28ee6029df705996f6b5566ccd049673c6 (patch)
tree4c6b806c2592610cc58435d2ce0e57493742c177 /include
parentb40f2ec52bf5647c4a1e71d73cd5a37a650f2944 (diff)
downloadlinux-stable-2bffdc28ee6029df705996f6b5566ccd049673c6.tar.gz
linux-stable-2bffdc28ee6029df705996f6b5566ccd049673c6.tar.bz2
linux-stable-2bffdc28ee6029df705996f6b5566ccd049673c6.zip
include/rdma/opa_addr.h: Fix an endianness issue
[ Upstream commit 4eefd62c17a9a5e7576207e84f3d2b4f73aba750 ] IB_MULTICAST_LID_BASE is defined as follows: #define IB_MULTICAST_LID_BASE cpu_to_be16(0xC000) Hence use be16_to_cpu() to convert it to CPU endianness. Compile-tested only. Fixes: af808ece5ce9 ("IB/SA: Check dlid before SA agent queries for ClassPortInfo") Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com> Cc: Venkata Sandeep Dhanalakota <venkata.s.dhanalakota@intel.com> Cc: Mike Marciniszyn <mike.marciniszyn@intel.com> Cc: Dennis Dalessandro <dennis.dalessandro@intel.com> Signed-off-by: Jason Gunthorpe <jgg@mellanox.com> Signed-off-by: Sasha Levin <alexander.levin@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include')
-rw-r--r--include/rdma/opa_addr.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/rdma/opa_addr.h b/include/rdma/opa_addr.h
index 2bbb7a67e643..66d4393d339c 100644
--- a/include/rdma/opa_addr.h
+++ b/include/rdma/opa_addr.h
@@ -120,7 +120,7 @@ static inline bool rdma_is_valid_unicast_lid(struct rdma_ah_attr *attr)
if (attr->type == RDMA_AH_ATTR_TYPE_IB) {
if (!rdma_ah_get_dlid(attr) ||
rdma_ah_get_dlid(attr) >=
- be32_to_cpu(IB_MULTICAST_LID_BASE))
+ be16_to_cpu(IB_MULTICAST_LID_BASE))
return false;
} else if (attr->type == RDMA_AH_ATTR_TYPE_OPA) {
if (!rdma_ah_get_dlid(attr) ||