MCPcopy Create free account
hub / github.com/F-Stack/f-stack / mlx5_flow_destroy

Function mlx5_flow_destroy

dpdk/drivers/net/mlx5/mlx5_flow.c:8563–8595  ·  view source on GitHub ↗

* Destroy a flow. * * @see rte_flow_destroy() * @see rte_flow_ops */

Source from the content-addressed store, hash-verified

8561 * @see rte_flow_ops
8562 */
8563int
8564mlx5_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.

Callers

nothing calls this directly

Calls 4

rte_flow_error_setFunction · 0.85
flow_list_destroyFunction · 0.85
mlx5_need_cache_flowFunction · 0.85
mlx5_freeFunction · 0.85

Tested by

no test coverage detected