#include <stddef.h>
#include <errno.h>
-#include <assert.h>
#include <stdint.h>
#include <unistd.h>
#include <mlx5_glue.h>
#include <mlx5_devx_cmds.h>
+#include <mlx5_nl.h>
#include "mlx5.h"
#include "mlx5_autoconf.h"
#include "mlx5_rxtx.h"
-#include "mlx5_nl.h"
#include "mlx5_utils.h"
/**
DRV_LOG(DEBUG, "port %u %s VLAN filter ID %" PRIu16,
dev->data->port_id, (on ? "enable" : "disable"), vlan_id);
- assert(priv->vlan_filter_n <= RTE_DIM(priv->vlan_filter));
+ MLX5_ASSERT(priv->vlan_filter_n <= RTE_DIM(priv->vlan_filter));
for (i = 0; (i != priv->vlan_filter_n); ++i)
if (priv->vlan_filter[i] == vlan_id)
break;
return -rte_errno;
}
if (i < priv->vlan_filter_n) {
- assert(priv->vlan_filter_n != 0);
+ MLX5_ASSERT(priv->vlan_filter_n != 0);
/* Enabling an existing VLAN filter has no effect. */
if (on)
goto out;
(priv->vlan_filter_n - i));
priv->vlan_filter[priv->vlan_filter_n] = 0;
} else {
- assert(i == priv->vlan_filter_n);
+ MLX5_ASSERT(i == priv->vlan_filter_n);
/* Disabling an unknown VLAN filter has no effect. */
if (!on)
goto out;
struct mlx5_nl_vlan_vmwa_context *vmwa = priv->vmwa_context;
struct mlx5_nl_vlan_dev *vlan_dev = &vmwa->vlan_dev[0];
- assert(vlan->created);
- assert(priv->vmwa_context);
+ MLX5_ASSERT(vlan->created);
+ MLX5_ASSERT(priv->vmwa_context);
if (!vlan->created || !vmwa)
return;
vlan->created = 0;
- assert(vlan_dev[vlan->tag].refcnt);
+ MLX5_ASSERT(vlan_dev[vlan->tag].refcnt);
if (--vlan_dev[vlan->tag].refcnt == 0 &&
vlan_dev[vlan->tag].ifindex) {
mlx5_nl_vlan_vmwa_delete(vmwa, vlan_dev[vlan->tag].ifindex);
struct mlx5_nl_vlan_vmwa_context *vmwa = priv->vmwa_context;
struct mlx5_nl_vlan_dev *vlan_dev = &vmwa->vlan_dev[0];
- assert(!vlan->created);
- assert(priv->vmwa_context);
+ MLX5_ASSERT(!vlan->created);
+ MLX5_ASSERT(priv->vmwa_context);
if (vlan->created || !vmwa)
return;
if (vlan_dev[vlan->tag].refcnt == 0) {
- assert(!vlan_dev[vlan->tag].ifindex);
+ MLX5_ASSERT(!vlan_dev[vlan->tag].ifindex);
vlan_dev[vlan->tag].ifindex =
mlx5_nl_vlan_vmwa_create(vmwa, vmwa->vf_ifindex,
vlan->tag);