src/dpdk/drivers/common/mlx5/mlx5_common_mr.c
void
mlx5_mr_release_cache(struct mlx5_mr_share_cache *share_cache)
{
	struct mlx5_mr *mr_next;

	rte_rwlock_write_lock(&share_cache->rwlock);
	/* Detach from MR list and move to free list. */
	mr_next = LIST_FIRST(&share_cache->mr_list);
	while (mr_next != NULL) {
		struct mlx5_mr *mr = mr_next;

		mr_next = LIST_NEXT(mr, mr);
		LIST_REMOVE(mr, mr);
		LIST_INSERT_HEAD(&share_cache->mr_free_list, mr, mr);
	}
	LIST_INIT(&share_cache->mr_list);
	/* Free global cache. */
	mlx5_mr_btree_free(&share_cache->cache);
	rte_rwlock_write_unlock(&share_cache->rwlock);
	/* Free all remaining MRs. */
	mlx5_mr_garbage_collect(share_cache);
}
/**
 * Release all the created MRs and resources on global MR cache of a device.
 * list.
 *
 * @param share_cache
 *   Pointer to a global shared MR cache.
 */
Release all the created MRs and resources on global MR cache of a device.
list.

@param share_cache
Pointer to a global shared MR cache.
Release all the created MRs and resources on global MR cache of a device . list . @param share_cache Pointer to a global shared MR cache .
void
mlx5_mr_release_cache(struct mlx5_mr_share_cache *share_cache)
{
	struct mlx5_mr *mr_next;
	rte_rwlock_write_lock(&share_cache->rwlock);
	mr_next = LIST_FIRST(&share_cache->mr_list);
	while (mr_next != NULL) {
		struct mlx5_mr *mr = mr_next;
		mr_next = LIST_NEXT(mr, mr);
		LIST_REMOVE(mr, mr);
		LIST_INSERT_HEAD(&share_cache->mr_free_list, mr, mr);
	}
	LIST_INIT(&share_cache->mr_list);
	mlx5_mr_btree_free(&share_cache->cache);
	rte_rwlock_write_unlock(&share_cache->rwlock);
	mlx5_mr_garbage_collect(share_cache);
}
void mlx5_mr_release_cache ( struct mlx5_mr_share_cache * share_cache ) { struct mlx5_mr * mr_next ; rte_rwlock_write_lock ( & share_cache -> rwlock ) ; mr_next = LIST_FIRST ( & share_cache -> mr_list ) ; while ( mr_next != NULL ) { struct mlx5_mr * mr = mr_next ; mr_next = LIST_NEXT ( mr , mr ) ; LIST_REMOVE ( mr , mr ) ; LIST_INSERT_HEAD ( & share_cache -> mr_free_list , mr , mr ) ; } LIST_INIT ( & share_cache -> mr_list ) ; mlx5_mr_btree_free ( & share_cache -> cache ) ; rte_rwlock_write_unlock ( & share_cache -> rwlock ) ; mlx5_mr_garbage_collect ( share_cache ) ; }
Release all the created MRs and resources on global MR cache of a device.
Release all the created MRs and resources on global MR cache of a device .
/* Detach from MR list and move to free list. */ /* Free global cache. */ /* Free all remaining MRs. */