[PATCH v2 10/16] net/mlx5: fix in shared counter and age template action create
Gregory Etelson
getelson at nvidia.com
Mon Oct 16 20:42:29 CEST 2023
Count and age actions in HWS template are translated into the same
DR5 action.
PMD maintains dedicated variable - `cnt_off`, that points
action location in DR5 array.
Currnet PMD did not initialize the `cnt_off` variable during
shared counter / age actions initialization.
Fixes: feb1f2fe2b76 ("net/mlx5: reformat HWS code")
Cc: stable at dpdk.org
Signed-off-by: Gregory Etelson <getelson at nvidia.com>
---
drivers/net/mlx5/mlx5_flow_hw.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/net/mlx5/mlx5_flow_hw.c b/drivers/net/mlx5/mlx5_flow_hw.c
index 910d42a5f5..efb2d512b7 100644
--- a/drivers/net/mlx5/mlx5_flow_hw.c
+++ b/drivers/net/mlx5/mlx5_flow_hw.c
@@ -4680,10 +4680,12 @@ flow_hw_dr_actions_template_handle_shared(const struct rte_flow_action *mask,
* Both AGE and COUNT action need counter, the first one fills
* the action_types array, and the second only saves the offset.
*/
- if (*cnt_off == UINT16_MAX)
+ if (*cnt_off == UINT16_MAX) {
+ *cnt_off = *curr_off;
action_template_set_type(at, action_types,
action_src, curr_off,
MLX5DR_ACTION_TYP_CTR);
+ }
at->actions_off[action_src] = *cnt_off;
break;
case RTE_FLOW_ACTION_TYPE_CONNTRACK:
--
2.39.2
More information about the stable
mailing list