1 /* SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB */
2 /* Copyright (c) 2022, NVIDIA CORPORATION & AFFILIATES. */
3 
4 #ifndef __MLX5E_FS_ETHTOOL_H__
5 #define __MLX5E_FS_ETHTOOL_H__
6 
7 struct mlx5e_priv;
8 struct mlx5e_ethtool_steering;
9 #ifdef CONFIG_MLX5_EN_RXNFC
10 int mlx5e_ethtool_alloc(struct mlx5e_ethtool_steering **ethtool);
11 void mlx5e_ethtool_free(struct mlx5e_ethtool_steering *ethtool);
12 void mlx5e_ethtool_init_steering(struct mlx5e_flow_steering *fs);
13 void mlx5e_ethtool_cleanup_steering(struct mlx5e_flow_steering *fs);
14 int mlx5e_ethtool_set_rxnfc(struct mlx5e_priv *priv, struct ethtool_rxnfc *cmd);
15 int mlx5e_ethtool_get_rxnfc(struct mlx5e_priv *priv,
16 			    struct ethtool_rxnfc *info, u32 *rule_locs);
17 #else
mlx5e_ethtool_alloc(struct mlx5e_ethtool_steering ** ethtool)18 static inline int mlx5e_ethtool_alloc(struct mlx5e_ethtool_steering **ethtool)
19 { return 0; }
mlx5e_ethtool_free(struct mlx5e_ethtool_steering * ethtool)20 static inline void mlx5e_ethtool_free(struct mlx5e_ethtool_steering *ethtool) { }
mlx5e_ethtool_init_steering(struct mlx5e_flow_steering * fs)21 static inline void mlx5e_ethtool_init_steering(struct mlx5e_flow_steering *fs) { }
mlx5e_ethtool_cleanup_steering(struct mlx5e_flow_steering * fs)22 static inline void mlx5e_ethtool_cleanup_steering(struct mlx5e_flow_steering *fs) { }
mlx5e_ethtool_set_rxnfc(struct mlx5e_priv * priv,struct ethtool_rxnfc * cmd)23 static inline int mlx5e_ethtool_set_rxnfc(struct mlx5e_priv *priv, struct ethtool_rxnfc *cmd)
24 { return -EOPNOTSUPP; }
mlx5e_ethtool_get_rxnfc(struct mlx5e_priv * priv,struct ethtool_rxnfc * info,u32 * rule_locs)25 static inline int mlx5e_ethtool_get_rxnfc(struct mlx5e_priv *priv,
26 					  struct ethtool_rxnfc *info, u32 *rule_locs)
27 { return -EOPNOTSUPP; }
28 #endif
29 #endif
30