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

Function flow_list_destroy

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

* Destroy a flow in a list. * * @param dev * Pointer to Ethernet device. * @param[in] flow_idx * Index of flow to destroy. */

Source from the content-addressed store, hash-verified

8050 * Index of flow to destroy.
8051 */
8052static void
8053flow_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.

Callers 6

flow_dv_mreg_remove_cbFunction · 0.85
mlx5_flow_createFunction · 0.85
mlx5_flow_list_flushFunction · 0.85
mlx5_flow_destroyFunction · 0.85

Calls 7

mlx5_ipool_getFunction · 0.85
flow_rxq_flags_trimFunction · 0.85
flow_drv_destroyFunction · 0.85
mlx5_find_tunnel_idFunction · 0.85
mlx5_flow_tunnel_freeFunction · 0.85
mlx5_ipool_freeFunction · 0.85

Tested by

no test coverage detected