Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB */
0002 /* Copyright (c) 2020, Mellanox Technologies inc. All rights reserved. */
0003 
0004 #ifndef __MLX5_QOS_H
0005 #define __MLX5_QOS_H
0006 
0007 #include "mlx5_core.h"
0008 
0009 #define MLX5_DEBUG_QOS_MASK BIT(4)
0010 
0011 #define qos_err(mdev, fmt, ...) \
0012     mlx5_core_err(mdev, "QoS: " fmt, ##__VA_ARGS__)
0013 #define qos_warn(mdev, fmt, ...) \
0014     mlx5_core_warn(mdev, "QoS: " fmt, ##__VA_ARGS__)
0015 #define qos_dbg(mdev, fmt, ...) \
0016     mlx5_core_dbg_mask(mdev, MLX5_DEBUG_QOS_MASK, "QoS: " fmt, ##__VA_ARGS__)
0017 
0018 bool mlx5_qos_is_supported(struct mlx5_core_dev *mdev);
0019 int mlx5_qos_max_leaf_nodes(struct mlx5_core_dev *mdev);
0020 
0021 int mlx5_qos_create_leaf_node(struct mlx5_core_dev *mdev, u32 parent_id,
0022                   u32 bw_share, u32 max_avg_bw, u32 *id);
0023 int mlx5_qos_create_inner_node(struct mlx5_core_dev *mdev, u32 parent_id,
0024                    u32 bw_share, u32 max_avg_bw, u32 *id);
0025 int mlx5_qos_create_root_node(struct mlx5_core_dev *mdev, u32 *id);
0026 int mlx5_qos_update_node(struct mlx5_core_dev *mdev, u32 parent_id, u32 bw_share,
0027              u32 max_avg_bw, u32 id);
0028 int mlx5_qos_destroy_node(struct mlx5_core_dev *mdev, u32 id);
0029 
0030 #endif