common/mlx5: share hash list tool
[dpdk.git] / drivers / net / mlx5 / mlx5_flow.c
index cf93ab0..05d86b5 100644 (file)
@@ -4342,6 +4342,9 @@ flow_create_split_inner(struct rte_eth_dev *dev,
                dev_flow->handle->mark = 1;
        if (sub_flow)
                *sub_flow = dev_flow;
+#ifdef HAVE_IBV_FLOW_DV_SUPPORT
+       dev_flow->dv.table_id = flow_split_info->table_id;
+#endif
        return flow_drv_translate(dev, dev_flow, attr, items, actions, error);
 }
 
@@ -5497,8 +5500,7 @@ flow_create_split_sample(struct rte_eth_dev *dev,
                                                struct mlx5_flow_tbl_data_entry,
                                                tbl);
                        sfx_attr.group = sfx_attr.transfer ?
-                                               (sfx_tbl_data->table_id - 1) :
-                                               sfx_tbl_data->table_id;
+                       (sfx_tbl_data->level - 1) : sfx_tbl_data->level;
                } else {
                        MLX5_ASSERT(attr->transfer);
                        sfx_attr.group = jump_table;
@@ -5698,7 +5700,8 @@ flow_list_create(struct rte_eth_dev *dev, uint32_t *list,
                .skip_scale = 0,
                .flow_idx = 0,
                .prefix_mark = 0,
-               .prefix_layers = 0
+               .prefix_layers = 0,
+               .table_id = 0
        };
        int ret;
 
@@ -6652,52 +6655,6 @@ mlx5_flow_destroy_mtr_tbls(struct rte_eth_dev *dev,
        return fops->destroy_mtr_tbls(dev, tbls);
 }
 
-/**
- * Prepare policer rules.
- *
- * @param[in] dev
- *   Pointer to Ethernet device.
- * @param[in] fm
- *   Pointer to flow meter structure.
- * @param[in] attr
- *   Pointer to flow attributes.
- *
- * @return
- *   0 on success, -1 otherwise.
- */
-int
-mlx5_flow_prepare_policer_rules(struct rte_eth_dev *dev,
-                              struct mlx5_flow_meter_info *fm,
-                              const struct rte_flow_attr *attr)
-{
-       const struct mlx5_flow_driver_ops *fops;
-
-       fops = flow_get_drv_ops(MLX5_FLOW_TYPE_DV);
-       return fops->prepare_policer_rules(dev, fm, attr);
-}
-
-/**
- * Destroy policer rules.
- *
- * @param[in] fm
- *   Pointer to flow meter structure.
- * @param[in] attr
- *   Pointer to flow attributes.
- *
- * @return
- *   0 on success, -1 otherwise.
- */
-int
-mlx5_flow_destroy_policer_rules(struct rte_eth_dev *dev,
-                               struct mlx5_flow_meter_info *fm,
-                               const struct rte_flow_attr *attr)
-{
-       const struct mlx5_flow_driver_ops *fops;
-
-       fops = flow_get_drv_ops(MLX5_FLOW_TYPE_DV);
-       return fops->destroy_policer_rules(dev, fm, attr);
-}
-
 /**
  * Allocate the needed aso flow meter id.
  *
@@ -7784,10 +7741,12 @@ tunnel_mark_decode(struct rte_eth_dev *dev, uint32_t mark)
        union tunnel_offload_mark mbits = { .val = mark };
        union mlx5_flow_tbl_key table_key = {
                {
-                       .table_id = tunnel_id_to_flow_tbl(mbits.table_id),
+                       .level = tunnel_id_to_flow_tbl(mbits.table_id),
+                       .id = 0,
+                       .reserved = 0,
                        .dummy = 0,
-                       .domain = !!mbits.transfer,
-                       .direction = 0,
+                       .is_fdb = !!mbits.transfer,
+                       .is_egress = 0,
                }
        };
        he = mlx5_hlist_lookup(sh->flow_tbls, table_key.v64, NULL);