Commit 63b85f49 authored by Yevgeny Kliteynik's avatar Yevgeny Kliteynik Committed by Saeed Mahameed
Browse files

net/mlx5: DR, Add ignore_flow_level support for multi-dest flow tables



When creating an FTE, we might need to create multi-destination flow table,
which is eventually created by FW. In such case, this FW table should
include all the FTE properties as requested by the upper layer, including
the ability to point to another flow table with level lower or equal to
the current table - indicated by the "ignore_flow_level" property.

Signed-off-by: default avatarChris Mi <cmi@nvidia.com>
Signed-off-by: default avatarYevgeny Kliteynik <kliteyn@nvidia.com>
Reviewed-by: default avatarAlex Vesker <valex@nvidia.com>
Signed-off-by: default avatarSaeed Mahameed <saeedm@nvidia.com>
parent a01a43fa
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -845,7 +845,8 @@ mlx5dr_action_create_dest_table(struct mlx5dr_table *tbl)
struct mlx5dr_action *
mlx5dr_action_create_mult_dest_tbl(struct mlx5dr_domain *dmn,
				   struct mlx5dr_action_dest *dests,
				   u32 num_of_dests)
				   u32 num_of_dests,
				   bool ignore_flow_level)
{
	struct mlx5dr_cmd_flow_destination_hw_info *hw_dests;
	struct mlx5dr_action **ref_actions;
@@ -912,7 +913,8 @@ mlx5dr_action_create_mult_dest_tbl(struct mlx5dr_domain *dmn,
				      num_of_dests,
				      reformat_req,
				      &action->dest_tbl->fw_tbl.id,
				      &action->dest_tbl->fw_tbl.group_id);
				      &action->dest_tbl->fw_tbl.group_id,
				      ignore_flow_level);
	if (ret)
		goto free_action;

+1 −0
Original line number Diff line number Diff line
@@ -655,6 +655,7 @@ int mlx5dr_cmd_set_fte(struct mlx5_core_dev *dev,
	MLX5_SET(set_fte_in, in, table_type, ft->type);
	MLX5_SET(set_fte_in, in, table_id, ft->id);
	MLX5_SET(set_fte_in, in, flow_index, fte->index);
	MLX5_SET(set_fte_in, in, ignore_flow_level, fte->ignore_flow_level);
	if (ft->vport) {
		MLX5_SET(set_fte_in, in, vport_number, ft->vport);
		MLX5_SET(set_fte_in, in, other_vport, 1);
+3 −1
Original line number Diff line number Diff line
@@ -103,7 +103,8 @@ int mlx5dr_fw_create_md_tbl(struct mlx5dr_domain *dmn,
			    int num_dest,
			    bool reformat_req,
			    u32 *tbl_id,
			    u32 *group_id)
			    u32 *group_id,
			    bool ignore_flow_level)
{
	struct mlx5dr_cmd_create_flow_table_attr ft_attr = {};
	struct mlx5dr_cmd_fte_info fte_info = {};
@@ -137,6 +138,7 @@ int mlx5dr_fw_create_md_tbl(struct mlx5dr_domain *dmn,
	fte_info.dests_size = num_dest;
	fte_info.val = val;
	fte_info.dest_arr = dest;
	fte_info.ignore_flow_level = ignore_flow_level;

	ret = mlx5dr_cmd_set_fte(dmn->mdev, 0, 0, &ft_info, *group_id, &fte_info);
	if (ret) {
+3 −1
Original line number Diff line number Diff line
@@ -1337,6 +1337,7 @@ struct mlx5dr_cmd_fte_info {
	u32 *val;
	struct mlx5_flow_act action;
	struct mlx5dr_cmd_flow_destination_hw_info *dest_arr;
	bool ignore_flow_level;
};

int mlx5dr_cmd_set_fte(struct mlx5_core_dev *dev,
@@ -1366,7 +1367,8 @@ int mlx5dr_fw_create_md_tbl(struct mlx5dr_domain *dmn,
			    int num_dest,
			    bool reformat_req,
			    u32 *tbl_id,
			    u32 *group_id);
			    u32 *group_id,
			    bool ignore_flow_level);
void mlx5dr_fw_destroy_md_tbl(struct mlx5dr_domain *dmn, u32 tbl_id,
			      u32 group_id);
#endif  /* _DR_TYPES_H_ */
+5 −1
Original line number Diff line number Diff line
@@ -490,9 +490,13 @@ static int mlx5_cmd_dr_create_fte(struct mlx5_flow_root_namespace *ns,

		actions[num_actions++] = term_actions->dest;
	} else if (num_term_actions > 1) {
		bool ignore_flow_level =
			!!(fte->action.flags & FLOW_ACT_IGNORE_FLOW_LEVEL);

		tmp_action = mlx5dr_action_create_mult_dest_tbl(domain,
								term_actions,
								num_term_actions);
								num_term_actions,
								ignore_flow_level);
		if (!tmp_action) {
			err = -EOPNOTSUPP;
			goto free_actions;
Loading