Skip to content

Commit

Permalink
net/mlx5: DR, Fix missing flow_source when creating multi-destination…
Browse files Browse the repository at this point in the history
… FW table

In order to support multiple destination FTEs with SW steering
FW table is created with single FTE with multiple actions and
SW steering rule forward to it. When creating this table, flow
source isn't set according to the original FTE.

Fix this by passing the original FTE flow source to the created
FW table.

Fixes: 34583be ("net/mlx5: DR, Create multi-destination table for SW-steering use")
Signed-off-by: Maor Dickman <[email protected]>
Reviewed-by: Yevgeny Kliteynik <[email protected]>
Signed-off-by: Saeed Mahameed <[email protected]>
  • Loading branch information
dickmanmaor authored and Saeed Mahameed committed May 18, 2022
1 parent 23dd458 commit 2c5fc6c
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 6 deletions.
6 changes: 4 additions & 2 deletions drivers/net/ethernet/mellanox/mlx5/core/steering/dr_action.c
Original file line number Diff line number Diff line change
Expand Up @@ -842,7 +842,8 @@ struct mlx5dr_action *
mlx5dr_action_create_mult_dest_tbl(struct mlx5dr_domain *dmn,
struct mlx5dr_action_dest *dests,
u32 num_of_dests,
bool ignore_flow_level)
bool ignore_flow_level,
u32 flow_source)
{
struct mlx5dr_cmd_flow_destination_hw_info *hw_dests;
struct mlx5dr_action **ref_actions;
Expand Down Expand Up @@ -914,7 +915,8 @@ mlx5dr_action_create_mult_dest_tbl(struct mlx5dr_domain *dmn,
reformat_req,
&action->dest_tbl->fw_tbl.id,
&action->dest_tbl->fw_tbl.group_id,
ignore_flow_level);
ignore_flow_level,
flow_source);
if (ret)
goto free_action;

Expand Down
4 changes: 3 additions & 1 deletion drivers/net/ethernet/mellanox/mlx5/core/steering/dr_fw.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,8 @@ int mlx5dr_fw_create_md_tbl(struct mlx5dr_domain *dmn,
bool reformat_req,
u32 *tbl_id,
u32 *group_id,
bool ignore_flow_level)
bool ignore_flow_level,
u32 flow_source)
{
struct mlx5dr_cmd_create_flow_table_attr ft_attr = {};
struct mlx5dr_cmd_fte_info fte_info = {};
Expand Down Expand Up @@ -139,6 +140,7 @@ int mlx5dr_fw_create_md_tbl(struct mlx5dr_domain *dmn,
fte_info.val = val;
fte_info.dest_arr = dest;
fte_info.ignore_flow_level = ignore_flow_level;
fte_info.flow_context.flow_source = flow_source;

ret = mlx5dr_cmd_set_fte(dmn->mdev, 0, 0, &ft_info, *group_id, &fte_info);
if (ret) {
Expand Down
3 changes: 2 additions & 1 deletion drivers/net/ethernet/mellanox/mlx5/core/steering/dr_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -1461,7 +1461,8 @@ int mlx5dr_fw_create_md_tbl(struct mlx5dr_domain *dmn,
bool reformat_req,
u32 *tbl_id,
u32 *group_id,
bool ignore_flow_level);
bool ignore_flow_level,
u32 flow_source);
void mlx5dr_fw_destroy_md_tbl(struct mlx5dr_domain *dmn, u32 tbl_id,
u32 group_id);
#endif /* _DR_TYPES_H_ */
4 changes: 3 additions & 1 deletion drivers/net/ethernet/mellanox/mlx5/core/steering/fs_dr.c
Original file line number Diff line number Diff line change
Expand Up @@ -520,6 +520,7 @@ static int mlx5_cmd_dr_create_fte(struct mlx5_flow_root_namespace *ns,
} else if (num_term_actions > 1) {
bool ignore_flow_level =
!!(fte->action.flags & FLOW_ACT_IGNORE_FLOW_LEVEL);
u32 flow_source = fte->flow_context.flow_source;

if (num_actions == MLX5_FLOW_CONTEXT_ACTION_MAX ||
fs_dr_num_actions == MLX5_FLOW_CONTEXT_ACTION_MAX) {
Expand All @@ -529,7 +530,8 @@ static int mlx5_cmd_dr_create_fte(struct mlx5_flow_root_namespace *ns,
tmp_action = mlx5dr_action_create_mult_dest_tbl(domain,
term_actions,
num_term_actions,
ignore_flow_level);
ignore_flow_level,
flow_source);
if (!tmp_action) {
err = -EOPNOTSUPP;
goto free_actions;
Expand Down
3 changes: 2 additions & 1 deletion drivers/net/ethernet/mellanox/mlx5/core/steering/mlx5dr.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,8 @@ struct mlx5dr_action *
mlx5dr_action_create_mult_dest_tbl(struct mlx5dr_domain *dmn,
struct mlx5dr_action_dest *dests,
u32 num_of_dests,
bool ignore_flow_level);
bool ignore_flow_level,
u32 flow_source);

struct mlx5dr_action *mlx5dr_action_create_drop(void);

Expand Down

0 comments on commit 2c5fc6c

Please sign in to comment.