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

Function flow_hw_resource_release

dpdk/drivers/net/mlx5/mlx5_flow_hw.c:9778–9869  ·  view source on GitHub ↗

* Release HWS resources. * * @param[in] dev * Pointer to the rte_eth_dev structure. */

Source from the content-addressed store, hash-verified

9776 * Pointer to the rte_eth_dev structure.
9777 */
9778void
9779flow_hw_resource_release(struct rte_eth_dev *dev)
9780{
9781 struct mlx5_priv *priv = dev->data->dev_private;
9782 struct rte_flow_template_table *tbl, *temp_tbl;
9783 struct rte_flow_pattern_template *it, *temp_it;
9784 struct rte_flow_actions_template *at, *temp_at;
9785 struct mlx5_flow_group *grp, *temp_grp;
9786 uint32_t i;
9787
9788 if (!priv->dr_ctx)
9789 return;
9790 flow_hw_rxq_flag_set(dev, false);
9791 flow_hw_flush_all_ctrl_flows(dev);
9792 flow_hw_cleanup_ctrl_fdb_tables(dev);
9793 flow_hw_cleanup_tx_repr_tagging(dev);
9794 flow_hw_cleanup_ctrl_rx_tables(dev);
9795 grp = LIST_FIRST(&priv->flow_hw_grp);
9796 while (grp) {
9797 temp_grp = LIST_NEXT(grp, next);
9798 claim_zero(flow_hw_group_unset_miss_group(dev, grp, NULL));
9799 grp = temp_grp;
9800 }
9801 tbl = LIST_FIRST(&priv->flow_hw_tbl_ongo);
9802 while (tbl) {
9803 temp_tbl = LIST_NEXT(tbl, next);
9804 claim_zero(flow_hw_table_destroy(dev, tbl, NULL));
9805 tbl = temp_tbl;
9806 }
9807 tbl = LIST_FIRST(&priv->flow_hw_tbl);
9808 while (tbl) {
9809 temp_tbl = LIST_NEXT(tbl, next);
9810 claim_zero(flow_hw_table_destroy(dev, tbl, NULL));
9811 tbl = temp_tbl;
9812 }
9813 it = LIST_FIRST(&priv->flow_hw_itt);
9814 while (it) {
9815 temp_it = LIST_NEXT(it, next);
9816 claim_zero(flow_hw_pattern_template_destroy(dev, it, NULL));
9817 it = temp_it;
9818 }
9819 at = LIST_FIRST(&priv->flow_hw_at);
9820 while (at) {
9821 temp_at = LIST_NEXT(at, next);
9822 claim_zero(flow_hw_actions_template_destroy(dev, at, NULL));
9823 at = temp_at;
9824 }
9825 for (i = 0; i < MLX5_HW_ACTION_FLAG_MAX; i++) {
9826 if (priv->hw_drop[i])
9827 mlx5dr_action_destroy(priv->hw_drop[i]);
9828 if (priv->hw_tag[i])
9829 mlx5dr_action_destroy(priv->hw_tag[i]);
9830 }
9831 if (priv->hw_def_miss)
9832 mlx5dr_action_destroy(priv->hw_def_miss);
9833 flow_hw_destroy_vlan(dev);
9834 flow_hw_destroy_send_to_kernel_action(priv);
9835 flow_hw_free_vport_actions(priv);

Callers 1

mlx5_dev_closeFunction · 0.85

Tested by

no test coverage detected