net/mlx5: DR, Fix STEv0 source_eswitch_owner_vhca_id support

Check vport_cap only if match on source gvmi is required.

Signed-off-by: Yevgeny Kliteynik <kliteyn@nvidia.com>
Reviewed-by: Alex Vesker <valex@nvidia.com>
Reviewed-by: Saeed Mahameed <saeedm@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
This commit is contained in:
Yevgeny Kliteynik 2020-10-29 01:33:00 +02:00 committed by Saeed Mahameed
parent b7f7ad1846
commit 7863c912e8

View file

@ -1227,10 +1227,14 @@ dr_ste_v0_build_src_gvmi_qpn_tag(struct mlx5dr_match_param *value,
caps = &dmn->peer_dmn->info.caps;
else
return -EINVAL;
misc->source_eswitch_owner_vhca_id = 0;
} else {
caps = &dmn->info.caps;
}
source_gvmi_set = MLX5_GET(ste_src_gvmi_qp, bit_mask, source_gvmi);
if (source_gvmi_set) {
vport_cap = mlx5dr_get_vport_cap(caps, misc->source_port);
if (!vport_cap) {
mlx5dr_err(dmn, "Vport 0x%x is invalid\n",
@ -1238,12 +1242,11 @@ dr_ste_v0_build_src_gvmi_qpn_tag(struct mlx5dr_match_param *value,
return -EINVAL;
}
source_gvmi_set = MLX5_GET(ste_src_gvmi_qp, bit_mask, source_gvmi);
if (vport_cap->vport_gvmi && source_gvmi_set)
if (vport_cap->vport_gvmi)
MLX5_SET(ste_src_gvmi_qp, tag, source_gvmi, vport_cap->vport_gvmi);
misc->source_eswitch_owner_vhca_id = 0;
misc->source_port = 0;
}
return 0;
}