linux/drivers/net/ethernet/mellanox/mlx5/core/en/qos.h
<<
>>
Prefs
   1/* SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB */
   2/* Copyright (c) 2020, Mellanox Technologies inc. All rights reserved. */
   3
   4#ifndef __MLX5E_EN_QOS_H
   5#define __MLX5E_EN_QOS_H
   6
   7#include <linux/mlx5/driver.h>
   8
   9#define MLX5E_QOS_MAX_LEAF_NODES 256
  10
  11struct mlx5e_priv;
  12struct mlx5e_channels;
  13struct mlx5e_channel;
  14
  15int mlx5e_qos_max_leaf_nodes(struct mlx5_core_dev *mdev);
  16int mlx5e_qos_cur_leaf_nodes(struct mlx5e_priv *priv);
  17
  18/* TX datapath API */
  19int mlx5e_get_txq_by_classid(struct mlx5e_priv *priv, u16 classid);
  20struct mlx5e_txqsq *mlx5e_get_sq(struct mlx5e_priv *priv, int qid);
  21
  22/* SQ lifecycle */
  23int mlx5e_qos_open_queues(struct mlx5e_priv *priv, struct mlx5e_channels *chs);
  24void mlx5e_qos_activate_queues(struct mlx5e_priv *priv);
  25void mlx5e_qos_deactivate_queues(struct mlx5e_channel *c);
  26void mlx5e_qos_close_queues(struct mlx5e_channel *c);
  27
  28/* HTB API */
  29int mlx5e_htb_root_add(struct mlx5e_priv *priv, u16 htb_maj_id, u16 htb_defcls,
  30                       struct netlink_ext_ack *extack);
  31int mlx5e_htb_root_del(struct mlx5e_priv *priv);
  32int mlx5e_htb_leaf_alloc_queue(struct mlx5e_priv *priv, u16 classid,
  33                               u32 parent_classid, u64 rate, u64 ceil,
  34                               struct netlink_ext_ack *extack);
  35int mlx5e_htb_leaf_to_inner(struct mlx5e_priv *priv, u16 classid, u16 child_classid,
  36                            u64 rate, u64 ceil, struct netlink_ext_ack *extack);
  37int mlx5e_htb_leaf_del(struct mlx5e_priv *priv, u16 classid, u16 *old_qid,
  38                       u16 *new_qid, struct netlink_ext_ack *extack);
  39int mlx5e_htb_leaf_del_last(struct mlx5e_priv *priv, u16 classid, bool force,
  40                            struct netlink_ext_ack *extack);
  41int mlx5e_htb_node_modify(struct mlx5e_priv *priv, u16 classid, u64 rate, u64 ceil,
  42                          struct netlink_ext_ack *extack);
  43
  44#endif
  45