1 /* SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB */
2 /* Copyright (c) 2022, NVIDIA CORPORATION & AFFILIATES. All rights reserved. */
3 
4 #ifndef __MLX5_LAG_MPESW_H__
5 #define __MLX5_LAG_MPESW_H__
6 
7 #include "lag.h"
8 #include "mlx5_core.h"
9 
10 struct lag_mpesw {
11 	struct work_struct mpesw_work;
12 	atomic_t mpesw_rule_count;
13 };
14 
15 int mlx5_lag_do_mirred(struct mlx5_core_dev *mdev, struct net_device *out_dev);
16 bool mlx5_lag_mpesw_is_activated(struct mlx5_core_dev *dev);
17 #if IS_ENABLED(CONFIG_MLX5_ESWITCH)
18 void mlx5_lag_mpesw_init(struct mlx5_lag *ldev);
19 void mlx5_lag_mpesw_cleanup(struct mlx5_lag *ldev);
20 #else
mlx5_lag_mpesw_init(struct mlx5_lag * ldev)21 static inline void mlx5_lag_mpesw_init(struct mlx5_lag *ldev) {}
mlx5_lag_mpesw_cleanup(struct mlx5_lag * ldev)22 static inline void mlx5_lag_mpesw_cleanup(struct mlx5_lag *ldev) {}
23 #endif
24 
25 #endif /* __MLX5_LAG_MPESW_H__ */
26