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_rxfh_fields(struct mlx5e_priv *priv,
15 const struct ethtool_rxfh_fields *nfc,
16 struct netlink_ext_ack *extack);
17 int mlx5e_ethtool_get_rxfh_fields(struct mlx5e_priv *priv,
18 struct ethtool_rxfh_fields *nfc);
19 int mlx5e_ethtool_set_rxnfc(struct mlx5e_priv *priv, struct ethtool_rxnfc *cmd);
20 int mlx5e_ethtool_get_rxnfc(struct mlx5e_priv *priv,
21 struct ethtool_rxnfc *info, u32 *rule_locs);
22 #else
mlx5e_ethtool_alloc(struct mlx5e_ethtool_steering ** ethtool)23 static inline int mlx5e_ethtool_alloc(struct mlx5e_ethtool_steering **ethtool)
24 { return 0; }
mlx5e_ethtool_free(struct mlx5e_ethtool_steering * ethtool)25 static inline void mlx5e_ethtool_free(struct mlx5e_ethtool_steering *ethtool) { }
mlx5e_ethtool_init_steering(struct mlx5e_flow_steering * fs)26 static inline void mlx5e_ethtool_init_steering(struct mlx5e_flow_steering *fs) { }
mlx5e_ethtool_cleanup_steering(struct mlx5e_flow_steering * fs)27 static inline void mlx5e_ethtool_cleanup_steering(struct mlx5e_flow_steering *fs) { }
28 static inline int
mlx5e_ethtool_set_rxfh_fields(struct mlx5e_priv * priv,const struct ethtool_rxfh_fields * nfc,struct netlink_ext_ack * extack)29 mlx5e_ethtool_set_rxfh_fields(struct mlx5e_priv *priv,
30 const struct ethtool_rxfh_fields *nfc,
31 struct netlink_ext_ack *extack)
32 { return -EOPNOTSUPP; }
33 static inline int
mlx5e_ethtool_get_rxfh_fields(struct mlx5e_priv * priv,struct ethtool_rxfh_fields * nfc)34 mlx5e_ethtool_get_rxfh_fields(struct mlx5e_priv *priv,
35 struct ethtool_rxfh_fields *nfc)
36 { return -EOPNOTSUPP; }
mlx5e_ethtool_set_rxnfc(struct mlx5e_priv * priv,struct ethtool_rxnfc * cmd)37 static inline int mlx5e_ethtool_set_rxnfc(struct mlx5e_priv *priv, struct ethtool_rxnfc *cmd)
38 { return -EOPNOTSUPP; }
mlx5e_ethtool_get_rxnfc(struct mlx5e_priv * priv,struct ethtool_rxnfc * info,u32 * rule_locs)39 static inline int mlx5e_ethtool_get_rxnfc(struct mlx5e_priv *priv,
40 struct ethtool_rxnfc *info, u32 *rule_locs)
41 { return -EOPNOTSUPP; }
42 #endif
43 #endif
44