src/dpdk/drivers/net/mlx4/mlx4_mr.c
void
mlx4_mr_release(struct rte_eth_dev *dev)
{
	struct mlx4_priv *priv = dev->data->dev_private;
	struct mlx4_mr *mr_next;

	/* Remove from memory callback device list. */
	rte_rwlock_write_lock(&mlx4_shared_data->mem_event_rwlock);
	LIST_REMOVE(priv, mem_event_cb);
	rte_rwlock_write_unlock(&mlx4_shared_data->mem_event_rwlock);
#ifdef RTE_LIBRTE_MLX4_DEBUG
	mlx4_mr_dump_dev(dev);
#endif
	rte_rwlock_write_lock(&priv->mr.rwlock);
	/* Detach from MR list and move to free list. */
	mr_next = LIST_FIRST(&priv->mr.mr_list);
	while (mr_next != NULL) {
		struct mlx4_mr *mr = mr_next;

		mr_next = LIST_NEXT(mr, mr);
		LIST_REMOVE(mr, mr);
		LIST_INSERT_HEAD(&priv->mr.mr_free_list, mr, mr);
	}
	LIST_INIT(&priv->mr.mr_list);
	/* Free global cache. */
	mlx4_mr_btree_free(&priv->mr.cache);
	rte_rwlock_write_unlock(&priv->mr.rwlock);
	/* Free all remaining MRs. */
	mlx4_mr_garbage_collect(dev);
}
/**
 * Release all the created MRs and resources. Remove device from memory callback
 * list.
 *
 * @param dev
 *   Pointer to Ethernet device.
 */
Release all the created MRs and resources. Remove device from memory callback
list.

@param dev
Pointer to Ethernet device.
Release all the created MRs and resources . Remove device from memory callback list . @param dev Pointer to Ethernet device .
void
mlx4_mr_release(struct rte_eth_dev *dev)
{
	struct mlx4_priv *priv = dev->data->dev_private;
	struct mlx4_mr *mr_next;
	rte_rwlock_write_lock(&mlx4_shared_data->mem_event_rwlock);
	LIST_REMOVE(priv, mem_event_cb);
	rte_rwlock_write_unlock(&mlx4_shared_data->mem_event_rwlock);
#ifdef RTE_LIBRTE_MLX4_DEBUG
	mlx4_mr_dump_dev(dev);
#endif
	rte_rwlock_write_lock(&priv->mr.rwlock);
	mr_next = LIST_FIRST(&priv->mr.mr_list);
	while (mr_next != NULL) {
		struct mlx4_mr *mr = mr_next;
		mr_next = LIST_NEXT(mr, mr);
		LIST_REMOVE(mr, mr);
		LIST_INSERT_HEAD(&priv->mr.mr_free_list, mr, mr);
	}
	LIST_INIT(&priv->mr.mr_list);
	mlx4_mr_btree_free(&priv->mr.cache);
	rte_rwlock_write_unlock(&priv->mr.rwlock);
	mlx4_mr_garbage_collect(dev);
}
void mlx4_mr_release ( struct rte_eth_dev * dev ) { struct mlx4_priv * priv = dev -> data -> dev_private ; struct mlx4_mr * mr_next ; rte_rwlock_write_lock ( & mlx4_shared_data -> mem_event_rwlock ) ; LIST_REMOVE ( priv , mem_event_cb ) ; rte_rwlock_write_unlock ( & mlx4_shared_data -> mem_event_rwlock ) ; #ifdef RTE_LIBRTE_MLX4_DEBUG mlx4_mr_dump_dev ( dev ) ; #endif rte_rwlock_write_lock ( & priv -> mr . rwlock ) ; mr_next = LIST_FIRST ( & priv -> mr . mr_list ) ; while ( mr_next != NULL ) { struct mlx4_mr * mr = mr_next ; mr_next = LIST_NEXT ( mr , mr ) ; LIST_REMOVE ( mr , mr ) ; LIST_INSERT_HEAD ( & priv -> mr . mr_free_list , mr , mr ) ; } LIST_INIT ( & priv -> mr . mr_list ) ; mlx4_mr_btree_free ( & priv -> mr . cache ) ; rte_rwlock_write_unlock ( & priv -> mr . rwlock ) ; mlx4_mr_garbage_collect ( dev ) ; }
Release all the created MRs and resources.
Release all the created MRs and resources .
/* Remove from memory callback device list. */ /* Detach from MR list and move to free list. */ /* Free global cache. */ /* Free all remaining MRs. */