[v2,16/16] net/mlx5: fix METER_MARK indirection list callback

Message ID 20231016184235.200427-16-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 success coding style OK
ci/github-robot: build success github build: passed

Commit Message

Gregory Etelson Oct. 16, 2023, 6:42 p.m. UTC
  Indirect action list METER_MARK handle and configuration parameters
can be independently masked or non-masked in actions template.
Non-masked configuration state is saved in the
`mlx5_action_construct_data::shared_meter` object.

The patch moves indirect action list callback from
`mlx5_action_construct_data` types union to prevent it's collision
with shared_meter.

Fixes: 82641ccee69d ("net/mlx5: support indirect list METER_MARK action")

Signed-off-by: Gregory Etelson <getelson@nvidia.com>
---
 drivers/net/mlx5/mlx5_flow.h    | 4 +---
 drivers/net/mlx5/mlx5_flow_hw.c | 5 +++--
 2 files changed, 4 insertions(+), 5 deletions(-)
  

Patch

diff --git a/drivers/net/mlx5/mlx5_flow.h b/drivers/net/mlx5/mlx5_flow.h
index 2c086026a2..53c11651c8 100644
--- a/drivers/net/mlx5/mlx5_flow.h
+++ b/drivers/net/mlx5/mlx5_flow.h
@@ -1271,6 +1271,7 @@  struct mlx5_action_construct_data {
 	uint32_t idx;  /* Data index. */
 	uint16_t action_src; /* rte_flow_action src offset. */
 	uint16_t action_dst; /* mlx5dr_rule_action dst offset. */
+	indirect_list_callback_t indirect_list_cb;
 	union {
 		struct {
 			/* encap data len. */
@@ -1312,9 +1313,6 @@  struct mlx5_action_construct_data {
 			uint32_t id;
 			uint32_t conf_masked:1;
 		} shared_meter;
-		struct {
-			indirect_list_callback_t cb;
-		} indirect_list;
 	};
 };
 
diff --git a/drivers/net/mlx5/mlx5_flow_hw.c b/drivers/net/mlx5/mlx5_flow_hw.c
index 4d070624c8..5114cc1920 100644
--- a/drivers/net/mlx5/mlx5_flow_hw.c
+++ b/drivers/net/mlx5/mlx5_flow_hw.c
@@ -605,7 +605,7 @@  flow_hw_act_data_indirect_list_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->indirect_list.cb = cb;
+	act_data->indirect_list_cb = cb;
 	LIST_INSERT_HEAD(&acts->act_list, act_data, next);
 	return 0;
 }
@@ -2538,7 +2538,8 @@  flow_hw_actions_construct(struct rte_eth_dev *dev,
 				    (int)action->type == act_data->type);
 		switch ((int)act_data->type) {
 		case RTE_FLOW_ACTION_TYPE_INDIRECT_LIST:
-			act_data->indirect_list.cb(dev, act_data, actions, rule_acts);
+			act_data->indirect_list_cb(dev, act_data, actions,
+						   &rule_acts[act_data->action_dst]);
 			break;
 		case RTE_FLOW_ACTION_TYPE_INDIRECT:
 			if (flow_hw_shared_action_construct