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 void mlx5_mpesw_work(struct work_struct *work); 16 int mlx5_lag_do_mirred(struct mlx5_core_dev *mdev, struct net_device *out_dev); 17 bool mlx5_lag_mpesw_is_activated(struct mlx5_core_dev *dev); 18 #if IS_ENABLED(CONFIG_MLX5_ESWITCH) 19 void mlx5_lag_mpesw_init(struct mlx5_lag *ldev); 20 void mlx5_lag_mpesw_cleanup(struct mlx5_lag *ldev); 21 #else 22 static inline void mlx5_lag_mpesw_init(struct mlx5_lag *ldev) {} 23 static inline void mlx5_lag_mpesw_cleanup(struct mlx5_lag *ldev) {} 24 #endif 25 26 #endif /* __MLX5_LAG_MPESW_H__ */ 27