net/mlx5: fix unsupported port ID action
PATCH 1/1 net/mlx5: fix unsupported port ID action
When dv_flow_en=2, the port ID action is not supported. Although a rule can be created successfully in non-template mode, the specified action will be silently ignored and not applied.
To prevent this ambiguous behavior, explicitly return an error when a port ID action is used with dv_flow_en=2,
and recommend using a represented port action instead.
--- drivers/net/mlx5/mlx5_flow_hw.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-)
drivers/net/mlx5/mlx5_flow_hw.c +9 -1
@@ -2913,6 +2913,10 @@ __flow_hw_translate_actions_template(struct rte_eth_dev *dev,case RTE_FLOW_ACTION_TYPE_END : actions_end = true;break ; +case RTE_FLOW_ACTION_TYPE_PORT_ID : +DRV_LOG (ERR ,"RTE_FLOW_ACTION_TYPE_PORT_ID action is not supported. " +"Use RTE_FLOW_ACTION_TYPE_REPRESENTED_PORT instead." ); + goto err;default :break ; }
@@ -7644,7 +7648,11 @@ flow_hw_parse_flow_actions_to_dr_actions(struct rte_eth_dev *dev,case MLX5_RTE_FLOW_ACTION_TYPE_MIRROR : at->dr_off[i] = curr_off; action_types[curr_off++] =MLX5DR_ACTION_TYP_DEST_ARRAY ; -break ; +break ; +case RTE_FLOW_ACTION_TYPE_PORT_ID : +DRV_LOG (ERR ,"RTE_FLOW_ACTION_TYPE_PORT_ID action is not supported. " +"Use RTE_FLOW_ACTION_TYPE_REPRESENTED_PORT instead." ); +return -EINVAL ;default : type = mlx5_hw_dr_action_types[at->actions[i].type]; at->dr_off[i] = curr_off;
Signature · 1 line
2.21.0
Quoted 8 lines · Maayan Kashani
When dv_flow_en=2, the port ID action is not supported. Although a rule can be created successfully in non-template mode, the specified action will be silently ignored and not applied.
To prevent this ambiguous behavior, explicitly return an error when a port ID action is used with dv_flow_en=2,
and recommend using a represented port action instead.
Quoted 5 lines
Fixes f1fecffa88df ("net/mlx5: support Direct Rules action template API")Signed-off-by Maayan Kashani <[email protected]>
Quoted 36 lines
---
drivers/net/mlx5/mlx5_flow_hw.c| 10 +++++++++-1 file changed, 9 insertions(+), 1 deletion(-)drivers/net/mlx5/mlx5_flow_hw.c +9
-1@@ -2913,6 +2913,10 @@ __flow_hw_translate_actions_template(struct rte_eth_dev *dev,case RTE_FLOW_ACTION_TYPE_END : actions_end = true;break ; +case RTE_FLOW_ACTION_TYPE_PORT_ID : +DRV_LOG (ERR ,"RTE_FLOW_ACTION_TYPE_PORT_ID action is not supported. " +"Use RTE_FLOW_ACTION_TYPE_REPRESENTED_PORT instead." ); + goto err;default :break ; }@@ -7644,7 +7648,11 @@ flow_hw_parse_flow_actions_to_dr_actions(struct rte_eth_dev *dev,case MLX5_RTE_FLOW_ACTION_TYPE_MIRROR : at->dr_off[i] = curr_off; action_types[curr_off++] =MLX5DR_ACTION_TYP_DEST_ARRAY ; -break ; +break ; +case RTE_FLOW_ACTION_TYPE_PORT_ID : +DRV_LOG (ERR ,"RTE_FLOW_ACTION_TYPE_PORT_ID action is not supported. " +"Use RTE_FLOW_ACTION_TYPE_REPRESENTED_PORT instead." ); +return -EINVAL ;default : type = mlx5_hw_dr_action_types[at->actions[i].type]; at->dr_off[i] = curr_off;Signature · 1 line
2.21.0
Hi,
Quoted 8 lines · Maayan Kashani
When dv_flow_en=2, the port ID action is not supported. Although a rule can be created successfully in non-template mode, the specified action will be silently ignored and not applied.
To prevent this ambiguous behavior, explicitly return an error when a port ID action is used with dv_flow_en=2,
and recommend using a represented port action instead.
Quoted 5 lines
Fixes f1fecffa88df ("net/mlx5: support Direct Rules action template API")Signed-off-by Maayan Kashani <[email protected]>
Patch applied to next-net-mlx,
Kindest regards
Raslan Darawsheh