提交 f2290d6d 编写于 作者: P Parav Pandit 提交者: Jason Gunthorpe

IB/core: Attempt DMAC resolution for only RoCE

Instead of returning 0 (success) for RoCE scenarios where DMAC should
not be resolved, avoid such attempt and make code consistent with
ib_create_user_ah().
Signed-off-by: NParav Pandit <parav@mellanox.com>
Reviewed-by: NDaniel Jurgens <danielj@mellanox.com>
Signed-off-by: NLeon Romanovsky <leon@kernel.org>
Signed-off-by: NJason Gunthorpe <jgg@mellanox.com>
上级 b96ac05a
...@@ -1301,9 +1301,6 @@ static int ib_resolve_eth_dmac(struct ib_device *device, ...@@ -1301,9 +1301,6 @@ static int ib_resolve_eth_dmac(struct ib_device *device,
if (!rdma_is_port_valid(device, rdma_ah_get_port_num(ah_attr))) if (!rdma_is_port_valid(device, rdma_ah_get_port_num(ah_attr)))
return -EINVAL; return -EINVAL;
if (ah_attr->type != RDMA_AH_ATTR_TYPE_ROCE)
return 0;
grh = rdma_ah_retrieve_grh(ah_attr); grh = rdma_ah_retrieve_grh(ah_attr);
if (rdma_is_multicast_addr((struct in6_addr *)ah_attr->grh.dgid.raw)) { if (rdma_is_multicast_addr((struct in6_addr *)ah_attr->grh.dgid.raw)) {
...@@ -1369,7 +1366,8 @@ int ib_modify_qp_with_udata(struct ib_qp *ib_qp, struct ib_qp_attr *attr, ...@@ -1369,7 +1366,8 @@ int ib_modify_qp_with_udata(struct ib_qp *ib_qp, struct ib_qp_attr *attr,
struct ib_qp *qp = ib_qp->real_qp; struct ib_qp *qp = ib_qp->real_qp;
int ret; int ret;
if (attr_mask & IB_QP_AV) { if (attr_mask & IB_QP_AV &&
attr->ah_attr.type == RDMA_AH_ATTR_TYPE_ROCE) {
ret = ib_resolve_eth_dmac(qp->device, &attr->ah_attr); ret = ib_resolve_eth_dmac(qp->device, &attr->ah_attr);
if (ret) if (ret)
return ret; return ret;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册