Skip to content

Commit c671972

Browse files
dickmanmaorSaeed Mahameed
authored andcommitted
net/mlx5: E-Switch, Set destination vport vhca id only when merged eswitch is supported
Destination vport vhca id is valid flag is set only merged eswitch isn't supported. Change destination vport vhca id value to be set also only when merged eswitch is supported. Fixes: e4ad91f ("net/mlx5e: Split offloaded eswitch TC rules for port mirroring") Signed-off-by: Maor Dickman <[email protected]> Reviewed-by: Roi Dayan <[email protected]> Signed-off-by: Saeed Mahameed <[email protected]>
1 parent 90b22b9 commit c671972

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -382,10 +382,11 @@ esw_setup_vport_dest(struct mlx5_flow_destination *dest, struct mlx5_flow_act *f
382382
{
383383
dest[dest_idx].type = MLX5_FLOW_DESTINATION_TYPE_VPORT;
384384
dest[dest_idx].vport.num = esw_attr->dests[attr_idx].rep->vport;
385-
dest[dest_idx].vport.vhca_id =
386-
MLX5_CAP_GEN(esw_attr->dests[attr_idx].mdev, vhca_id);
387-
if (MLX5_CAP_ESW(esw->dev, merged_eswitch))
385+
if (MLX5_CAP_ESW(esw->dev, merged_eswitch)) {
386+
dest[dest_idx].vport.vhca_id =
387+
MLX5_CAP_GEN(esw_attr->dests[attr_idx].mdev, vhca_id);
388388
dest[dest_idx].vport.flags |= MLX5_FLOW_DEST_VPORT_VHCA_ID;
389+
}
389390
if (esw_attr->dests[attr_idx].flags & MLX5_ESW_DEST_ENCAP) {
390391
if (pkt_reformat) {
391392
flow_act->action |= MLX5_FLOW_CONTEXT_ACTION_PACKET_REFORMAT;

0 commit comments

Comments
 (0)