+ mlx5_hlist_destroy(*tbls);
+ *tbls = NULL;
+}
+
+#if defined(HAVE_IBV_FLOW_DV_SUPPORT) || !defined(HAVE_INFINIBAND_VERBS_H)
+/**
+ * Allocate HW steering group hash list.
+ *
+ * @param[in] priv
+ * Pointer to the private device data structure.
+ */
+static int
+mlx5_alloc_hw_group_hash_list(struct mlx5_priv *priv)
+{
+ int err = 0;
+ struct mlx5_dev_ctx_shared *sh = priv->sh;
+ char s[MLX5_NAME_SIZE];
+
+ MLX5_ASSERT(sh);
+ snprintf(s, sizeof(s), "%s_flow_groups", priv->sh->ibdev_name);
+ sh->groups = mlx5_hlist_create
+ (s, MLX5_FLOW_TABLE_HLIST_ARRAY_SIZE,
+ false, true, sh,
+ flow_hw_grp_create_cb,
+ flow_hw_grp_match_cb,
+ flow_hw_grp_remove_cb,
+ flow_hw_grp_clone_cb,
+ flow_hw_grp_clone_free_cb);
+ if (!sh->groups) {
+ DRV_LOG(ERR, "flow groups with hash creation failed.");
+ err = ENOMEM;
+ }
+ return err;