[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240306230439.647123-5-rrameshbabu@nvidia.com>
Date: Wed, 6 Mar 2024 15:04:20 -0800
From: Rahul Rameshbabu <rrameshbabu@...dia.com>
To: netdev@...r.kernel.org
Cc: Gal Pressman <gal@...dia.com>,
Tariq Toukan <tariqt@...dia.com>,
Saeed Mahameed <saeedm@...dia.com>,
Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>,
Eric Dumazet <edumazet@...gle.com>,
"David S. Miller" <davem@...emloft.net>,
"Nabil S . Alramli" <dev@...ramli.com>,
Joe Damato <jdamato@...tly.com>,
Rahul Rameshbabu <rrameshbabu@...dia.com>
Subject: [PATCH RFC 4/6] net/mlx5e: Introduce per-channel coalescing parameters with global coalescing support
Enumerate per-channel coalescing parameters in the global coalescing
reconfiguration path. Add other variables global use_cqe_mode trackers for
Rx and Tx in order to support advertising the global CQE mode set while
also supporting per-channel configuration. The goal is to prepare the
driver to support per-channel coalescing configuration in downstream
patches.
Co-developed-by: Nabil S. Alramli <dev@...ramli.com>
Co-developed-by: Joe Damato <jdamato@...tly.com>
Signed-off-by: Rahul Rameshbabu <rrameshbabu@...dia.com>
Reviewed-by: Tariq Toukan <tariqt@...dia.com>
---
drivers/net/ethernet/mellanox/mlx5/core/en.h | 10 ++++++++++
drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c | 2 ++
2 files changed, 12 insertions(+)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en.h b/drivers/net/ethernet/mellanox/mlx5/core/en.h
index b6b7e02069b8..1ae0d4635d8a 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en.h
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en.h
@@ -753,6 +753,12 @@ enum mlx5e_channel_state {
MLX5E_CHANNEL_NUM_STATES
};
+struct mlx5e_moder {
+ struct dim_cq_moder dim;
+ /* Consumed when dim is not enabled */
+ struct ethtool_coalesce coal_params;
+};
+
struct mlx5e_channel {
/* data path */
struct mlx5e_rq rq;
@@ -794,6 +800,10 @@ struct mlx5e_channel {
int cpu;
/* Sync between icosq recovery and XSK enable/disable. */
struct mutex icosq_recovery_lock;
+
+ /* coalescing configuration */
+ struct mlx5e_moder rx_moder;
+ struct mlx5e_moder tx_moder;
};
struct mlx5e_ptp;
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c b/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c
index 616bfab5b186..b601a7db9672 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c
@@ -570,6 +570,7 @@ mlx5e_set_priv_channels_tx_coalesce(struct mlx5e_priv *priv, struct ethtool_coal
for (i = 0; i < priv->channels.num; ++i) {
struct mlx5e_channel *c = priv->channels.c[i];
+ c->tx_moder.coal_params = *coal;
for (tc = 0; tc < c->num_tc; tc++) {
mlx5_core_modify_cq_moderation(mdev,
&c->sq[tc].cq.mcq,
@@ -588,6 +589,7 @@ mlx5e_set_priv_channels_rx_coalesce(struct mlx5e_priv *priv, struct ethtool_coal
for (i = 0; i < priv->channels.num; ++i) {
struct mlx5e_channel *c = priv->channels.c[i];
+ c->rx_moder.coal_params = *coal;
mlx5_core_modify_cq_moderation(mdev, &c->rq.cq.mcq,
coal->rx_coalesce_usecs,
coal->rx_max_coalesced_frames);
--
2.42.0
Powered by blists - more mailing lists