diff options
author | Tariq Toukan | 2018-02-07 13:51:45 +0100 |
---|---|---|
committer | Saeed Mahameed | 2018-03-28 02:17:27 +0200 |
commit | 2ccb0a79018c9fafa913654163adc9dbac1280c5 (patch) | |
tree | 8f408c2ac34e69b781f80aed17e43e7bbe611779 /drivers/net/ethernet/mellanox/mlx5/core/en_main.c | |
parent | net/mlx5e: Do not reset Receive Queue params on every type change (diff) | |
download | kernel-qcow2-linux-2ccb0a79018c9fafa913654163adc9dbac1280c5.tar.gz kernel-qcow2-linux-2ccb0a79018c9fafa913654163adc9dbac1280c5.tar.xz kernel-qcow2-linux-2ccb0a79018c9fafa913654163adc9dbac1280c5.zip |
net/mlx5e: Add ethtool priv-flag for Striding RQ
Add a control private flag in ethtool to enable/disable
Striding RQ feature.
Signed-off-by: Tariq Toukan <tariqt@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
Diffstat (limited to 'drivers/net/ethernet/mellanox/mlx5/core/en_main.c')
-rw-r--r-- | drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c index ffe3b2469032..7610a7916e96 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c @@ -71,7 +71,7 @@ struct mlx5e_channel_param { struct mlx5e_cq_param icosq_cq; }; -static bool mlx5e_check_fragmented_striding_rq_cap(struct mlx5_core_dev *mdev) +bool mlx5e_check_fragmented_striding_rq_cap(struct mlx5_core_dev *mdev) { return MLX5_CAP_GEN(mdev, striding_rq) && MLX5_CAP_GEN(mdev, umr_ptr_rlky) && @@ -132,14 +132,17 @@ void mlx5e_init_rq_type_params(struct mlx5_core_dev *mdev, MLX5E_GET_PFLAG(params, MLX5E_PFLAG_RX_CQE_COMPRESS)); } -static bool slow_pci_heuristic(struct mlx5_core_dev *mdev); +bool mlx5e_striding_rq_possible(struct mlx5_core_dev *mdev, + struct mlx5e_params *params) +{ + return mlx5e_check_fragmented_striding_rq_cap(mdev) && + !params->xdp_prog && !MLX5_IPSEC_DEV(mdev); +} -static void mlx5e_set_rq_type(struct mlx5_core_dev *mdev, - struct mlx5e_params *params) +void mlx5e_set_rq_type(struct mlx5_core_dev *mdev, struct mlx5e_params *params) { - params->rq_wq_type = mlx5e_check_fragmented_striding_rq_cap(mdev) && - !slow_pci_heuristic(mdev) && - !params->xdp_prog && !MLX5_IPSEC_DEV(mdev) ? + params->rq_wq_type = mlx5e_striding_rq_possible(mdev, params) && + MLX5E_GET_PFLAG(params, MLX5E_PFLAG_RX_STRIDING_RQ) ? MLX5_WQ_TYPE_LINKED_LIST_STRIDING_RQ : MLX5_WQ_TYPE_LINKED_LIST; } @@ -4027,6 +4030,9 @@ void mlx5e_build_nic_params(struct mlx5_core_dev *mdev, MLX5E_SET_PFLAG(params, MLX5E_PFLAG_RX_CQE_COMPRESS, params->rx_cqe_compress_def); /* RQ */ + if (mlx5e_striding_rq_possible(mdev, params)) + MLX5E_SET_PFLAG(params, MLX5E_PFLAG_RX_STRIDING_RQ, + !slow_pci_heuristic(mdev)); mlx5e_set_rq_type(mdev, params); mlx5e_init_rq_type_params(mdev, params); |