* Destroy a flow in a list. * * @param dev * Pointer to Ethernet device. * @param[in] flow_idx * Index of flow to destroy. */
| 8050 | * Index of flow to destroy. |
| 8051 | */ |
| 8052 | static void |
| 8053 | flow_list_destroy(struct rte_eth_dev *dev, enum mlx5_flow_type type, |
| 8054 | uint32_t flow_idx) |
| 8055 | { |
| 8056 | struct mlx5_priv *priv = dev->data->dev_private; |
| 8057 | struct rte_flow *flow = mlx5_ipool_get(priv->flows[type], flow_idx); |
| 8058 | |
| 8059 | if (!flow) |
| 8060 | return; |
| 8061 | MLX5_ASSERT(flow->type == type); |
| 8062 | /* |
| 8063 | * Update RX queue flags only if port is started, otherwise it is |
| 8064 | * already clean. |
| 8065 | */ |
| 8066 | if (dev->data->dev_started) |
| 8067 | flow_rxq_flags_trim(dev, flow); |
| 8068 | flow_drv_destroy(dev, flow); |
| 8069 | if (flow->tunnel) { |
| 8070 | struct mlx5_flow_tunnel *tunnel; |
| 8071 | |
| 8072 | tunnel = mlx5_find_tunnel_id(dev, flow->tunnel_id); |
| 8073 | RTE_VERIFY(tunnel); |
| 8074 | if (!(__atomic_fetch_sub(&tunnel->refctn, 1, __ATOMIC_RELAXED) - 1)) |
| 8075 | mlx5_flow_tunnel_free(dev, tunnel); |
| 8076 | } |
| 8077 | flow_mreg_del_copy_action(dev, flow); |
| 8078 | mlx5_ipool_free(priv->flows[type], flow_idx); |
| 8079 | } |
| 8080 | |
| 8081 | /** |
| 8082 | * Destroy all flows. |
no test coverage detected