Add OPA extended LID support

This patch series primarily increases sizes of variables that hold
lid values from 16 to 32 bits. Additionally, it adds a check in
the IB mad stack to verify a properly formatted MAD when OPA
extended LIDs are used.

Signed-off-by: Don Hiatt <[email protected]>
Reviewed-by: Dennis Dalessandro <[email protected]>
Signed-off-by: Doug Ledford <[email protected]>
This commit is contained in:
Hiatt, Don 2017-08-14 14:17:43 -04:00 • committed by Doug Ledford
commit 62ede77799
11 changed files with 41 additions and 26 deletions

View file

@ -3724,16 +3724,30 @@ static inline enum rdma_ah_attr_type rdma_ah_find_type(struct ib_device *dev,
return RDMA_AH_ATTR_TYPE_IB;
}
/* Return slid in 16bit CPU encoding */
static inline u16 ib_slid_cpu16(u32 slid)
/**
* ib_lid_cpu16 - Return lid in 16bit CPU encoding.
* In the current implementation the only way to get
* get the 32bit lid is from other sources for OPA.
* For IB, lids will always be 16bits so cast the
* value accordingly.
*
* @lid: A 32bit LID
*/
static inline u16 ib_lid_cpu16(u32 lid)
{
return (u16)slid;
WARN_ON_ONCE(lid & 0xFFFF0000);
return (u16)lid;
}
/* Return slid in 16bit BE encoding */
static inline u16 ib_slid_be16(u32 slid)
/**
* ib_lid_be16 - Return lid in 16bit BE encoding.
*
* @lid: A 32bit LID
*/
static inline __be16 ib_lid_be16(u32 lid)
{
return cpu_to_be16((u16)slid);
WARN_ON_ONCE(lid & 0xFFFF0000);
return cpu_to_be16((u16)lid);
}
/**