diff mbox series

[v4,15/26] common/mlx5: call list callbacks with context

Message ID 20210706133257.3353-16-suanmingm@nvidia.com (mailing list archive)
State Superseded, archived
Delegated to: Raslan Darawsheh
Headers show
Series net/mlx5: insertion rate optimization | expand

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Suanming Mou July 6, 2021, 1:32 p.m. UTC
This commit optimizes to call the list callback functions with global
context directly.

Signed-off-by: Suanming Mou <suanmingm@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
---
 drivers/common/mlx5/mlx5_common_utils.c |  24 ++---
 drivers/common/mlx5/mlx5_common_utils.h |  36 ++++----
 drivers/net/mlx5/mlx5_flow.h            |  94 +++++++++----------
 drivers/net/mlx5/mlx5_flow_dv.c         | 115 +++++++++++-------------
 drivers/net/mlx5/mlx5_rx.h              |  13 ++-
 drivers/net/mlx5/mlx5_rxq.c             |  53 +++--------
 6 files changed, 132 insertions(+), 203 deletions(-)
diff mbox series

Patch

diff --git a/drivers/common/mlx5/mlx5_common_utils.c b/drivers/common/mlx5/mlx5_common_utils.c
index 6ac78ba97f..50c98143f7 100644
--- a/drivers/common/mlx5/mlx5_common_utils.c
+++ b/drivers/common/mlx5/mlx5_common_utils.c
@@ -55,7 +55,7 @@  __list_lookup(struct mlx5_list *list, int lcore_index, void *ctx, bool reuse)
 	uint32_t ret;
 
 	while (entry != NULL) {
-		if (list->cb_match(list, entry, ctx) == 0) {
+		if (list->cb_match(list->ctx, entry, ctx) == 0) {
 			if (reuse) {
 				ret = __atomic_add_fetch(&entry->ref_cnt, 1,
 							 __ATOMIC_RELAXED) - 1;
@@ -96,7 +96,7 @@  static struct mlx5_list_entry *
 mlx5_list_cache_insert(struct mlx5_list *list, int lcore_index,
 		       struct mlx5_list_entry *gentry, void *ctx)
 {
-	struct mlx5_list_entry *lentry = list->cb_clone(list, gentry, ctx);
+	struct mlx5_list_entry *lentry = list->cb_clone(list->ctx, gentry, ctx);
 
 	if (unlikely(!lentry))
 		return NULL;
@@ -121,9 +121,9 @@  __list_cache_clean(struct mlx5_list *list, int lcore_index)
 		if (__atomic_load_n(&entry->ref_cnt, __ATOMIC_RELAXED) == 0) {
 			LIST_REMOVE(entry, next);
 			if (list->lcores_share)
-				list->cb_clone_free(list, entry);
+				list->cb_clone_free(list->ctx, entry);
 			else
-				list->cb_remove(list, entry);
+				list->cb_remove(list->ctx, entry);
 			inv_cnt--;
 		}
 		entry = nentry;
@@ -162,7 +162,7 @@  mlx5_list_register(struct mlx5_list *list, void *ctx)
 		rte_rwlock_read_unlock(&list->lock);
 	}
 	/* 3. Prepare new entry for global list and for cache. */
-	entry = list->cb_create(list, entry, ctx);
+	entry = list->cb_create(list->ctx, ctx);
 	if (unlikely(!entry))
 		return NULL;
 	entry->ref_cnt = 1u;
@@ -174,9 +174,9 @@  mlx5_list_register(struct mlx5_list *list, void *ctx)
 			list->name, lcore_index, (void *)entry, entry->ref_cnt);
 		return entry;
 	}
-	local_entry = list->cb_clone(list, entry, ctx);
+	local_entry = list->cb_clone(list->ctx, entry, ctx);
 	if (unlikely(!local_entry)) {
-		list->cb_remove(list, entry);
+		list->cb_remove(list->ctx, entry);
 		return NULL;
 	}
 	local_entry->ref_cnt = 1u;
@@ -192,8 +192,8 @@  mlx5_list_register(struct mlx5_list *list, void *ctx)
 		if (unlikely(oentry)) {
 			/* 4.5. Found real race!!, reuse the old entry. */
 			rte_rwlock_write_unlock(&list->lock);
-			list->cb_remove(list, entry);
-			list->cb_clone_free(list, local_entry);
+			list->cb_remove(list->ctx, entry);
+			list->cb_clone_free(list->ctx, local_entry);
 			return mlx5_list_cache_insert(list, lcore_index, oentry,
 						      ctx);
 		}
@@ -223,9 +223,9 @@  mlx5_list_unregister(struct mlx5_list *list,
 	if (entry->lcore_idx == (uint32_t)lcore_idx) {
 		LIST_REMOVE(entry, next);
 		if (list->lcores_share)
-			list->cb_clone_free(list, entry);
+			list->cb_clone_free(list->ctx, entry);
 		else
-			list->cb_remove(list, entry);
+			list->cb_remove(list->ctx, entry);
 	} else if (likely(lcore_idx != -1)) {
 		__atomic_add_fetch(&list->cache[entry->lcore_idx].inv_cnt, 1,
 				   __ATOMIC_RELAXED);
@@ -244,7 +244,7 @@  mlx5_list_unregister(struct mlx5_list *list,
 	if (likely(gentry->ref_cnt == 0)) {
 		LIST_REMOVE(gentry, next);
 		rte_rwlock_write_unlock(&list->lock);
-		list->cb_remove(list, gentry);
+		list->cb_remove(list->ctx, gentry);
 		__atomic_sub_fetch(&list->count, 1, __ATOMIC_RELAXED);
 		DRV_LOG(DEBUG, "mlx5 list %s entry %p removed.",
 			list->name, (void *)gentry);
diff --git a/drivers/common/mlx5/mlx5_common_utils.h b/drivers/common/mlx5/mlx5_common_utils.h
index 000279d236..a691ff8f0d 100644
--- a/drivers/common/mlx5/mlx5_common_utils.h
+++ b/drivers/common/mlx5/mlx5_common_utils.h
@@ -33,19 +33,19 @@  struct mlx5_list_cache {
 /**
  * Type of callback function for entry removal.
  *
- * @param list
- *   The mlx5 list.
+ * @param tool_ctx
+ *   The tool instance user context.
  * @param entry
  *   The entry in the list.
  */
-typedef void (*mlx5_list_remove_cb)(struct mlx5_list *list,
-				     struct mlx5_list_entry *entry);
+typedef void (*mlx5_list_remove_cb)(void *tool_ctx,
+				    struct mlx5_list_entry *entry);
 
 /**
  * Type of function for user defined matching.
  *
- * @param list
- *   The mlx5 list.
+ * @param tool_ctx
+ *   The tool instance context.
  * @param entry
  *   The entry in the list.
  * @param ctx
@@ -54,34 +54,28 @@  typedef void (*mlx5_list_remove_cb)(struct mlx5_list *list,
  * @return
  *   0 if matching, non-zero number otherwise.
  */
-typedef int (*mlx5_list_match_cb)(struct mlx5_list *list,
+typedef int (*mlx5_list_match_cb)(void *tool_ctx,
 				   struct mlx5_list_entry *entry, void *ctx);
 
-typedef struct mlx5_list_entry *(*mlx5_list_clone_cb)
-				 (struct mlx5_list *list,
-				  struct mlx5_list_entry *entry, void *ctx);
+typedef struct mlx5_list_entry *(*mlx5_list_clone_cb)(void *tool_ctx,
+				      struct mlx5_list_entry *entry, void *ctx);
 
-typedef void (*mlx5_list_clone_free_cb)(struct mlx5_list *list,
-					 struct mlx5_list_entry *entry);
+typedef void (*mlx5_list_clone_free_cb)(void *tool_ctx,
+					struct mlx5_list_entry *entry);
 
 /**
  * Type of function for user defined mlx5 list entry creation.
  *
- * @param list
- *   The mlx5 list.
- * @param entry
- *   The new allocated entry, NULL if list entry size unspecified,
- *   New entry has to be allocated in callback and return.
+ * @param tool_ctx
+ *   The mlx5 tool instance context.
  * @param ctx
  *   The pointer to new entry context.
  *
  * @return
  *   Pointer of entry on success, NULL otherwise.
  */
-typedef struct mlx5_list_entry *(*mlx5_list_create_cb)
-				 (struct mlx5_list *list,
-				  struct mlx5_list_entry *entry,
-				  void *ctx);
+typedef struct mlx5_list_entry *(*mlx5_list_create_cb)(void *tool_ctx,
+						       void *ctx);
 
 /**
  * Linked mlx5 list structure.
diff --git a/drivers/net/mlx5/mlx5_flow.h b/drivers/net/mlx5/mlx5_flow.h
index ce4d205e86..1d96c61663 100644
--- a/drivers/net/mlx5/mlx5_flow.h
+++ b/drivers/net/mlx5/mlx5_flow.h
@@ -1619,64 +1619,50 @@  struct mlx5_hlist_entry *flow_dv_encap_decap_create_cb(struct mlx5_hlist *list,
 void flow_dv_encap_decap_remove_cb(struct mlx5_hlist *list,
 				   struct mlx5_hlist_entry *entry);
 
-int flow_dv_matcher_match_cb(struct mlx5_list *list,
-			     struct mlx5_list_entry *entry, void *ctx);
-struct mlx5_list_entry *flow_dv_matcher_create_cb(struct mlx5_list *list,
-						  struct mlx5_list_entry *entry,
-						  void *ctx);
-void flow_dv_matcher_remove_cb(struct mlx5_list *list,
-			       struct mlx5_list_entry *entry);
-
-int flow_dv_port_id_match_cb(struct mlx5_list *list,
-			     struct mlx5_list_entry *entry, void *cb_ctx);
-struct mlx5_list_entry *flow_dv_port_id_create_cb(struct mlx5_list *list,
-						  struct mlx5_list_entry *entry,
-						  void *cb_ctx);
-void flow_dv_port_id_remove_cb(struct mlx5_list *list,
-			       struct mlx5_list_entry *entry);
-struct mlx5_list_entry *flow_dv_port_id_clone_cb(struct mlx5_list *list,
-				struct mlx5_list_entry *entry __rte_unused,
-				 void *cb_ctx);
-void flow_dv_port_id_clone_free_cb(struct mlx5_list *list,
-				struct mlx5_list_entry *entry __rte_unused);
-int flow_dv_push_vlan_match_cb(struct mlx5_list *list,
-			       struct mlx5_list_entry *entry, void *cb_ctx);
-struct mlx5_list_entry *flow_dv_push_vlan_create_cb(struct mlx5_list *list,
-						  struct mlx5_list_entry *entry,
-						  void *cb_ctx);
-void flow_dv_push_vlan_remove_cb(struct mlx5_list *list,
-				 struct mlx5_list_entry *entry);
-struct mlx5_list_entry *flow_dv_push_vlan_clone_cb
-				(struct mlx5_list *list,
+int flow_dv_matcher_match_cb(void *tool_ctx, struct mlx5_list_entry *entry,
+			     void *ctx);
+struct mlx5_list_entry *flow_dv_matcher_create_cb(void *tool_ctx, void *ctx);
+void flow_dv_matcher_remove_cb(void *tool_ctx, struct mlx5_list_entry *entry);
+
+int flow_dv_port_id_match_cb(void *tool_ctx, struct mlx5_list_entry *entry,
+			     void *cb_ctx);
+struct mlx5_list_entry *flow_dv_port_id_create_cb(void *tool_ctx, void *cb_ctx);
+void flow_dv_port_id_remove_cb(void *tool_ctx, struct mlx5_list_entry *entry);
+struct mlx5_list_entry *flow_dv_port_id_clone_cb(void *tool_ctx,
+				struct mlx5_list_entry *entry, void *cb_ctx);
+void flow_dv_port_id_clone_free_cb(void *tool_ctx,
+				   struct mlx5_list_entry *entry);
+
+int flow_dv_push_vlan_match_cb(void *tool_ctx, struct mlx5_list_entry *entry,
+			       void *cb_ctx);
+struct mlx5_list_entry *flow_dv_push_vlan_create_cb(void *tool_ctx,
+						    void *cb_ctx);
+void flow_dv_push_vlan_remove_cb(void *tool_ctx, struct mlx5_list_entry *entry);
+struct mlx5_list_entry *flow_dv_push_vlan_clone_cb(void *tool_ctx,
 				 struct mlx5_list_entry *entry, void *cb_ctx);
-void flow_dv_push_vlan_clone_free_cb(struct mlx5_list *list,
-				 struct mlx5_list_entry *entry);
-
-int flow_dv_sample_match_cb(struct mlx5_list *list,
-			    struct mlx5_list_entry *entry, void *cb_ctx);
-struct mlx5_list_entry *flow_dv_sample_create_cb(struct mlx5_list *list,
-						 struct mlx5_list_entry *entry,
-						 void *cb_ctx);
-void flow_dv_sample_remove_cb(struct mlx5_list *list,
-			      struct mlx5_list_entry *entry);
-struct mlx5_list_entry *flow_dv_sample_clone_cb
-				(struct mlx5_list *list,
+void flow_dv_push_vlan_clone_free_cb(void *tool_ctx,
+				     struct mlx5_list_entry *entry);
+
+int flow_dv_sample_match_cb(void *tool_ctx, struct mlx5_list_entry *entry,
+			    void *cb_ctx);
+struct mlx5_list_entry *flow_dv_sample_create_cb(void *tool_ctx, void *cb_ctx);
+void flow_dv_sample_remove_cb(void *tool_ctx, struct mlx5_list_entry *entry);
+struct mlx5_list_entry *flow_dv_sample_clone_cb(void *tool_ctx,
 				 struct mlx5_list_entry *entry, void *cb_ctx);
-void flow_dv_sample_clone_free_cb(struct mlx5_list *list,
-			      struct mlx5_list_entry *entry);
-
-int flow_dv_dest_array_match_cb(struct mlx5_list *list,
-				struct mlx5_list_entry *entry, void *cb_ctx);
-struct mlx5_list_entry *flow_dv_dest_array_create_cb(struct mlx5_list *list,
-						  struct mlx5_list_entry *entry,
-						  void *cb_ctx);
-void flow_dv_dest_array_remove_cb(struct mlx5_list *list,
+void flow_dv_sample_clone_free_cb(void *tool_ctx,
 				  struct mlx5_list_entry *entry);
-struct mlx5_list_entry *flow_dv_dest_array_clone_cb
-				(struct mlx5_list *list,
-				 struct mlx5_list_entry *entry, void *cb_ctx);
-void flow_dv_dest_array_clone_free_cb(struct mlx5_list *list,
+
+int flow_dv_dest_array_match_cb(void *tool_ctx, struct mlx5_list_entry *entry,
+				void *cb_ctx);
+struct mlx5_list_entry *flow_dv_dest_array_create_cb(void *tool_ctx,
+						     void *cb_ctx);
+void flow_dv_dest_array_remove_cb(void *tool_ctx,
 				  struct mlx5_list_entry *entry);
+struct mlx5_list_entry *flow_dv_dest_array_clone_cb(void *tool_ctx,
+				   struct mlx5_list_entry *entry, void *cb_ctx);
+void flow_dv_dest_array_clone_free_cb(void *tool_ctx,
+				      struct mlx5_list_entry *entry);
+
 struct mlx5_aso_age_action *flow_aso_age_get_by_idx(struct rte_eth_dev *dev,
 						    uint32_t age_idx);
 int flow_dev_geneve_tlv_option_resource_register(struct rte_eth_dev *dev,
diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c
index 4f7cdb0622..d32dd76c11 100644
--- a/drivers/net/mlx5/mlx5_flow_dv.c
+++ b/drivers/net/mlx5/mlx5_flow_dv.c
@@ -3774,23 +3774,21 @@  flow_dv_jump_tbl_resource_register
 }
 
 int
-flow_dv_port_id_match_cb(struct mlx5_list *list __rte_unused,
+flow_dv_port_id_match_cb(void *tool_ctx __rte_unused,
 			 struct mlx5_list_entry *entry, void *cb_ctx)
 {
 	struct mlx5_flow_cb_ctx *ctx = cb_ctx;
 	struct mlx5_flow_dv_port_id_action_resource *ref = ctx->data;
 	struct mlx5_flow_dv_port_id_action_resource *res =
-			container_of(entry, typeof(*res), entry);
+				       container_of(entry, typeof(*res), entry);
 
 	return ref->port_id != res->port_id;
 }
 
 struct mlx5_list_entry *
-flow_dv_port_id_create_cb(struct mlx5_list *list,
-			  struct mlx5_list_entry *entry __rte_unused,
-			  void *cb_ctx)
+flow_dv_port_id_create_cb(void *tool_ctx, void *cb_ctx)
 {
-	struct mlx5_dev_ctx_shared *sh = list->ctx;
+	struct mlx5_dev_ctx_shared *sh = tool_ctx;
 	struct mlx5_flow_cb_ctx *ctx = cb_ctx;
 	struct mlx5_flow_dv_port_id_action_resource *ref = ctx->data;
 	struct mlx5_flow_dv_port_id_action_resource *resource;
@@ -3821,11 +3819,11 @@  flow_dv_port_id_create_cb(struct mlx5_list *list,
 }
 
 struct mlx5_list_entry *
-flow_dv_port_id_clone_cb(struct mlx5_list *list,
-			  struct mlx5_list_entry *entry __rte_unused,
-			  void *cb_ctx)
+flow_dv_port_id_clone_cb(void *tool_ctx,
+			 struct mlx5_list_entry *entry __rte_unused,
+			 void *cb_ctx)
 {
-	struct mlx5_dev_ctx_shared *sh = list->ctx;
+	struct mlx5_dev_ctx_shared *sh = tool_ctx;
 	struct mlx5_flow_cb_ctx *ctx = cb_ctx;
 	struct mlx5_flow_dv_port_id_action_resource *resource;
 	uint32_t idx;
@@ -3843,12 +3841,11 @@  flow_dv_port_id_clone_cb(struct mlx5_list *list,
 }
 
 void
-flow_dv_port_id_clone_free_cb(struct mlx5_list *list,
-			  struct mlx5_list_entry *entry)
+flow_dv_port_id_clone_free_cb(void *tool_ctx, struct mlx5_list_entry *entry)
 {
-	struct mlx5_dev_ctx_shared *sh = list->ctx;
+	struct mlx5_dev_ctx_shared *sh = tool_ctx;
 	struct mlx5_flow_dv_port_id_action_resource *resource =
-			container_of(entry, typeof(*resource), entry);
+				  container_of(entry, typeof(*resource), entry);
 
 	mlx5_ipool_free(sh->ipool[MLX5_IPOOL_PORT_ID], resource->idx);
 }
@@ -3893,23 +3890,21 @@  flow_dv_port_id_action_resource_register
 }
 
 int
-flow_dv_push_vlan_match_cb(struct mlx5_list *list __rte_unused,
-			 struct mlx5_list_entry *entry, void *cb_ctx)
+flow_dv_push_vlan_match_cb(void *tool_ctx __rte_unused,
+			   struct mlx5_list_entry *entry, void *cb_ctx)
 {
 	struct mlx5_flow_cb_ctx *ctx = cb_ctx;
 	struct mlx5_flow_dv_push_vlan_action_resource *ref = ctx->data;
 	struct mlx5_flow_dv_push_vlan_action_resource *res =
-			container_of(entry, typeof(*res), entry);
+				       container_of(entry, typeof(*res), entry);
 
 	return ref->vlan_tag != res->vlan_tag || ref->ft_type != res->ft_type;
 }
 
 struct mlx5_list_entry *
-flow_dv_push_vlan_create_cb(struct mlx5_list *list,
-			  struct mlx5_list_entry *entry __rte_unused,
-			  void *cb_ctx)
+flow_dv_push_vlan_create_cb(void *tool_ctx, void *cb_ctx)
 {
-	struct mlx5_dev_ctx_shared *sh = list->ctx;
+	struct mlx5_dev_ctx_shared *sh = tool_ctx;
 	struct mlx5_flow_cb_ctx *ctx = cb_ctx;
 	struct mlx5_flow_dv_push_vlan_action_resource *ref = ctx->data;
 	struct mlx5_flow_dv_push_vlan_action_resource *resource;
@@ -3946,11 +3941,11 @@  flow_dv_push_vlan_create_cb(struct mlx5_list *list,
 }
 
 struct mlx5_list_entry *
-flow_dv_push_vlan_clone_cb(struct mlx5_list *list,
-			  struct mlx5_list_entry *entry __rte_unused,
-			  void *cb_ctx)
+flow_dv_push_vlan_clone_cb(void *tool_ctx,
+			   struct mlx5_list_entry *entry __rte_unused,
+			   void *cb_ctx)
 {
-	struct mlx5_dev_ctx_shared *sh = list->ctx;
+	struct mlx5_dev_ctx_shared *sh = tool_ctx;
 	struct mlx5_flow_cb_ctx *ctx = cb_ctx;
 	struct mlx5_flow_dv_push_vlan_action_resource *resource;
 	uint32_t idx;
@@ -3968,12 +3963,11 @@  flow_dv_push_vlan_clone_cb(struct mlx5_list *list,
 }
 
 void
-flow_dv_push_vlan_clone_free_cb(struct mlx5_list *list,
-			    struct mlx5_list_entry *entry)
+flow_dv_push_vlan_clone_free_cb(void *tool_ctx, struct mlx5_list_entry *entry)
 {
-	struct mlx5_dev_ctx_shared *sh = list->ctx;
+	struct mlx5_dev_ctx_shared *sh = tool_ctx;
 	struct mlx5_flow_dv_push_vlan_action_resource *resource =
-			container_of(entry, typeof(*resource), entry);
+				  container_of(entry, typeof(*resource), entry);
 
 	mlx5_ipool_free(sh->ipool[MLX5_IPOOL_PUSH_VLAN], resource->idx);
 }
@@ -9952,7 +9946,7 @@  flow_dv_matcher_enable(uint32_t *match_criteria)
 }
 
 static struct mlx5_list_entry *
-flow_dv_matcher_clone_cb(struct mlx5_list *list __rte_unused,
+flow_dv_matcher_clone_cb(void *tool_ctx __rte_unused,
 			 struct mlx5_list_entry *entry, void *cb_ctx)
 {
 	struct mlx5_flow_cb_ctx *ctx = cb_ctx;
@@ -9975,7 +9969,7 @@  flow_dv_matcher_clone_cb(struct mlx5_list *list __rte_unused,
 }
 
 static void
-flow_dv_matcher_clone_free_cb(struct mlx5_list *list __rte_unused,
+flow_dv_matcher_clone_free_cb(void *tool_ctx __rte_unused,
 			     struct mlx5_list_entry *entry)
 {
 	mlx5_free(entry);
@@ -10218,7 +10212,7 @@  flow_dv_tbl_resource_release(struct mlx5_dev_ctx_shared *sh,
 }
 
 int
-flow_dv_matcher_match_cb(struct mlx5_list *list __rte_unused,
+flow_dv_matcher_match_cb(void *tool_ctx __rte_unused,
 			 struct mlx5_list_entry *entry, void *cb_ctx)
 {
 	struct mlx5_flow_cb_ctx *ctx = cb_ctx;
@@ -10233,11 +10227,9 @@  flow_dv_matcher_match_cb(struct mlx5_list *list __rte_unused,
 }
 
 struct mlx5_list_entry *
-flow_dv_matcher_create_cb(struct mlx5_list *list,
-			  struct mlx5_list_entry *entry __rte_unused,
-			  void *cb_ctx)
+flow_dv_matcher_create_cb(void *tool_ctx, void *cb_ctx)
 {
-	struct mlx5_dev_ctx_shared *sh = list->ctx;
+	struct mlx5_dev_ctx_shared *sh = tool_ctx;
 	struct mlx5_flow_cb_ctx *ctx = cb_ctx;
 	struct mlx5_flow_dv_matcher *ref = ctx->data;
 	struct mlx5_flow_dv_matcher *resource;
@@ -10733,7 +10725,7 @@  flow_dv_sample_sub_actions_release(struct rte_eth_dev *dev,
 }
 
 int
-flow_dv_sample_match_cb(struct mlx5_list *list __rte_unused,
+flow_dv_sample_match_cb(void *tool_ctx __rte_unused,
 			struct mlx5_list_entry *entry, void *cb_ctx)
 {
 	struct mlx5_flow_cb_ctx *ctx = cb_ctx;
@@ -10762,9 +10754,7 @@  flow_dv_sample_match_cb(struct mlx5_list *list __rte_unused,
 }
 
 struct mlx5_list_entry *
-flow_dv_sample_create_cb(struct mlx5_list *list __rte_unused,
-			 struct mlx5_list_entry *entry __rte_unused,
-			 void *cb_ctx)
+flow_dv_sample_create_cb(void *tool_ctx __rte_unused, void *cb_ctx)
 {
 	struct mlx5_flow_cb_ctx *ctx = cb_ctx;
 	struct rte_eth_dev *dev = ctx->dev;
@@ -10851,7 +10841,7 @@  flow_dv_sample_create_cb(struct mlx5_list *list __rte_unused,
 }
 
 struct mlx5_list_entry *
-flow_dv_sample_clone_cb(struct mlx5_list *list __rte_unused,
+flow_dv_sample_clone_cb(void *tool_ctx __rte_unused,
 			 struct mlx5_list_entry *entry __rte_unused,
 			 void *cb_ctx)
 {
@@ -10877,16 +10867,15 @@  flow_dv_sample_clone_cb(struct mlx5_list *list __rte_unused,
 }
 
 void
-flow_dv_sample_clone_free_cb(struct mlx5_list *list __rte_unused,
-			 struct mlx5_list_entry *entry)
+flow_dv_sample_clone_free_cb(void *tool_ctx __rte_unused,
+			     struct mlx5_list_entry *entry)
 {
 	struct mlx5_flow_dv_sample_resource *resource =
-			container_of(entry, typeof(*resource), entry);
+				  container_of(entry, typeof(*resource), entry);
 	struct rte_eth_dev *dev = resource->dev;
 	struct mlx5_priv *priv = dev->data->dev_private;
 
-	mlx5_ipool_free(priv->sh->ipool[MLX5_IPOOL_SAMPLE],
-			resource->idx);
+	mlx5_ipool_free(priv->sh->ipool[MLX5_IPOOL_SAMPLE], resource->idx);
 }
 
 /**
@@ -10929,14 +10918,14 @@  flow_dv_sample_resource_register(struct rte_eth_dev *dev,
 }
 
 int
-flow_dv_dest_array_match_cb(struct mlx5_list *list __rte_unused,
+flow_dv_dest_array_match_cb(void *tool_ctx __rte_unused,
 			    struct mlx5_list_entry *entry, void *cb_ctx)
 {
 	struct mlx5_flow_cb_ctx *ctx = cb_ctx;
 	struct mlx5_flow_dv_dest_array_resource *ctx_resource = ctx->data;
 	struct rte_eth_dev *dev = ctx->dev;
 	struct mlx5_flow_dv_dest_array_resource *resource =
-			container_of(entry, typeof(*resource), entry);
+				  container_of(entry, typeof(*resource), entry);
 	uint32_t idx = 0;
 
 	if (ctx_resource->num_of_dest == resource->num_of_dest &&
@@ -10958,9 +10947,7 @@  flow_dv_dest_array_match_cb(struct mlx5_list *list __rte_unused,
 }
 
 struct mlx5_list_entry *
-flow_dv_dest_array_create_cb(struct mlx5_list *list __rte_unused,
-			 struct mlx5_list_entry *entry __rte_unused,
-			 void *cb_ctx)
+flow_dv_dest_array_create_cb(void *tool_ctx __rte_unused, void *cb_ctx)
 {
 	struct mlx5_flow_cb_ctx *ctx = cb_ctx;
 	struct rte_eth_dev *dev = ctx->dev;
@@ -11065,9 +11052,9 @@  flow_dv_dest_array_create_cb(struct mlx5_list *list __rte_unused,
 }
 
 struct mlx5_list_entry *
-flow_dv_dest_array_clone_cb(struct mlx5_list *list __rte_unused,
-			 struct mlx5_list_entry *entry __rte_unused,
-			 void *cb_ctx)
+flow_dv_dest_array_clone_cb(void *tool_ctx __rte_unused,
+			    struct mlx5_list_entry *entry __rte_unused,
+			    void *cb_ctx)
 {
 	struct mlx5_flow_cb_ctx *ctx = cb_ctx;
 	struct rte_eth_dev *dev = ctx->dev;
@@ -11093,8 +11080,8 @@  flow_dv_dest_array_clone_cb(struct mlx5_list *list __rte_unused,
 }
 
 void
-flow_dv_dest_array_clone_free_cb(struct mlx5_list *list __rte_unused,
-			     struct mlx5_list_entry *entry)
+flow_dv_dest_array_clone_free_cb(void *tool_ctx __rte_unused,
+				 struct mlx5_list_entry *entry)
 {
 	struct mlx5_flow_dv_dest_array_resource *resource =
 			container_of(entry, typeof(*resource), entry);
@@ -13568,7 +13555,7 @@  flow_dv_apply(struct rte_eth_dev *dev, struct rte_flow *flow,
 }
 
 void
-flow_dv_matcher_remove_cb(struct mlx5_list *list __rte_unused,
+flow_dv_matcher_remove_cb(void *tool_ctx __rte_unused,
 			  struct mlx5_list_entry *entry)
 {
 	struct mlx5_flow_dv_matcher *resource = container_of(entry,
@@ -13710,10 +13697,9 @@  flow_dv_modify_hdr_resource_release(struct rte_eth_dev *dev,
 }
 
 void
-flow_dv_port_id_remove_cb(struct mlx5_list *list,
-			  struct mlx5_list_entry *entry)
+flow_dv_port_id_remove_cb(void *tool_ctx, struct mlx5_list_entry *entry)
 {
-	struct mlx5_dev_ctx_shared *sh = list->ctx;
+	struct mlx5_dev_ctx_shared *sh = tool_ctx;
 	struct mlx5_flow_dv_port_id_action_resource *resource =
 				  container_of(entry, typeof(*resource), entry);
 
@@ -13767,10 +13753,9 @@  flow_dv_shared_rss_action_release(struct rte_eth_dev *dev, uint32_t srss)
 }
 
 void
-flow_dv_push_vlan_remove_cb(struct mlx5_list *list,
-			    struct mlx5_list_entry *entry)
+flow_dv_push_vlan_remove_cb(void *tool_ctx, struct mlx5_list_entry *entry)
 {
-	struct mlx5_dev_ctx_shared *sh = list->ctx;
+	struct mlx5_dev_ctx_shared *sh = tool_ctx;
 	struct mlx5_flow_dv_push_vlan_action_resource *resource =
 			container_of(entry, typeof(*resource), entry);
 
@@ -13839,7 +13824,7 @@  flow_dv_fate_resource_release(struct rte_eth_dev *dev,
 }
 
 void
-flow_dv_sample_remove_cb(struct mlx5_list *list __rte_unused,
+flow_dv_sample_remove_cb(void *tool_ctx __rte_unused,
 			 struct mlx5_list_entry *entry)
 {
 	struct mlx5_flow_dv_sample_resource *resource = container_of(entry,
@@ -13887,7 +13872,7 @@  flow_dv_sample_resource_release(struct rte_eth_dev *dev,
 }
 
 void
-flow_dv_dest_array_remove_cb(struct mlx5_list *list __rte_unused,
+flow_dv_dest_array_remove_cb(void *tool_ctx __rte_unused,
 			     struct mlx5_list_entry *entry)
 {
 	struct mlx5_flow_dv_dest_array_resource *resource =
diff --git a/drivers/net/mlx5/mlx5_rx.h b/drivers/net/mlx5/mlx5_rx.h
index 5450ddd388..3f2b99fb65 100644
--- a/drivers/net/mlx5/mlx5_rx.h
+++ b/drivers/net/mlx5/mlx5_rx.h
@@ -222,17 +222,14 @@  int mlx5_ind_table_obj_modify(struct rte_eth_dev *dev,
 			      struct mlx5_ind_table_obj *ind_tbl,
 			      uint16_t *queues, const uint32_t queues_n,
 			      bool standalone);
-struct mlx5_list_entry *mlx5_hrxq_create_cb(struct mlx5_list *list,
-		struct mlx5_list_entry *entry __rte_unused, void *cb_ctx);
-int mlx5_hrxq_match_cb(struct mlx5_list *list,
-		       struct mlx5_list_entry *entry,
+struct mlx5_list_entry *mlx5_hrxq_create_cb(void *tool_ctx, void *cb_ctx);
+int mlx5_hrxq_match_cb(void *tool_ctx, struct mlx5_list_entry *entry,
 		       void *cb_ctx);
-void mlx5_hrxq_remove_cb(struct mlx5_list *list,
-			 struct mlx5_list_entry *entry);
-struct mlx5_list_entry *mlx5_hrxq_clone_cb(struct mlx5_list *list,
+void mlx5_hrxq_remove_cb(void *tool_ctx, struct mlx5_list_entry *entry);
+struct mlx5_list_entry *mlx5_hrxq_clone_cb(void *tool_ctx,
 					   struct mlx5_list_entry *entry,
 					   void *cb_ctx __rte_unused);
-void mlx5_hrxq_clone_free_cb(struct mlx5_list *list,
+void mlx5_hrxq_clone_free_cb(void *tool_ctx __rte_unused,
 			     struct mlx5_list_entry *entry);
 uint32_t mlx5_hrxq_get(struct rte_eth_dev *dev,
 		       struct mlx5_flow_rss_desc *rss_desc);
diff --git a/drivers/net/mlx5/mlx5_rxq.c b/drivers/net/mlx5/mlx5_rxq.c
index aa9e973d10..7893b3edd4 100644
--- a/drivers/net/mlx5/mlx5_rxq.c
+++ b/drivers/net/mlx5/mlx5_rxq.c
@@ -2093,25 +2093,10 @@  mlx5_ind_table_obj_modify(struct rte_eth_dev *dev,
 	return ret;
 }
 
-/**
- * Match an Rx Hash queue.
- *
- * @param list
- *   mlx5 list pointer.
- * @param entry
- *   Hash queue entry pointer.
- * @param cb_ctx
- *   Context of the callback function.
- *
- * @return
- *   0 if match, none zero if not match.
- */
 int
-mlx5_hrxq_match_cb(struct mlx5_list *list,
-		   struct mlx5_list_entry *entry,
-		   void *cb_ctx)
+mlx5_hrxq_match_cb(void *tool_ctx, struct mlx5_list_entry *entry, void *cb_ctx)
 {
-	struct rte_eth_dev *dev = list->ctx;
+	struct rte_eth_dev *dev = tool_ctx;
 	struct mlx5_flow_cb_ctx *ctx = cb_ctx;
 	struct mlx5_flow_rss_desc *rss_desc = ctx->data;
 	struct mlx5_hrxq *hrxq = container_of(entry, typeof(*hrxq), entry);
@@ -2251,10 +2236,9 @@  __mlx5_hrxq_remove(struct rte_eth_dev *dev, struct mlx5_hrxq *hrxq)
  *   Hash queue entry pointer.
  */
 void
-mlx5_hrxq_remove_cb(struct mlx5_list *list,
-		    struct mlx5_list_entry *entry)
+mlx5_hrxq_remove_cb(void *tool_ctx, struct mlx5_list_entry *entry)
 {
-	struct rte_eth_dev *dev = list->ctx;
+	struct rte_eth_dev *dev = tool_ctx;
 	struct mlx5_hrxq *hrxq = container_of(entry, typeof(*hrxq), entry);
 
 	__mlx5_hrxq_remove(dev, hrxq);
@@ -2305,25 +2289,10 @@  __mlx5_hrxq_create(struct rte_eth_dev *dev,
 	return NULL;
 }
 
-/**
- * Create an Rx Hash queue.
- *
- * @param list
- *   mlx5 list pointer.
- * @param entry
- *   Hash queue entry pointer.
- * @param cb_ctx
- *   Context of the callback function.
- *
- * @return
- *   queue entry on success, NULL otherwise.
- */
 struct mlx5_list_entry *
-mlx5_hrxq_create_cb(struct mlx5_list *list,
-		    struct mlx5_list_entry *entry __rte_unused,
-		    void *cb_ctx)
+mlx5_hrxq_create_cb(void *tool_ctx, void *cb_ctx)
 {
-	struct rte_eth_dev *dev = list->ctx;
+	struct rte_eth_dev *dev = tool_ctx;
 	struct mlx5_flow_cb_ctx *ctx = cb_ctx;
 	struct mlx5_flow_rss_desc *rss_desc = ctx->data;
 	struct mlx5_hrxq *hrxq;
@@ -2333,11 +2302,10 @@  mlx5_hrxq_create_cb(struct mlx5_list *list,
 }
 
 struct mlx5_list_entry *
-mlx5_hrxq_clone_cb(struct mlx5_list *list,
-		    struct mlx5_list_entry *entry,
+mlx5_hrxq_clone_cb(void *tool_ctx, struct mlx5_list_entry *entry,
 		    void *cb_ctx __rte_unused)
 {
-	struct rte_eth_dev *dev = list->ctx;
+	struct rte_eth_dev *dev = tool_ctx;
 	struct mlx5_priv *priv = dev->data->dev_private;
 	struct mlx5_hrxq *hrxq;
 	uint32_t hrxq_idx = 0;
@@ -2351,10 +2319,9 @@  mlx5_hrxq_clone_cb(struct mlx5_list *list,
 }
 
 void
-mlx5_hrxq_clone_free_cb(struct mlx5_list *list,
-		    struct mlx5_list_entry *entry)
+mlx5_hrxq_clone_free_cb(void *tool_ctx, struct mlx5_list_entry *entry)
 {
-	struct rte_eth_dev *dev = list->ctx;
+	struct rte_eth_dev *dev = tool_ctx;
 	struct mlx5_priv *priv = dev->data->dev_private;
 	struct mlx5_hrxq *hrxq = container_of(entry, typeof(*hrxq), entry);