mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-27 17:11:46 +00:00
net/mlx5e: Change VF representors' RQ type
The representors' RQ size was not large enough for them to achieve high enough performance, and therefore needed to be enlarged, while suffering a minimum hit to its memory usage. To achieve this the representors RQ size was increased, and its type was changed to be a striding RQ if it is supported. Towards that goal the following changes were made: * Extracted the sequence for setting the standard netdev's RQ parmas into a function * Replaced the sequence for setting the representor's RQ params with the standard sequence The impact of this change can be seen in the following measurements taken on a setup of a VM over a VF, connected to OVS via the VF representor, to an external host: Before current change: TCP Throughput [Gb/s] VM to external host ~ 7.2 With the current change (measured with a striding RQ): TCP Throughput [Gb/s] VM to external host ~ 23.5 Each representor now consumes 2 [MB] of memory for its packet buffers. Signed-off-by: Gavi Teitz <gavi@mellanox.com> Reviewed-by: Or Gerlitz <ogerlitz@mellanox.com> Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
This commit is contained in:
parent
3a95e0ccaf
commit
749359f4aa
3 changed files with 25 additions and 18 deletions
|
@ -966,6 +966,8 @@ void mlx5e_destroy_netdev(struct mlx5e_priv *priv);
|
||||||
void mlx5e_build_nic_params(struct mlx5_core_dev *mdev,
|
void mlx5e_build_nic_params(struct mlx5_core_dev *mdev,
|
||||||
struct mlx5e_params *params,
|
struct mlx5e_params *params,
|
||||||
u16 max_channels, u16 mtu);
|
u16 max_channels, u16 mtu);
|
||||||
|
void mlx5e_build_rq_params(struct mlx5_core_dev *mdev,
|
||||||
|
struct mlx5e_params *params);
|
||||||
u8 mlx5e_params_calculate_tx_min_inline(struct mlx5_core_dev *mdev);
|
u8 mlx5e_params_calculate_tx_min_inline(struct mlx5_core_dev *mdev);
|
||||||
void mlx5e_rx_dim_work(struct work_struct *work);
|
void mlx5e_rx_dim_work(struct work_struct *work);
|
||||||
void mlx5e_tx_dim_work(struct work_struct *work);
|
void mlx5e_tx_dim_work(struct work_struct *work);
|
||||||
|
|
|
@ -4480,6 +4480,23 @@ static u32 mlx5e_choose_lro_timeout(struct mlx5_core_dev *mdev, u32 wanted_timeo
|
||||||
return MLX5_CAP_ETH(mdev, lro_timer_supported_periods[i]);
|
return MLX5_CAP_ETH(mdev, lro_timer_supported_periods[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void mlx5e_build_rq_params(struct mlx5_core_dev *mdev,
|
||||||
|
struct mlx5e_params *params)
|
||||||
|
{
|
||||||
|
/* Prefer Striding RQ, unless any of the following holds:
|
||||||
|
* - Striding RQ configuration is not possible/supported.
|
||||||
|
* - Slow PCI heuristic.
|
||||||
|
* - Legacy RQ would use linear SKB while Striding RQ would use non-linear.
|
||||||
|
*/
|
||||||
|
if (!slow_pci_heuristic(mdev) &&
|
||||||
|
mlx5e_striding_rq_possible(mdev, params) &&
|
||||||
|
(mlx5e_rx_mpwqe_is_linear_skb(mdev, params) ||
|
||||||
|
!mlx5e_rx_is_linear_skb(mdev, params)))
|
||||||
|
MLX5E_SET_PFLAG(params, MLX5E_PFLAG_RX_STRIDING_RQ, true);
|
||||||
|
mlx5e_set_rq_type(mdev, params);
|
||||||
|
mlx5e_init_rq_type_params(mdev, params);
|
||||||
|
}
|
||||||
|
|
||||||
void mlx5e_build_nic_params(struct mlx5_core_dev *mdev,
|
void mlx5e_build_nic_params(struct mlx5_core_dev *mdev,
|
||||||
struct mlx5e_params *params,
|
struct mlx5e_params *params,
|
||||||
u16 max_channels, u16 mtu)
|
u16 max_channels, u16 mtu)
|
||||||
|
@ -4505,18 +4522,7 @@ void mlx5e_build_nic_params(struct mlx5_core_dev *mdev,
|
||||||
MLX5E_SET_PFLAG(params, MLX5E_PFLAG_RX_CQE_COMPRESS, params->rx_cqe_compress_def);
|
MLX5E_SET_PFLAG(params, MLX5E_PFLAG_RX_CQE_COMPRESS, params->rx_cqe_compress_def);
|
||||||
|
|
||||||
/* RQ */
|
/* RQ */
|
||||||
/* Prefer Striding RQ, unless any of the following holds:
|
mlx5e_build_rq_params(mdev, params);
|
||||||
* - Striding RQ configuration is not possible/supported.
|
|
||||||
* - Slow PCI heuristic.
|
|
||||||
* - Legacy RQ would use linear SKB while Striding RQ would use non-linear.
|
|
||||||
*/
|
|
||||||
if (!slow_pci_heuristic(mdev) &&
|
|
||||||
mlx5e_striding_rq_possible(mdev, params) &&
|
|
||||||
(mlx5e_rx_mpwqe_is_linear_skb(mdev, params) ||
|
|
||||||
!mlx5e_rx_is_linear_skb(mdev, params)))
|
|
||||||
MLX5E_SET_PFLAG(params, MLX5E_PFLAG_RX_STRIDING_RQ, true);
|
|
||||||
mlx5e_set_rq_type(mdev, params);
|
|
||||||
mlx5e_init_rq_type_params(mdev, params);
|
|
||||||
|
|
||||||
/* HW LRO */
|
/* HW LRO */
|
||||||
|
|
||||||
|
|
|
@ -46,8 +46,6 @@
|
||||||
|
|
||||||
#define MLX5E_REP_PARAMS_LOG_SQ_SIZE \
|
#define MLX5E_REP_PARAMS_LOG_SQ_SIZE \
|
||||||
max(0x6, MLX5E_PARAMS_MINIMUM_LOG_SQ_SIZE)
|
max(0x6, MLX5E_PARAMS_MINIMUM_LOG_SQ_SIZE)
|
||||||
#define MLX5E_REP_PARAMS_LOG_RQ_SIZE \
|
|
||||||
max(0x6, MLX5E_PARAMS_MINIMUM_LOG_RQ_SIZE)
|
|
||||||
|
|
||||||
static const char mlx5e_rep_driver_name[] = "mlx5e_rep";
|
static const char mlx5e_rep_driver_name[] = "mlx5e_rep";
|
||||||
|
|
||||||
|
@ -934,14 +932,15 @@ static void mlx5e_build_rep_params(struct mlx5_core_dev *mdev,
|
||||||
params->hard_mtu = MLX5E_ETH_HARD_MTU;
|
params->hard_mtu = MLX5E_ETH_HARD_MTU;
|
||||||
params->sw_mtu = mtu;
|
params->sw_mtu = mtu;
|
||||||
params->log_sq_size = MLX5E_REP_PARAMS_LOG_SQ_SIZE;
|
params->log_sq_size = MLX5E_REP_PARAMS_LOG_SQ_SIZE;
|
||||||
params->rq_wq_type = MLX5_WQ_TYPE_CYCLIC;
|
|
||||||
params->log_rq_mtu_frames = MLX5E_REP_PARAMS_LOG_RQ_SIZE;
|
|
||||||
|
|
||||||
|
/* RQ */
|
||||||
|
mlx5e_build_rq_params(mdev, params);
|
||||||
|
|
||||||
|
/* CQ moderation params */
|
||||||
params->rx_dim_enabled = MLX5_CAP_GEN(mdev, cq_moderation);
|
params->rx_dim_enabled = MLX5_CAP_GEN(mdev, cq_moderation);
|
||||||
mlx5e_set_rx_cq_mode_params(params, cq_period_mode);
|
mlx5e_set_rx_cq_mode_params(params, cq_period_mode);
|
||||||
|
|
||||||
params->num_tc = 1;
|
params->num_tc = 1;
|
||||||
params->lro_wqe_sz = MLX5E_PARAMS_DEFAULT_LRO_WQE_SZ;
|
|
||||||
|
|
||||||
mlx5_query_min_inline(mdev, ¶ms->tx_min_inline_mode);
|
mlx5_query_min_inline(mdev, ¶ms->tx_min_inline_mode);
|
||||||
}
|
}
|
||||||
|
@ -1077,7 +1076,7 @@ static const struct mlx5e_profile mlx5e_rep_profile = {
|
||||||
.max_nch = mlx5e_get_rep_max_num_channels,
|
.max_nch = mlx5e_get_rep_max_num_channels,
|
||||||
.update_carrier = NULL,
|
.update_carrier = NULL,
|
||||||
.rx_handlers.handle_rx_cqe = mlx5e_handle_rx_cqe_rep,
|
.rx_handlers.handle_rx_cqe = mlx5e_handle_rx_cqe_rep,
|
||||||
.rx_handlers.handle_rx_cqe_mpwqe = NULL /* Not supported */,
|
.rx_handlers.handle_rx_cqe_mpwqe = mlx5e_handle_rx_cqe_mpwrq,
|
||||||
.max_tc = 1,
|
.max_tc = 1,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue