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
7struct mlx5e_priv;
8struct mlx5e_ethtool_steering;
9#ifdef CONFIG_MLX5_EN_RXNFC
10int mlx5e_ethtool_alloc(struct mlx5e_ethtool_steering **ethtool);
11void mlx5e_ethtool_free(struct mlx5e_ethtool_steering *ethtool);
12void mlx5e_ethtool_init_steering(struct mlx5e_flow_steering *fs);
13void mlx5e_ethtool_cleanup_steering(struct mlx5e_flow_steering *fs);
14int mlx5e_ethtool_set_rxnfc(struct mlx5e_priv *priv, struct ethtool_rxnfc *cmd);
15int mlx5e_ethtool_get_rxnfc(struct mlx5e_priv *priv,
16			    struct ethtool_rxnfc *info, u32 *rule_locs);
17#else
18static inline int mlx5e_ethtool_alloc(struct mlx5e_ethtool_steering **ethtool)
19{ return 0; }
20static inline void mlx5e_ethtool_free(struct mlx5e_ethtool_steering *ethtool) { }
21static inline void mlx5e_ethtool_init_steering(struct mlx5e_flow_steering *fs) { }
22static inline void mlx5e_ethtool_cleanup_steering(struct mlx5e_flow_steering *fs) { }
23static inline int mlx5e_ethtool_set_rxnfc(struct mlx5e_priv *priv, struct ethtool_rxnfc *cmd)
24{ return -EOPNOTSUPP; }
25static 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