Commit 80596c67 authored by Lijun Ou's avatar Lijun Ou Committed by Doug Ledford

IB/hns: Modify the condition of notifying hardware loopback

This patch modified the condition of notifying hardware loopback.

In hip06, RoCE Engine has several ports, one QP is related
to one port. hardware only support loopback in the same port,
not in the different ports.

So, If QP related to port N, the dmac in the QP context equals
the smac of the local port N or the loop_idc is 1, we should
set loopback bit in QP context to notify hardware.
Signed-off-by: default avatarWei Hu (Xavier) <xavier.huwei@huawei.com>
Signed-off-by: default avatarLijun Ou <oulijun@huawei.com>
Signed-off-by: default avatarSalil Mehta  <salil.mehta@huawei.com>
Signed-off-by: default avatarDoug Ledford <dledford@redhat.com>
parent 543bfe6c
...@@ -2244,24 +2244,14 @@ static int hns_roce_v1_m_qp(struct ib_qp *ibqp, const struct ib_qp_attr *attr, ...@@ -2244,24 +2244,14 @@ static int hns_roce_v1_m_qp(struct ib_qp *ibqp, const struct ib_qp_attr *attr,
QP_CONTEXT_QPC_BYTE_32_SIGNALING_TYPE_S, QP_CONTEXT_QPC_BYTE_32_SIGNALING_TYPE_S,
hr_qp->sq_signal_bits); hr_qp->sq_signal_bits);
for (port = 0; port < hr_dev->caps.num_ports; port++) { port = (attr_mask & IB_QP_PORT) ? (attr->port_num - 1) :
smac = (u8 *)hr_dev->dev_addr[port]; hr_qp->port;
dev_dbg(dev, "smac: %2x: %2x: %2x: %2x: %2x: %2x\n", smac = (u8 *)hr_dev->dev_addr[port];
smac[0], smac[1], smac[2], smac[3], smac[4], /* when dmac equals smac or loop_idc is 1, it should loopback */
smac[5]); if (ether_addr_equal_unaligned(dmac, smac) ||
if ((dmac[0] == smac[0]) && (dmac[1] == smac[1]) && hr_dev->loop_idc == 0x1)
(dmac[2] == smac[2]) && (dmac[3] == smac[3]) &&
(dmac[4] == smac[4]) && (dmac[5] == smac[5])) {
roce_set_bit(context->qpc_bytes_32,
QP_CONTEXT_QPC_BYTE_32_LOOPBACK_INDICATOR_S,
1);
break;
}
}
if (hr_dev->loop_idc == 0x1)
roce_set_bit(context->qpc_bytes_32, roce_set_bit(context->qpc_bytes_32,
QP_CONTEXT_QPC_BYTE_32_LOOPBACK_INDICATOR_S, 1); QP_CONTEXT_QPC_BYTE_32_LOOPBACK_INDICATOR_S, 1);
roce_set_bit(context->qpc_bytes_32, roce_set_bit(context->qpc_bytes_32,
QP_CONTEXT_QPC_BYTE_32_GLOBAL_HEADER_S, QP_CONTEXT_QPC_BYTE_32_GLOBAL_HEADER_S,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment