2648c23e82387f6d7e4b531e2a16a2750478dae0
[linux-2.6-microblaze.git] / drivers / net / ethernet / mellanox / mlx5 / core / en / selq.h
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
20 int mlx5e_selq_init(struct mlx5e_selq *selq, struct mutex *state_lock);
21 void mlx5e_selq_cleanup(struct mlx5e_selq *selq);
22 void mlx5e_selq_prepare(struct mlx5e_selq *selq, struct mlx5e_params *params, bool htb);
23 void mlx5e_selq_apply(struct mlx5e_selq *selq);
24 void mlx5e_selq_cancel(struct mlx5e_selq *selq);
25
26 #endif /* __MLX5_EN_SELQ_H__ */