[v3,6/8] net/mlx5: store modify field action
Checks
Commit Message
When template table is created, list of unmasked actions is recorded for
future flow rule insertions.
This patch expands entries for RTE_FLOW_ACTION_TYPE_MODIFY_FIELD actions
in this list with a copy of the action from the template.
This will be used in follow up commits which add flow rule operation
validation. Specifically, to validate that
RTE_FLOW_ACTION_TYPE_MODIFY_FIELD action passed by the user is correctly
configured.
Signed-off-by: Dariusz Sosnowski <dsosnowski@nvidia.com>
Acked-by: Ori Kam <orika@nvidia.com>
---
drivers/net/mlx5/mlx5_flow.h | 2 ++
drivers/net/mlx5/mlx5_flow_hw.c | 4 +++-
2 files changed, 5 insertions(+), 1 deletion(-)
@@ -1472,6 +1472,8 @@ struct mlx5_action_construct_data {
* PRM actions.
*/
uint32_t mask[MLX5_ACT_MAX_MOD_FIELDS];
+ /* Copy of action passed to the action template. */
+ struct rte_flow_action_modify_field action;
} modify_header;
struct {
bool symmetric_hash_function; /* Symmetric RSS hash */
@@ -1112,6 +1112,7 @@ __flow_hw_act_data_hdr_modify_append(struct mlx5_priv *priv,
enum rte_flow_action_type type,
uint16_t action_src,
uint16_t action_dst,
+ const struct rte_flow_action_modify_field *mf,
uint16_t mhdr_cmds_off,
uint16_t mhdr_cmds_end,
bool shared,
@@ -1124,6 +1125,7 @@ __flow_hw_act_data_hdr_modify_append(struct mlx5_priv *priv,
act_data = __flow_hw_act_data_alloc(priv, type, action_src, action_dst);
if (!act_data)
return -1;
+ act_data->modify_header.action = *mf;
act_data->modify_header.mhdr_cmds_off = mhdr_cmds_off;
act_data->modify_header.mhdr_cmds_end = mhdr_cmds_end;
act_data->modify_header.shared = shared;
@@ -1605,7 +1607,7 @@ flow_hw_modify_field_compile(struct rte_eth_dev *dev,
if (shared)
return 0;
ret = __flow_hw_act_data_hdr_modify_append(priv, acts, RTE_FLOW_ACTION_TYPE_MODIFY_FIELD,
- src_pos, mhdr->pos,
+ src_pos, mhdr->pos, conf,
cmds_start, cmds_end, shared,
field, dcopy, mask);
if (ret)