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

Function mlx5_mr_create_cache

dpdk/drivers/common/mlx5/mlx5_common_mr.c:1133–1144  ·  view source on GitHub ↗

* Initialize global MR cache of a device. * * @param share_cache * Pointer to a global shared MR cache. * @param socket * NUMA socket on which memory must be allocated. * * @return * 0 on success, a negative errno value otherwise and rte_errno is set. */

Source from the content-addressed store, hash-verified

1131 * 0 on success, a negative errno value otherwise and rte_errno is set.
1132 */
1133int
1134mlx5_mr_create_cache(struct mlx5_mr_share_cache *share_cache, int socket)
1135{
1136 /* Set the reg_mr and dereg_mr callback functions */
1137 mlx5_os_set_reg_mr_cb(&share_cache->reg_mr_cb,
1138 &share_cache->dereg_mr_cb);
1139 rte_rwlock_init(&share_cache->rwlock);
1140 rte_rwlock_init(&share_cache->mprwlock);
1141 /* Initialize B-tree and allocate memory for global MR cache table. */
1142 return mlx5_mr_btree_init(&share_cache->cache,
1143 MLX5_MR_BTREE_CACHE_N * 2, socket);
1144}
1145
1146/**
1147 * Flush all of the local cache entries.

Callers 1

mlx5_common_dev_createFunction · 0.85

Calls 3

rte_rwlock_initFunction · 0.85
mlx5_mr_btree_initFunction · 0.85
mlx5_os_set_reg_mr_cbFunction · 0.50

Tested by

no test coverage detected