mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-05 02:21:52 +09:00
IB/mlx: Set slid to zero in Ethernet completion struct
[ Upstream commit65389322b2] IB spec says that a lid should be ignored when link layer is Ethernet, for example when building or parsing a CM request message (CA17-34). However, since ib_lid_be16() and ib_lid_cpu16() validates the slid, not only when link layer is IB, we set the slid to zero to prevent false warnings in the kernel log. Fixes:62ede77799("Add OPA extended LID support") Reviewed-by: Majd Dibbiny <majd@mellanox.com> Signed-off-by: Moni Shoua <monis@mellanox.com> Signed-off-by: Leon Romanovsky <leon@kernel.org> Signed-off-by: Jason Gunthorpe <jgg@mellanox.com> Signed-off-by: Sasha Levin <alexander.levin@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
2a71d94e4f
commit
b73bc820c4
@@ -597,6 +597,7 @@ static void use_tunnel_data(struct mlx4_ib_qp *qp, struct mlx4_ib_cq *cq, struct
|
||||
wc->dlid_path_bits = 0;
|
||||
|
||||
if (is_eth) {
|
||||
wc->slid = 0;
|
||||
wc->vlan_id = be16_to_cpu(hdr->tun.sl_vid);
|
||||
memcpy(&(wc->smac[0]), (char *)&hdr->tun.mac_31_0, 4);
|
||||
memcpy(&(wc->smac[4]), (char *)&hdr->tun.slid_mac_47_32, 2);
|
||||
@@ -845,7 +846,6 @@ repoll:
|
||||
}
|
||||
}
|
||||
|
||||
wc->slid = be16_to_cpu(cqe->rlid);
|
||||
g_mlpath_rqpn = be32_to_cpu(cqe->g_mlpath_rqpn);
|
||||
wc->src_qp = g_mlpath_rqpn & 0xffffff;
|
||||
wc->dlid_path_bits = (g_mlpath_rqpn >> 24) & 0x7f;
|
||||
@@ -854,6 +854,7 @@ repoll:
|
||||
wc->wc_flags |= mlx4_ib_ipoib_csum_ok(cqe->status,
|
||||
cqe->checksum) ? IB_WC_IP_CSUM_OK : 0;
|
||||
if (is_eth) {
|
||||
wc->slid = 0;
|
||||
wc->sl = be16_to_cpu(cqe->sl_vid) >> 13;
|
||||
if (be32_to_cpu(cqe->vlan_my_qpn) &
|
||||
MLX4_CQE_CVLAN_PRESENT_MASK) {
|
||||
@@ -865,6 +866,7 @@ repoll:
|
||||
memcpy(wc->smac, cqe->smac, ETH_ALEN);
|
||||
wc->wc_flags |= (IB_WC_WITH_VLAN | IB_WC_WITH_SMAC);
|
||||
} else {
|
||||
wc->slid = be16_to_cpu(cqe->rlid);
|
||||
wc->sl = be16_to_cpu(cqe->sl_vid) >> 12;
|
||||
wc->vlan_id = 0xffff;
|
||||
}
|
||||
|
||||
@@ -224,7 +224,6 @@ static void handle_responder(struct ib_wc *wc, struct mlx5_cqe64 *cqe,
|
||||
wc->ex.invalidate_rkey = be32_to_cpu(cqe->imm_inval_pkey);
|
||||
break;
|
||||
}
|
||||
wc->slid = be16_to_cpu(cqe->slid);
|
||||
wc->src_qp = be32_to_cpu(cqe->flags_rqpn) & 0xffffff;
|
||||
wc->dlid_path_bits = cqe->ml_path;
|
||||
g = (be32_to_cpu(cqe->flags_rqpn) >> 28) & 3;
|
||||
@@ -239,10 +238,12 @@ static void handle_responder(struct ib_wc *wc, struct mlx5_cqe64 *cqe,
|
||||
}
|
||||
|
||||
if (ll != IB_LINK_LAYER_ETHERNET) {
|
||||
wc->slid = be16_to_cpu(cqe->slid);
|
||||
wc->sl = (be32_to_cpu(cqe->flags_rqpn) >> 24) & 0xf;
|
||||
return;
|
||||
}
|
||||
|
||||
wc->slid = 0;
|
||||
vlan_present = cqe->l4_l3_hdr_type & 0x1;
|
||||
roce_packet_type = (be32_to_cpu(cqe->flags_rqpn) >> 24) & 0x3;
|
||||
if (vlan_present) {
|
||||
|
||||
Reference in New Issue
Block a user