src/dpdk/drivers/net/mlx5/linux/mlx5_os.c
void
mlx5_os_free_shared_dr(struct mlx5_priv *priv)
{
	struct mlx5_dev_ctx_shared *sh = priv->sh;

	MLX5_ASSERT(sh && sh->refcnt);
	if (sh->refcnt > 1)
		return;
#ifdef HAVE_MLX5DV_DR
	if (sh->rx_domain) {
		mlx5_glue->dr_destroy_domain(sh->rx_domain);
		sh->rx_domain = NULL;
	}
	if (sh->tx_domain) {
		mlx5_glue->dr_destroy_domain(sh->tx_domain);
		sh->tx_domain = NULL;
	}
#ifdef HAVE_MLX5DV_DR_ESWITCH
	if (sh->fdb_domain) {
		mlx5_glue->dr_destroy_domain(sh->fdb_domain);
		sh->fdb_domain = NULL;
	}
	if (sh->dr_drop_action) {
		mlx5_glue->destroy_flow_action(sh->dr_drop_action);
		sh->dr_drop_action = NULL;
	}
#endif
	if (sh->pop_vlan_action) {
		mlx5_glue->destroy_flow_action(sh->pop_vlan_action);
		sh->pop_vlan_action = NULL;
	}
#endif /* HAVE_MLX5DV_DR */
	if (sh->default_miss_action)
		mlx5_glue->destroy_flow_action
				(sh->default_miss_action);
	if (sh->encaps_decaps) {
		mlx5_hlist_destroy(sh->encaps_decaps);
		sh->encaps_decaps = NULL;
	}
	if (sh->modify_cmds) {
		mlx5_hlist_destroy(sh->modify_cmds);
		sh->modify_cmds = NULL;
	}
	if (sh->tag_table) {
		/* tags should be destroyed with flow before. */
		mlx5_hlist_destroy(sh->tag_table);
		sh->tag_table = NULL;
	}
	if (sh->tunnel_hub) {
		mlx5_release_tunnel_hub(sh, priv->dev_port);
		sh->tunnel_hub = NULL;
	}
	mlx5_cache_list_destroy(&sh->port_id_action_list);
	mlx5_cache_list_destroy(&sh->push_vlan_action_list);
	mlx5_free_table_hash_list(priv);
}
/**
 * Destroy DR related data within private structure.
 *
 * @param[in] priv
 *   Pointer to the private device data structure.
 */
Destroy DR related data within private structure.
@param[in] priv
Pointer to the private device data structure.
Destroy DR related data within private structure . @param [ in ] priv Pointer to the private device data structure .
void
mlx5_os_free_shared_dr(struct mlx5_priv *priv)
{
	struct mlx5_dev_ctx_shared *sh = priv->sh;
	MLX5_ASSERT(sh && sh->refcnt);
	if (sh->refcnt > 1)
		return;
#ifdef HAVE_MLX5DV_DR
	if (sh->rx_domain) {
		mlx5_glue->dr_destroy_domain(sh->rx_domain);
		sh->rx_domain = NULL;
	}
	if (sh->tx_domain) {
		mlx5_glue->dr_destroy_domain(sh->tx_domain);
		sh->tx_domain = NULL;
	}
#ifdef HAVE_MLX5DV_DR_ESWITCH
	if (sh->fdb_domain) {
		mlx5_glue->dr_destroy_domain(sh->fdb_domain);
		sh->fdb_domain = NULL;
	}
	if (sh->dr_drop_action) {
		mlx5_glue->destroy_flow_action(sh->dr_drop_action);
		sh->dr_drop_action = NULL;
	}
#endif
	if (sh->pop_vlan_action) {
		mlx5_glue->destroy_flow_action(sh->pop_vlan_action);
		sh->pop_vlan_action = NULL;
	}
#endif 
	if (sh->default_miss_action)
		mlx5_glue->destroy_flow_action
				(sh->default_miss_action);
	if (sh->encaps_decaps) {
		mlx5_hlist_destroy(sh->encaps_decaps);
		sh->encaps_decaps = NULL;
	}
	if (sh->modify_cmds) {
		mlx5_hlist_destroy(sh->modify_cmds);
		sh->modify_cmds = NULL;
	}
	if (sh->tag_table) {
		mlx5_hlist_destroy(sh->tag_table);
		sh->tag_table = NULL;
	}
	if (sh->tunnel_hub) {
		mlx5_release_tunnel_hub(sh, priv->dev_port);
		sh->tunnel_hub = NULL;
	}
	mlx5_cache_list_destroy(&sh->port_id_action_list);
	mlx5_cache_list_destroy(&sh->push_vlan_action_list);
	mlx5_free_table_hash_list(priv);
}
void mlx5_os_free_shared_dr ( struct mlx5_priv * priv ) { struct mlx5_dev_ctx_shared * sh = priv -> sh ; MLX5_ASSERT ( sh && sh -> refcnt ) ; if ( sh -> refcnt > 1 ) return ; #ifdef HAVE_MLX5DV_DR if ( sh -> rx_domain ) { mlx5_glue -> dr_destroy_domain ( sh -> rx_domain ) ; sh -> rx_domain = NULL ; } if ( sh -> tx_domain ) { mlx5_glue -> dr_destroy_domain ( sh -> tx_domain ) ; sh -> tx_domain = NULL ; } #ifdef HAVE_MLX5DV_DR_ESWITCH if ( sh -> fdb_domain ) { mlx5_glue -> dr_destroy_domain ( sh -> fdb_domain ) ; sh -> fdb_domain = NULL ; } if ( sh -> dr_drop_action ) { mlx5_glue -> destroy_flow_action ( sh -> dr_drop_action ) ; sh -> dr_drop_action = NULL ; } #endif if ( sh -> pop_vlan_action ) { mlx5_glue -> destroy_flow_action ( sh -> pop_vlan_action ) ; sh -> pop_vlan_action = NULL ; } #endif if ( sh -> default_miss_action ) mlx5_glue -> destroy_flow_action ( sh -> default_miss_action ) ; if ( sh -> encaps_decaps ) { mlx5_hlist_destroy ( sh -> encaps_decaps ) ; sh -> encaps_decaps = NULL ; } if ( sh -> modify_cmds ) { mlx5_hlist_destroy ( sh -> modify_cmds ) ; sh -> modify_cmds = NULL ; } if ( sh -> tag_table ) { mlx5_hlist_destroy ( sh -> tag_table ) ; sh -> tag_table = NULL ; } if ( sh -> tunnel_hub ) { mlx5_release_tunnel_hub ( sh , priv -> dev_port ) ; sh -> tunnel_hub = NULL ; } mlx5_cache_list_destroy ( & sh -> port_id_action_list ) ; mlx5_cache_list_destroy ( & sh -> push_vlan_action_list ) ; mlx5_free_table_hash_list ( priv ) ; }
Destroy DR related data within private structure.
Destroy DR related data within private structure .
/* HAVE_MLX5DV_DR */ /* tags should be destroyed with flow before. */