1/* SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB */ 2/* Copyright (c) 2019 Mellanox Technologies. */ 3 4#ifndef __MLX5_LAG_MP_H__ 5#define __MLX5_LAG_MP_H__ 6 7#include "lag.h" 8#include "mlx5_core.h" 9 10enum mlx5_lag_port_affinity { 11 MLX5_LAG_NORMAL_AFFINITY, 12 MLX5_LAG_P1_AFFINITY, 13 MLX5_LAG_P2_AFFINITY, 14}; 15 16struct lag_mp { 17 struct notifier_block fib_nb; 18 struct fib_info *mfi; /* used in tracking fib events */ 19 struct workqueue_struct *wq; 20}; 21 22#ifdef CONFIG_MLX5_ESWITCH 23 24void mlx5_lag_mp_reset(struct mlx5_lag *ldev); 25int mlx5_lag_mp_init(struct mlx5_lag *ldev); 26void mlx5_lag_mp_cleanup(struct mlx5_lag *ldev); 27bool mlx5_lag_is_multipath(struct mlx5_core_dev *dev); 28 29#else /* CONFIG_MLX5_ESWITCH */ 30 31static inline void mlx5_lag_mp_reset(struct mlx5_lag *ldev) {}; 32static inline int mlx5_lag_mp_init(struct mlx5_lag *ldev) { return 0; } 33static inline void mlx5_lag_mp_cleanup(struct mlx5_lag *ldev) {} 34bool mlx5_lag_is_multipath(struct mlx5_core_dev *dev) { return false; } 35 36#endif /* CONFIG_MLX5_ESWITCH */ 37#endif /* __MLX5_LAG_MP_H__ */ 38