net/mlx5: use SPDX tags in 6WIND copyrighted files
[dpdk.git] / drivers / net / mlx5 / mlx5_rxmode.c
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright 2015 6WIND S.A.
3  * Copyright 2015 Mellanox.
4  */
5
6 #include <stddef.h>
7 #include <errno.h>
8 #include <string.h>
9
10 /* Verbs header. */
11 /* ISO C doesn't support unnamed structs/unions, disabling -pedantic. */
12 #ifdef PEDANTIC
13 #pragma GCC diagnostic ignored "-Wpedantic"
14 #endif
15 #include <infiniband/verbs.h>
16 #ifdef PEDANTIC
17 #pragma GCC diagnostic error "-Wpedantic"
18 #endif
19
20 #include <rte_ethdev_driver.h>
21
22 #include "mlx5.h"
23 #include "mlx5_rxtx.h"
24 #include "mlx5_utils.h"
25
26 /**
27  * DPDK callback to enable promiscuous mode.
28  *
29  * @param dev
30  *   Pointer to Ethernet device structure.
31  */
32 void
33 mlx5_promiscuous_enable(struct rte_eth_dev *dev)
34 {
35         dev->data->promiscuous = 1;
36         mlx5_traffic_restart(dev);
37 }
38
39 /**
40  * DPDK callback to disable promiscuous mode.
41  *
42  * @param dev
43  *   Pointer to Ethernet device structure.
44  */
45 void
46 mlx5_promiscuous_disable(struct rte_eth_dev *dev)
47 {
48         dev->data->promiscuous = 0;
49         mlx5_traffic_restart(dev);
50 }
51
52 /**
53  * DPDK callback to enable allmulti mode.
54  *
55  * @param dev
56  *   Pointer to Ethernet device structure.
57  */
58 void
59 mlx5_allmulticast_enable(struct rte_eth_dev *dev)
60 {
61         dev->data->all_multicast = 1;
62         mlx5_traffic_restart(dev);
63 }
64
65 /**
66  * DPDK callback to disable allmulti mode.
67  *
68  * @param dev
69  *   Pointer to Ethernet device structure.
70  */
71 void
72 mlx5_allmulticast_disable(struct rte_eth_dev *dev)
73 {
74         dev->data->all_multicast = 0;
75         mlx5_traffic_restart(dev);
76 }