diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
index 0387b5068be6f5d86ccff3d2a40449f8dec18d86..bb96c4661e261fb0b26fa37f0389b93af96ebd7e 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
@@ -131,6 +131,8 @@ mlx5_eswitch_add_offloaded_rule(struct mlx5_eswitch *esw,
 				if (attr->dests[j].flags & MLX5_ESW_DEST_ENCAP) {
 					flow_act.action |= MLX5_FLOW_CONTEXT_ACTION_PACKET_REFORMAT;
 					flow_act.reformat_id = attr->encap_id;
+					dest[i].vport.flags |= MLX5_FLOW_DEST_VPORT_REFORMAT_ID;
+					dest[i].vport.reformat_id = attr->encap_id;
 				}
 				i++;
 			}