net/mlx5: add meter operation callback
[dpdk.git] / drivers / net / mlx5 / mlx5_flow_meter.c
1 // SPDX-License-Identifier: BSD-3-Clause
2 /*
3  * Copyright 2018 Mellanox Technologies, Ltd
4  */
5 #include <math.h>
6
7 #include <rte_mtr.h>
8 #include <rte_mtr_driver.h>
9
10 #include "mlx5.h"
11
12 static const struct rte_mtr_ops mlx5_flow_mtr_ops = {
13         .capabilities_get = NULL,
14         .meter_profile_add = NULL,
15         .meter_profile_delete = NULL,
16         .create = NULL,
17         .destroy = NULL,
18         .meter_enable = NULL,
19         .meter_disable = NULL,
20         .meter_profile_update = NULL,
21         .meter_dscp_table_update = NULL,
22         .policer_actions_update = NULL,
23         .stats_update = NULL,
24         .stats_read = NULL,
25 };
26
27 /**
28  * Get meter operations.
29  *
30  * @param dev
31  *   Pointer to Ethernet device structure.
32  * @param arg
33  *   Pointer to set the mtr operations.
34  *
35  * @return
36  *   Always 0.
37  */
38 int
39 mlx5_flow_meter_ops_get(struct rte_eth_dev *dev __rte_unused, void *arg)
40 {
41         *(const struct rte_mtr_ops **)arg = &mlx5_flow_mtr_ops;
42         return 0;
43 }