Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB */
0002 /* Copyright (c) 2022, NVIDIA CORPORATION & AFFILIATES. All rights reserved. */
0003 
0004 #ifndef __MLX5E_EN_HTB_H_
0005 #define __MLX5E_EN_HTB_H_
0006 
0007 #include "qos.h"
0008 
0009 #define MLX5E_QOS_MAX_LEAF_NODES 256
0010 
0011 struct mlx5e_selq;
0012 struct mlx5e_htb;
0013 
0014 typedef int (*mlx5e_fp_htb_enumerate)(void *data, u16 qid, u32 hw_id);
0015 int mlx5e_htb_enumerate_leaves(struct mlx5e_htb *htb, mlx5e_fp_htb_enumerate callback, void *data);
0016 
0017 int mlx5e_htb_cur_leaf_nodes(struct mlx5e_htb *htb);
0018 
0019 /* TX datapath API */
0020 int mlx5e_htb_get_txq_by_classid(struct mlx5e_htb *htb, u16 classid);
0021 
0022 /* HTB TC handlers */
0023 
0024 int
0025 mlx5e_htb_leaf_alloc_queue(struct mlx5e_htb *htb, u16 classid,
0026                u32 parent_classid, u64 rate, u64 ceil,
0027                struct netlink_ext_ack *extack);
0028 int
0029 mlx5e_htb_leaf_to_inner(struct mlx5e_htb *htb, u16 classid, u16 child_classid,
0030             u64 rate, u64 ceil, struct netlink_ext_ack *extack);
0031 int mlx5e_htb_leaf_del(struct mlx5e_htb *htb, u16 *classid,
0032                struct netlink_ext_ack *extack);
0033 int
0034 mlx5e_htb_leaf_del_last(struct mlx5e_htb *htb, u16 classid, bool force,
0035             struct netlink_ext_ack *extack);
0036 int
0037 mlx5e_htb_node_modify(struct mlx5e_htb *htb, u16 classid, u64 rate, u64 ceil,
0038               struct netlink_ext_ack *extack);
0039 struct mlx5e_htb *mlx5e_htb_alloc(void);
0040 void mlx5e_htb_free(struct mlx5e_htb *htb);
0041 int mlx5e_htb_init(struct mlx5e_htb *htb, struct tc_htb_qopt_offload *htb_qopt,
0042            struct net_device *netdev, struct mlx5_core_dev *mdev,
0043            struct mlx5e_selq *selq, struct mlx5e_priv *priv);
0044 void mlx5e_htb_cleanup(struct mlx5e_htb *htb);
0045 #endif
0046