* Destroy a flow. * * @see rte_flow_destroy() * @see rte_flow_ops */
| 8561 | * @see rte_flow_ops |
| 8562 | */ |
| 8563 | int |
| 8564 | mlx5_flow_destroy(struct rte_eth_dev *dev, |
| 8565 | struct rte_flow *flow, |
| 8566 | struct rte_flow_error *error __rte_unused) |
| 8567 | { |
| 8568 | struct mlx5_priv *priv = dev->data->dev_private; |
| 8569 | struct rte_pmd_mlx5_flow_engine_mode_info *mode_info = &priv->mode_info; |
| 8570 | struct mlx5_dv_flow_info *flow_info; |
| 8571 | |
| 8572 | if (priv->sh->config.dv_flow_en == 2) |
| 8573 | return rte_flow_error_set(error, ENOTSUP, |
| 8574 | RTE_FLOW_ERROR_TYPE_UNSPECIFIED, |
| 8575 | NULL, |
| 8576 | "Flow non-Q destruction not supported"); |
| 8577 | flow_list_destroy(dev, MLX5_FLOW_TYPE_GEN, |
| 8578 | (uintptr_t)(void *)flow); |
| 8579 | if (unlikely(mlx5_need_cache_flow(priv, NULL))) { |
| 8580 | flow_info = LIST_FIRST(&mode_info->hot_upgrade); |
| 8581 | while (flow_info) { |
| 8582 | /* Romove the cache flow info. */ |
| 8583 | if (flow_info->flow_idx_low_prio == (uint32_t)(uintptr_t)flow) { |
| 8584 | MLX5_ASSERT(!flow_info->flow_idx_high_prio); |
| 8585 | LIST_REMOVE(flow_info, next); |
| 8586 | mlx5_free(flow_info->items); |
| 8587 | mlx5_free(flow_info->actions); |
| 8588 | mlx5_free(flow_info); |
| 8589 | break; |
| 8590 | } |
| 8591 | flow_info = LIST_NEXT(flow_info, next); |
| 8592 | } |
| 8593 | } |
| 8594 | return 0; |
| 8595 | } |
| 8596 | |
| 8597 | /** |
| 8598 | * Destroy all flows. |
nothing calls this directly
no test coverage detected