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

Function mlx5_malloc_mem_select

dpdk/drivers/common/mlx5/mlx5_malloc.c:294–312  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

292}
293
294void
295mlx5_malloc_mem_select(uint32_t sys_mem_en)
296{
297 /*
298 * The initialization should be called only once and all devices
299 * should use the same memory type. Otherwise, when new device is
300 * being attached with some different memory allocation configuration,
301 * the memory will get wrong behavior or a failure will be raised.
302 */
303 if (!mlx5_sys_mem.init) {
304 if (sys_mem_en)
305 mlx5_sys_mem.enable = 1;
306 mlx5_sys_mem.init = 1;
307 DRV_LOG(INFO, "%s is selected.", sys_mem_en ? "SYS_MEM" : "RTE_MEM");
308 } else if (mlx5_sys_mem.enable != sys_mem_en) {
309 DRV_LOG(WARNING, "%s is already selected.",
310 mlx5_sys_mem.enable ? "SYS_MEM" : "RTE_MEM");
311 }
312}

Callers 1

mlx5_common_dev_createFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected