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 u32 pf_metadata[MLX5_MAX_PORTS]; 13 }; 14 15 enum mpesw_op { 16 MLX5_MPESW_OP_ENABLE, 17 MLX5_MPESW_OP_DISABLE, 18 }; 19 20 struct mlx5_mpesw_work_st { 21 struct work_struct work; 22 struct mlx5_lag *lag; 23 enum mpesw_op op; 24 struct completion comp; 25 int result; 26 }; 27 28 int mlx5_lag_mpesw_do_mirred(struct mlx5_core_dev *mdev, 29 struct net_device *out_dev, 30 struct netlink_ext_ack *extack); 31 bool mlx5_lag_is_mpesw(struct mlx5_core_dev *dev); 32 void mlx5_lag_mpesw_disable(struct mlx5_core_dev *dev); 33 int mlx5_lag_mpesw_enable(struct mlx5_core_dev *dev); 34 35 #endif /* __MLX5_LAG_MPESW_H__ */ 36