[v2,10/16] net/mlx5: fix in shared counter and age template action create

Message ID 20231016184235.200427-10-getelson@nvidia.com (mailing list archive)
State Superseded, archived
Delegated to: Raslan Darawsheh
Headers
Series net/mlx5: support indirect list actions |

Checks

Context Check Description
ci/checkpatch warning coding style issues

Commit Message

Gregory Etelson Oct. 16, 2023, 6:42 p.m. UTC
  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@dpdk.org
Signed-off-by: Gregory Etelson <getelson@nvidia.com>
---
 drivers/net/mlx5/mlx5_flow_hw.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
  

Patch

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: