1 /* SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB */
2 /* Copyright (c) 2021, NVIDIA CORPORATION & AFFILIATES. All rights reserved. */
3 
4 #ifndef __MLX5_ESW_QOS_H__
5 #define __MLX5_ESW_QOS_H__
6 
7 #ifdef CONFIG_MLX5_ESWITCH
8 
9 int mlx5_esw_qos_set_vport_rate(struct mlx5_eswitch *esw, struct mlx5_vport *evport,
10 				u32 max_rate, u32 min_rate);
11 void mlx5_esw_qos_vport_disable(struct mlx5_eswitch *esw, struct mlx5_vport *vport);
12 
13 int mlx5_esw_devlink_rate_leaf_tx_share_set(struct devlink_rate *rate_leaf, void *priv,
14 					    u64 tx_share, struct netlink_ext_ack *extack);
15 int mlx5_esw_devlink_rate_leaf_tx_max_set(struct devlink_rate *rate_leaf, void *priv,
16 					  u64 tx_max, struct netlink_ext_ack *extack);
17 int mlx5_esw_devlink_rate_node_tx_share_set(struct devlink_rate *rate_node, void *priv,
18 					    u64 tx_share, struct netlink_ext_ack *extack);
19 int mlx5_esw_devlink_rate_node_tx_max_set(struct devlink_rate *rate_node, void *priv,
20 					  u64 tx_max, struct netlink_ext_ack *extack);
21 int mlx5_esw_devlink_rate_node_new(struct devlink_rate *rate_node, void **priv,
22 				   struct netlink_ext_ack *extack);
23 int mlx5_esw_devlink_rate_node_del(struct devlink_rate *rate_node, void *priv,
24 				   struct netlink_ext_ack *extack);
25 int mlx5_esw_devlink_rate_parent_set(struct devlink_rate *devlink_rate,
26 				     struct devlink_rate *parent,
27 				     void *priv, void *parent_priv,
28 				     struct netlink_ext_ack *extack);
29 #endif
30 
31 #endif
32