aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorParav Pandit <parav@mellanox.com>2018-01-09 15:24:53 +0200
committerJason Gunthorpe <jgg@mellanox.com>2018-01-15 15:33:21 -0700
commita6753c4d6257feef2a82522d0d222166d4be4aa8 (patch)
treee85871bb14d4d0f7d567a6ce5e75fb4f70a1df65 /drivers
parentIB/core: Attempt DMAC resolution for only RoCE (diff)
downloadlinux-dev-a6753c4d6257feef2a82522d0d222166d4be4aa8.tar.xz
linux-dev-a6753c4d6257feef2a82522d0d222166d4be4aa8.zip
IB/core: Limit DMAC resolution to RoCE Connected QPs
Resolving DMAC for RoCE is applicable to only Connected mode QPs. So resolve DMAC for only for Connected mode QPs. Signed-off-by: Parav Pandit <parav@mellanox.com> Reviewed-by: Daniel Jurgens <danielj@mellanox.com> Signed-off-by: Leon Romanovsky <leon@kernel.org> Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/infiniband/core/verbs.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/drivers/infiniband/core/verbs.c b/drivers/infiniband/core/verbs.c
index b110db6dbef0..49a2a764c0bf 100644
--- a/drivers/infiniband/core/verbs.c
+++ b/drivers/infiniband/core/verbs.c
@@ -1349,6 +1349,14 @@ static int _ib_modify_qp(struct ib_qp *qp, struct ib_qp_attr *attr,
return ret;
}
+static bool is_qp_type_connected(const struct ib_qp *qp)
+{
+ return (qp->qp_type == IB_QPT_UC ||
+ qp->qp_type == IB_QPT_RC ||
+ qp->qp_type == IB_QPT_XRC_INI ||
+ qp->qp_type == IB_QPT_XRC_TGT);
+}
+
/**
* ib_modify_qp_with_udata - Modifies the attributes for the specified QP.
* @ib_qp: The QP to modify.
@@ -1367,7 +1375,8 @@ int ib_modify_qp_with_udata(struct ib_qp *ib_qp, struct ib_qp_attr *attr,
int ret;
if (attr_mask & IB_QP_AV &&
- attr->ah_attr.type == RDMA_AH_ATTR_TYPE_ROCE) {
+ attr->ah_attr.type == RDMA_AH_ATTR_TYPE_ROCE &&
+ is_qp_type_connected(qp)) {
ret = ib_resolve_eth_dmac(qp->device, &attr->ah_attr);
if (ret)
return ret;