numam-dpdk/drivers/common/mlx5
Ophir Munk af86364409 common/mlx5: fix aligned malloc
Before this commit system call memalign was used for aligned
allocations, however memalign is deprecated.

Based on (1) - POSIX requires that memory aligned allocations can be
freed using free. Some systems provide no way to reclaim memory
allocated with memalign (because one can only pass to free a pointer
gotten from malloc, while, memalign would call malloc and then align the
obtained value).
Another issue is that 64/32 bits architectures use a minimal alignment
size. So any requested alignment below the minimal system size can be
simplified by calling malloc.

The glibc implementation allows memory obtained from posix_memalign to
be reclaimed with free.  This commit replaces system call memalign with
system call posix_memalign. It also calls malloc in case the requested
alignment is below the minimal system size.

(1) https://linux.die.net/man/3/memalign

Fixes: d38e3d5266 ("common/mlx5: add memory management functions")
Cc: stable@dpdk.org

Signed-off-by: Ophir Munk <ophirmu@nvidia.com>
Acked-by: Matan Azrad <matan@mellanox.com>
2020-09-18 18:55:11 +02:00
..
linux net/mlx5: remove more Direct Verbs dependencies 2020-09-18 18:55:06 +02:00
meson.build common/mlx5: introduce layer for multiple class drivers 2020-07-28 19:01:11 +02:00
mlx5_common_mp.c common/mlx5: convert control path memory to unified malloc 2020-07-21 15:46:21 +02:00
mlx5_common_mp.h net/mlx5: add queue start and stop 2020-07-21 15:46:30 +02:00
mlx5_common_mr.c common/mlx5: convert data path objects to unified malloc 2020-07-21 15:46:30 +02:00
mlx5_common_mr.h common/mlx5: remove inclusion of Verbs header files 2020-07-21 15:46:30 +02:00
mlx5_common_pci.c common/mlx5: replace strsep with strtok_r 2020-09-18 18:55:06 +02:00
mlx5_common_pci.h common/mlx5: introduce layer for multiple class drivers 2020-07-28 19:01:11 +02:00
mlx5_common_utils.h common/mlx5: introduce common library 2020-02-05 09:51:20 +01:00
mlx5_common.c common/mlx5: fix queue doorbell record size 2020-07-30 00:41:23 +02:00
mlx5_common.h common/mlx5: fix queue doorbell record size 2020-07-30 00:41:23 +02:00
mlx5_devx_cmds.c common/mlx5: fix user mode register access command 2020-07-30 00:41:24 +02:00
mlx5_devx_cmds.h common/mlx5: fix user mode register access command 2020-07-30 00:41:24 +02:00
mlx5_malloc.c common/mlx5: fix aligned malloc 2020-09-18 18:55:11 +02:00
mlx5_malloc.h common/mlx5: fix aligned malloc 2020-09-18 18:55:11 +02:00
mlx5_prm.h net/mlx5: rename constant conflicting with Windows 2020-09-18 18:55:06 +02:00
rte_common_mlx5_version.map version: 20.11-rc0 2020-08-12 11:32:16 +02:00