diff options
author | Saeed Mahameed | 2018-07-12 12:01:26 +0200 |
---|---|---|
committer | Saeed Mahameed | 2018-08-13 21:50:17 +0200 |
commit | ec080045977073c5e69a7fddee3a8aef9bf62881 (patch) | |
tree | 126d3bb094a79c08adf2090dd2d7e05c5c596fbe /drivers/net/ethernet/mellanox/mlx5/core/en.h | |
parent | net/mlx5e: Add CONFIG_MLX5_EN_RXNFC for ethtool rx nfc (diff) | |
download | kernel-qcow2-linux-ec080045977073c5e69a7fddee3a8aef9bf62881.tar.gz kernel-qcow2-linux-ec080045977073c5e69a7fddee3a8aef9bf62881.tar.xz kernel-qcow2-linux-ec080045977073c5e69a7fddee3a8aef9bf62881.zip |
net/mlx5e: Add CONFIG_MLX5_EN_ARFS for accelerated flow steering support
Add new mlx5 Kconfig flag to allow selecting accelerated flow steering
support, and compile out en_arfs.c if not selected.
Move arfs declarations and definitions to en/fs.h header file.
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
Reviewed-by: Moshe Shemesh <moshe@mellanox.com>
Diffstat (limited to 'drivers/net/ethernet/mellanox/mlx5/core/en.h')
-rw-r--r-- | drivers/net/ethernet/mellanox/mlx5/core/en.h | 61 |
1 files changed, 4 insertions, 57 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en.h b/drivers/net/ethernet/mellanox/mlx5/core/en.h index 19728f9f25e7..8743bbe1baa2 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en.h +++ b/drivers/net/ethernet/mellanox/mlx5/core/en.h @@ -660,12 +660,6 @@ struct mlx5e_l2_rule { struct mlx5_flow_handle *rule; }; -struct mlx5e_flow_table { - int num_groups; - struct mlx5_flow_table *t; - struct mlx5_flow_group **g; -}; - #define MLX5E_L2_ADDR_HASH_SIZE BIT(BITS_PER_BYTE) struct mlx5e_tc_table { @@ -708,38 +702,15 @@ struct mlx5e_ttc_table { struct mlx5_flow_handle *tunnel_rules[MLX5E_NUM_TUNNEL_TT]; }; -#define ARFS_HASH_SHIFT BITS_PER_BYTE -#define ARFS_HASH_SIZE BIT(BITS_PER_BYTE) -struct arfs_table { - struct mlx5e_flow_table ft; - struct mlx5_flow_handle *default_rule; - struct hlist_head rules_hash[ARFS_HASH_SIZE]; -}; - -enum arfs_type { - ARFS_IPV4_TCP, - ARFS_IPV6_TCP, - ARFS_IPV4_UDP, - ARFS_IPV6_UDP, - ARFS_NUM_TYPES, -}; - -struct mlx5e_arfs_tables { - struct arfs_table arfs_tables[ARFS_NUM_TYPES]; - /* Protect aRFS rules list */ - spinlock_t arfs_lock; - struct list_head rules; - int last_filter_id; - struct workqueue_struct *wq; -}; - /* NIC prio FTS */ enum { MLX5E_VLAN_FT_LEVEL = 0, MLX5E_L2_FT_LEVEL, MLX5E_TTC_FT_LEVEL, MLX5E_INNER_TTC_FT_LEVEL, +#ifdef CONFIG_MLX5_EN_ARFS MLX5E_ARFS_FT_LEVEL +#endif }; enum { @@ -757,7 +728,9 @@ struct mlx5e_flow_steering { struct mlx5e_l2_table l2; struct mlx5e_ttc_table ttc; struct mlx5e_ttc_table inner_ttc; +#ifdef CONFIG_MLX5_EN_ARFS struct mlx5e_arfs_tables arfs; +#endif }; struct mlx5e_rqt { @@ -1028,32 +1001,6 @@ void mlx5e_dcbnl_init_app(struct mlx5e_priv *priv); void mlx5e_dcbnl_delete_app(struct mlx5e_priv *priv); #endif -#ifndef CONFIG_RFS_ACCEL -static inline int mlx5e_arfs_create_tables(struct mlx5e_priv *priv) -{ - return 0; -} - -static inline void mlx5e_arfs_destroy_tables(struct mlx5e_priv *priv) {} - -static inline int mlx5e_arfs_enable(struct mlx5e_priv *priv) -{ - return -EOPNOTSUPP; -} - -static inline int mlx5e_arfs_disable(struct mlx5e_priv *priv) -{ - return -EOPNOTSUPP; -} -#else -int mlx5e_arfs_create_tables(struct mlx5e_priv *priv); -void mlx5e_arfs_destroy_tables(struct mlx5e_priv *priv); -int mlx5e_arfs_enable(struct mlx5e_priv *priv); -int mlx5e_arfs_disable(struct mlx5e_priv *priv); -int mlx5e_rx_flow_steer(struct net_device *dev, const struct sk_buff *skb, - u16 rxq_index, u32 flow_id); -#endif - int mlx5e_create_tir(struct mlx5_core_dev *mdev, struct mlx5e_tir *tir, u32 *in, int inlen); void mlx5e_destroy_tir(struct mlx5_core_dev *mdev, |