1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright 2015 6WIND S.A.
3 * Copyright 2015 Mellanox Technologies, Ltd
11 /* ISO C doesn't support unnamed structs/unions, disabling -pedantic. */
13 #pragma GCC diagnostic ignored "-Wpedantic"
15 #include <infiniband/verbs.h>
17 #pragma GCC diagnostic error "-Wpedantic"
20 #include <rte_ethdev_driver.h>
23 #include "mlx5_rxtx.h"
24 #include "mlx5_utils.h"
27 * DPDK callback to enable promiscuous mode.
30 * Pointer to Ethernet device structure.
33 mlx5_promiscuous_enable(struct rte_eth_dev *dev)
37 dev->data->promiscuous = 1;
38 ret = mlx5_traffic_restart(dev);
40 DRV_LOG(ERR, "port %u cannot enable promiscuous mode: %s",
41 dev->data->port_id, strerror(rte_errno));
45 * DPDK callback to disable promiscuous mode.
48 * Pointer to Ethernet device structure.
51 mlx5_promiscuous_disable(struct rte_eth_dev *dev)
55 dev->data->promiscuous = 0;
56 ret = mlx5_traffic_restart(dev);
58 DRV_LOG(ERR, "port %u cannot disable promiscuous mode: %s",
59 dev->data->port_id, strerror(rte_errno));
63 * DPDK callback to enable allmulti mode.
66 * Pointer to Ethernet device structure.
69 mlx5_allmulticast_enable(struct rte_eth_dev *dev)
73 dev->data->all_multicast = 1;
74 ret = mlx5_traffic_restart(dev);
76 DRV_LOG(ERR, "port %u cannot enable allmulicast mode: %s",
77 dev->data->port_id, strerror(rte_errno));
81 * DPDK callback to disable allmulti mode.
84 * Pointer to Ethernet device structure.
87 mlx5_allmulticast_disable(struct rte_eth_dev *dev)
91 dev->data->all_multicast = 0;
92 ret = mlx5_traffic_restart(dev);
94 DRV_LOG(ERR, "port %u cannot disable allmulicast mode: %s",
95 dev->data->port_id, strerror(rte_errno));