#include <unistd.h>
#include <rte_errno.h>
-#include <rte_atomic.h>
#include "mlx5_nl.h"
#include "mlx5_common_utils.h"
+#include "mlx5_malloc.h"
#ifdef HAVE_DEVLINK
#include <linux/devlink.h>
#endif
uint32_t portnum; /**< IB device max port number (out). */
};
-rte_atomic32_t atomic_sn = RTE_ATOMIC32_INIT(0);
+uint32_t atomic_sn;
/* Generate Netlink sequence number. */
-#define MLX5_NL_SN_GENERATE ((uint32_t)rte_atomic32_add_return(&atomic_sn, 1))
+#define MLX5_NL_SN_GENERATE __atomic_add_fetch(&atomic_sn, 1, __ATOMIC_RELAXED)
/**
* Opens a Netlink socket.
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,
}
} while (multipart);
exit:
- free(buf);
+ mlx5_free(buf);
return ret;
}
{
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) {
/* 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;