aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/core
diff options
context:
space:
mode:
authorDon Hiatt <don.hiatt@intel.com>2017-12-22 08:45:52 -0800
committerJason Gunthorpe <jgg@mellanox.com>2017-12-22 13:46:11 -0700
commit2ef7f2e2706cee6ad7b5eb6ef8d85824008f0425 (patch)
tree27fb5c74a7668a4fb25132e3601b07040eb0f165 /drivers/infiniband/core
parenti40iw: Fix the connection ORD value for loopback (diff)
downloadlinux-dev-2ef7f2e2706cee6ad7b5eb6ef8d85824008f0425.tar.xz
linux-dev-2ef7f2e2706cee6ad7b5eb6ef8d85824008f0425.zip
IB/core: Use rdma_cap_opa_mad to check for OPA
Use rdma_cap_opa_mad() to check for OPA to promote code reuse. Signed-off-by: Don Hiatt <don.hiatt@intel.com> Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com> Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Diffstat (limited to 'drivers/infiniband/core')
-rw-r--r--drivers/infiniband/core/user_mad.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/infiniband/core/user_mad.c b/drivers/infiniband/core/user_mad.c
index 3ef8ee5d4aa2..d4de187b1064 100644
--- a/drivers/infiniband/core/user_mad.c
+++ b/drivers/infiniband/core/user_mad.c
@@ -233,8 +233,7 @@ static void recv_handler(struct ib_mad_agent *agent,
* On OPA devices it is okay to lose the upper 16 bits of LID as this
* information is obtained elsewhere. Mask off the upper 16 bits.
*/
- if (agent->device->port_immutable[agent->port_num].core_cap_flags &
- RDMA_CORE_PORT_INTEL_OPA)
+ if (rdma_cap_opa_mad(agent->device, agent->port_num))
packet->mad.hdr.lid = ib_lid_be16(0xFFFF &
mad_recv_wc->wc->slid);
else