Skip to content

Commit

Permalink
include/rdma/opa_addr.h: Fix an endianness issue
Browse files Browse the repository at this point in the history
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: af808ec ("IB/SA: Check dlid before SA agent queries for ClassPortInfo")
Signed-off-by: Bart Van Assche <[email protected]>
Cc: Venkata Sandeep Dhanalakota <[email protected]>
Cc: Mike Marciniszyn <[email protected]>
Cc: Dennis Dalessandro <[email protected]>
Signed-off-by: Jason Gunthorpe <[email protected]>
  • Loading branch information
KAGA-KOKO authored and jgunthorpe committed Jul 3, 2018
1 parent 1c77483 commit 4eefd62
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/rdma/opa_addr.h
Original file line number Diff line number Diff line change
Expand Up @@ -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) ||
Expand Down

0 comments on commit 4eefd62

Please sign in to comment.