X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=drivers%2Fcommon%2Fmlx5%2Flinux%2Fmlx5_nl.c;h=0ecd9c7014556d77247f2e632c4abc1075ec10f5;hb=4a01fa047b3ecd3fd5a2cd60183f73580eed346d;hp=2943704e5ec3bb6105014597fd449457df420565;hpb=59513c3e137b21d6dbebb289c7be58f3a3dbe9ee;p=dpdk.git diff --git a/drivers/common/mlx5/linux/mlx5_nl.c b/drivers/common/mlx5/linux/mlx5_nl.c index 2943704e5e..0ecd9c7014 100644 --- a/drivers/common/mlx5/linux/mlx5_nl.c +++ b/drivers/common/mlx5/linux/mlx5_nl.c @@ -22,6 +22,7 @@ #include "mlx5_nl.h" #include "mlx5_common_utils.h" +#include "mlx5_malloc.h" #ifdef HAVE_DEVLINK #include #endif @@ -330,7 +331,7 @@ mlx5_nl_recv(int nlsk_fd, uint32_t sn, int (*cb)(struct nlmsghdr *, void *arg), void *arg) { struct sockaddr_nl sa; - void *buf = malloc(MLX5_RECV_BUF_SIZE); + void *buf = mlx5_malloc(0, MLX5_RECV_BUF_SIZE, 0, SOCKET_ID_ANY); struct iovec iov = { .iov_base = buf, .iov_len = MLX5_RECV_BUF_SIZE, @@ -393,7 +394,7 @@ mlx5_nl_recv(int nlsk_fd, uint32_t sn, int (*cb)(struct nlmsghdr *, void *arg), } } while (multipart); exit: - free(buf); + mlx5_free(buf); return ret; } @@ -789,7 +790,7 @@ mlx5_nl_mac_addr_flush(int nlsk_fd, unsigned int iface_idx, { int i; - if (n <= 0 || n >= MLX5_MAX_MAC_ADDRESSES) + if (n <= 0 || n > MLX5_MAX_MAC_ADDRESSES) return; for (i = n - 1; i >= 0; --i) { @@ -1145,6 +1146,8 @@ mlx5_nl_check_switch_info(bool num_vf_set, /* Legacy representors naming schema. */ switch_info->representor = !num_vf_set; break; + case MLX5_PHYS_PORT_NAME_TYPE_PFHPF: + /* Fallthrough */ case MLX5_PHYS_PORT_NAME_TYPE_PFVF: /* New representors naming schema. */ switch_info->representor = 1;