1 /* SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB */
2 /* Copyright (c) 2021, NVIDIA CORPORATION & AFFILIATES. All rights reserved. */
3 
4 #ifndef __MLX5_EN_SELQ_H__
5 #define __MLX5_EN_SELQ_H__
6 
7 #include <linux/kernel.h>
8 
9 struct mlx5e_selq_params;
10 
11 struct mlx5e_selq {
12 	struct mlx5e_selq_params __rcu *active;
13 	struct mlx5e_selq_params *standby;
14 	struct mutex *state_lock; /* points to priv->state_lock */
15 	bool is_prepared;
16 };
17 
18 struct mlx5e_params;
19 struct net_device;
20 struct sk_buff;
21 
22 int mlx5e_selq_init(struct mlx5e_selq *selq, struct mutex *state_lock);
23 void mlx5e_selq_cleanup(struct mlx5e_selq *selq);
24 void mlx5e_selq_prepare(struct mlx5e_selq *selq, struct mlx5e_params *params, bool htb);
25 void mlx5e_selq_apply(struct mlx5e_selq *selq);
26 void mlx5e_selq_cancel(struct mlx5e_selq *selq);
27 
28 u16 mlx5e_select_queue(struct net_device *dev, struct sk_buff *skb,
29 		       struct net_device *sb_dev);
30 
31 #endif /* __MLX5_EN_SELQ_H__ */
32