Commit ffdb8827 authored by Erez Shitrit's avatar Erez Shitrit Committed by David S. Miller

net/mlx5: Enable flow-steering for IB link

Get the relevant capabilities if supports ipoib_enhanced_offloads and
init the flow steering table accordingly.
Signed-off-by: default avatarErez Shitrit <erezsh@mellanox.com>
Signed-off-by: default avatarSaeed Mahameed <saeedm@mellanox.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent b3ba5149
...@@ -1905,9 +1905,6 @@ void mlx5_cleanup_fs(struct mlx5_core_dev *dev) ...@@ -1905,9 +1905,6 @@ void mlx5_cleanup_fs(struct mlx5_core_dev *dev)
{ {
struct mlx5_flow_steering *steering = dev->priv.steering; struct mlx5_flow_steering *steering = dev->priv.steering;
if (MLX5_CAP_GEN(dev, port_type) != MLX5_CAP_PORT_TYPE_ETH)
return;
cleanup_root_ns(steering->root_ns); cleanup_root_ns(steering->root_ns);
cleanup_root_ns(steering->esw_egress_root_ns); cleanup_root_ns(steering->esw_egress_root_ns);
cleanup_root_ns(steering->esw_ingress_root_ns); cleanup_root_ns(steering->esw_ingress_root_ns);
...@@ -2010,9 +2007,6 @@ int mlx5_init_fs(struct mlx5_core_dev *dev) ...@@ -2010,9 +2007,6 @@ int mlx5_init_fs(struct mlx5_core_dev *dev)
struct mlx5_flow_steering *steering; struct mlx5_flow_steering *steering;
int err = 0; int err = 0;
if (MLX5_CAP_GEN(dev, port_type) != MLX5_CAP_PORT_TYPE_ETH)
return 0;
err = mlx5_init_fc_stats(dev); err = mlx5_init_fc_stats(dev);
if (err) if (err)
return err; return err;
...@@ -2023,7 +2017,10 @@ int mlx5_init_fs(struct mlx5_core_dev *dev) ...@@ -2023,7 +2017,10 @@ int mlx5_init_fs(struct mlx5_core_dev *dev)
steering->dev = dev; steering->dev = dev;
dev->priv.steering = steering; dev->priv.steering = steering;
if (MLX5_CAP_GEN(dev, nic_flow_table) && if ((((MLX5_CAP_GEN(dev, port_type) == MLX5_CAP_PORT_TYPE_ETH) &&
(MLX5_CAP_GEN(dev, nic_flow_table))) ||
((MLX5_CAP_GEN(dev, port_type) == MLX5_CAP_PORT_TYPE_IB) &&
MLX5_CAP_GEN(dev, ipoib_enhanced_offloads))) &&
MLX5_CAP_FLOWTABLE_NIC_RX(dev, ft_support)) { MLX5_CAP_FLOWTABLE_NIC_RX(dev, ft_support)) {
err = init_root_ns(steering); err = init_root_ns(steering);
if (err) if (err)
......
...@@ -137,7 +137,8 @@ int mlx5_query_hca_caps(struct mlx5_core_dev *dev) ...@@ -137,7 +137,8 @@ int mlx5_query_hca_caps(struct mlx5_core_dev *dev)
return err; return err;
} }
if (MLX5_CAP_GEN(dev, nic_flow_table)) { if (MLX5_CAP_GEN(dev, nic_flow_table) ||
MLX5_CAP_GEN(dev, ipoib_enhanced_offloads)) {
err = mlx5_core_get_caps(dev, MLX5_CAP_FLOW_TABLE); err = mlx5_core_get_caps(dev, MLX5_CAP_FLOW_TABLE);
if (err) if (err)
return err; return err;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment