src/dpdk/drivers/common/mlx5/mlx5_common_mr.c
static uint32_t
mlx5_mr_create(void *pd, struct mlx5_mp_id *mp_id,
	       struct mlx5_mr_share_cache *share_cache,
	       struct mr_cache_entry *entry, uintptr_t addr,
	       unsigned int mr_ext_memseg_en)
{
	uint32_t ret = 0;

	switch (rte_eal_process_type()) {
	case RTE_PROC_PRIMARY:
		ret = mlx5_mr_create_primary(pd, share_cache, entry,
					     addr, mr_ext_memseg_en);
		break;
	case RTE_PROC_SECONDARY:
		ret = mlx5_mr_create_secondary(pd, mp_id, share_cache, entry,
					       addr, mr_ext_memseg_en);
		break;
	default:
		break;
	}
	return ret;
}
/**
 * Create a new global Memory Region (MR) for a missing virtual address.
 * This can be called from primary and secondary process.
 *
 * @param pd
 *   Pointer to pd handle of a device (net, regex, vdpa,...).
 * @param share_cache
 *   Pointer to a global shared MR cache.
 * @param[out] entry
 *   Pointer to returning MR cache entry, found in the global cache or newly
 *   created. If failed to create one, this will not be updated.
 * @param addr
 *   Target virtual address to register.
 *
 * @return
 *   Searched LKey on success, UINT32_MAX on failure and rte_errno is set.
 */
Create a new global Memory Region (MR) for a missing virtual address.
This can be called from primary and secondary process.

@param pd
Pointer to pd handle of a device (net, regex, vdpa,...).
@param share_cache
Pointer to a global shared MR cache.
@param[out] entry
Pointer to returning MR cache entry, found in the global cache or newly
created. If failed to create one, this will not be updated.
@param addr
Target virtual address to register.

@return
Searched LKey on success, UINT32_MAX on failure and rte_errno is set.
Create a new global Memory Region ( MR ) for a missing virtual address . This can be called from primary and secondary process . @param pd Pointer to pd handle of a device ( net regex vdpa ... ) . @param share_cache Pointer to a global shared MR cache . @param [ out ] entry Pointer to returning MR cache entry found in the global cache or newly created . If failed to create one this will not be updated . @param addr Target virtual address to register . @return Searched LKey on success UINT32_MAX on failure and rte_errno is set .
static uint32_t
mlx5_mr_create(void *pd, struct mlx5_mp_id *mp_id,
	       struct mlx5_mr_share_cache *share_cache,
	       struct mr_cache_entry *entry, uintptr_t addr,
	       unsigned int mr_ext_memseg_en)
{
	uint32_t ret = 0;
	switch (rte_eal_process_type()) {
	case RTE_PROC_PRIMARY:
		ret = mlx5_mr_create_primary(pd, share_cache, entry,
					     addr, mr_ext_memseg_en);
		break;
	case RTE_PROC_SECONDARY:
		ret = mlx5_mr_create_secondary(pd, mp_id, share_cache, entry,
					       addr, mr_ext_memseg_en);
		break;
	default:
		break;
	}
	return ret;
}
static uint32_t mlx5_mr_create ( void * pd , struct mlx5_mp_id * mp_id , struct mlx5_mr_share_cache * share_cache , struct mr_cache_entry * entry , uintptr_t addr , unsigned int mr_ext_memseg_en ) { uint32_t ret = 0 ; switch ( rte_eal_process_type ( ) ) { case RTE_PROC_PRIMARY : ret = mlx5_mr_create_primary ( pd , share_cache , entry , addr , mr_ext_memseg_en ) ; break ; case RTE_PROC_SECONDARY : ret = mlx5_mr_create_secondary ( pd , mp_id , share_cache , entry , addr , mr_ext_memseg_en ) ; break ; default : break ; } return ret ; }
Create a new global Memory Region (MR) for a missing virtual address.
Create a new global Memory Region ( MR ) for a missing virtual address .