Skip to content

Commit cba38d1

Browse files
Tariq Toukankuba-moo
authored andcommitted
net/mlx5e: Always select CONFIG_PAGE_POOL_STATS
Always set PAGE_POOL_STATS in mlx5 Eth driver. Cleanup the corresponding #ifdefs. Page pool stats are essential to monitor and analyze RX performance. Signed-off-by: Tariq Toukan <tariqt@nvidia.com> Reviewed-by: Gal Pressman <gal@nvidia.com> Link: https://patch.msgid.link/1742412199-159596-4-git-send-email-tariqt@nvidia.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent cac48eb commit cba38d1

File tree

3 files changed

+1
-18
lines changed

3 files changed

+1
-18
lines changed

drivers/net/ethernet/mellanox/mlx5/core/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ config MLX5_CORE_EN
3131
bool "Mellanox 5th generation network adapters (ConnectX series) Ethernet support"
3232
depends on NETDEVICES && ETHERNET && INET && PCI && MLX5_CORE
3333
select PAGE_POOL
34+
select PAGE_POOL_STATS
3435
select DIMLIB
3536
help
3637
Ethernet support in Mellanox Technologies ConnectX-4 NIC.

drivers/net/ethernet/mellanox/mlx5/core/en_stats.c

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,7 @@
3737
#include "en/ptp.h"
3838
#include "en/port.h"
3939

40-
#ifdef CONFIG_PAGE_POOL_STATS
4140
#include <net/page_pool/helpers.h>
42-
#endif
4341

4442
void mlx5e_ethtool_put_stat(u64 **data, u64 val)
4543
{
@@ -196,7 +194,6 @@ static const struct counter_desc sw_stats_desc[] = {
196194
{ MLX5E_DECLARE_STAT(struct mlx5e_sw_stats, rx_arfs_err) },
197195
#endif
198196
{ MLX5E_DECLARE_STAT(struct mlx5e_sw_stats, rx_recover) },
199-
#ifdef CONFIG_PAGE_POOL_STATS
200197
{ MLX5E_DECLARE_STAT(struct mlx5e_sw_stats, rx_pp_alloc_fast) },
201198
{ MLX5E_DECLARE_STAT(struct mlx5e_sw_stats, rx_pp_alloc_slow) },
202199
{ MLX5E_DECLARE_STAT(struct mlx5e_sw_stats, rx_pp_alloc_slow_high_order) },
@@ -208,7 +205,6 @@ static const struct counter_desc sw_stats_desc[] = {
208205
{ MLX5E_DECLARE_STAT(struct mlx5e_sw_stats, rx_pp_recycle_ring) },
209206
{ MLX5E_DECLARE_STAT(struct mlx5e_sw_stats, rx_pp_recycle_ring_full) },
210207
{ MLX5E_DECLARE_STAT(struct mlx5e_sw_stats, rx_pp_recycle_released_ref) },
211-
#endif
212208
#ifdef CONFIG_MLX5_EN_TLS
213209
{ MLX5E_DECLARE_STAT(struct mlx5e_sw_stats, rx_tls_decrypted_packets) },
214210
{ MLX5E_DECLARE_STAT(struct mlx5e_sw_stats, rx_tls_decrypted_bytes) },
@@ -377,7 +373,6 @@ static void mlx5e_stats_grp_sw_update_stats_rq_stats(struct mlx5e_sw_stats *s,
377373
s->rx_arfs_err += rq_stats->arfs_err;
378374
#endif
379375
s->rx_recover += rq_stats->recover;
380-
#ifdef CONFIG_PAGE_POOL_STATS
381376
s->rx_pp_alloc_fast += rq_stats->pp_alloc_fast;
382377
s->rx_pp_alloc_slow += rq_stats->pp_alloc_slow;
383378
s->rx_pp_alloc_empty += rq_stats->pp_alloc_empty;
@@ -389,7 +384,6 @@ static void mlx5e_stats_grp_sw_update_stats_rq_stats(struct mlx5e_sw_stats *s,
389384
s->rx_pp_recycle_ring += rq_stats->pp_recycle_ring;
390385
s->rx_pp_recycle_ring_full += rq_stats->pp_recycle_ring_full;
391386
s->rx_pp_recycle_released_ref += rq_stats->pp_recycle_released_ref;
392-
#endif
393387
#ifdef CONFIG_MLX5_EN_TLS
394388
s->rx_tls_decrypted_packets += rq_stats->tls_decrypted_packets;
395389
s->rx_tls_decrypted_bytes += rq_stats->tls_decrypted_bytes;
@@ -496,7 +490,6 @@ static void mlx5e_stats_grp_sw_update_stats_qos(struct mlx5e_priv *priv,
496490
}
497491
}
498492

499-
#ifdef CONFIG_PAGE_POOL_STATS
500493
static void mlx5e_stats_update_stats_rq_page_pool(struct mlx5e_channel *c)
501494
{
502495
struct mlx5e_rq_stats *rq_stats = c->rq.stats;
@@ -519,11 +512,6 @@ static void mlx5e_stats_update_stats_rq_page_pool(struct mlx5e_channel *c)
519512
rq_stats->pp_recycle_ring_full = stats.recycle_stats.ring_full;
520513
rq_stats->pp_recycle_released_ref = stats.recycle_stats.released_refcnt;
521514
}
522-
#else
523-
static void mlx5e_stats_update_stats_rq_page_pool(struct mlx5e_channel *c)
524-
{
525-
}
526-
#endif
527515

528516
static MLX5E_DECLARE_STATS_GRP_OP_UPDATE_STATS(sw)
529517
{
@@ -2131,7 +2119,6 @@ static const struct counter_desc rq_stats_desc[] = {
21312119
{ MLX5E_DECLARE_RX_STAT(struct mlx5e_rq_stats, arfs_err) },
21322120
#endif
21332121
{ MLX5E_DECLARE_RX_STAT(struct mlx5e_rq_stats, recover) },
2134-
#ifdef CONFIG_PAGE_POOL_STATS
21352122
{ MLX5E_DECLARE_RX_STAT(struct mlx5e_rq_stats, pp_alloc_fast) },
21362123
{ MLX5E_DECLARE_RX_STAT(struct mlx5e_rq_stats, pp_alloc_slow) },
21372124
{ MLX5E_DECLARE_RX_STAT(struct mlx5e_rq_stats, pp_alloc_slow_high_order) },
@@ -2143,7 +2130,6 @@ static const struct counter_desc rq_stats_desc[] = {
21432130
{ MLX5E_DECLARE_RX_STAT(struct mlx5e_rq_stats, pp_recycle_ring) },
21442131
{ MLX5E_DECLARE_RX_STAT(struct mlx5e_rq_stats, pp_recycle_ring_full) },
21452132
{ MLX5E_DECLARE_RX_STAT(struct mlx5e_rq_stats, pp_recycle_released_ref) },
2146-
#endif
21472133
#ifdef CONFIG_MLX5_EN_TLS
21482134
{ MLX5E_DECLARE_RX_STAT(struct mlx5e_rq_stats, tls_decrypted_packets) },
21492135
{ MLX5E_DECLARE_RX_STAT(struct mlx5e_rq_stats, tls_decrypted_bytes) },

drivers/net/ethernet/mellanox/mlx5/core/en_stats.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,6 @@ struct mlx5e_sw_stats {
215215
u64 ch_aff_change;
216216
u64 ch_force_irq;
217217
u64 ch_eq_rearm;
218-
#ifdef CONFIG_PAGE_POOL_STATS
219218
u64 rx_pp_alloc_fast;
220219
u64 rx_pp_alloc_slow;
221220
u64 rx_pp_alloc_slow_high_order;
@@ -227,7 +226,6 @@ struct mlx5e_sw_stats {
227226
u64 rx_pp_recycle_ring;
228227
u64 rx_pp_recycle_ring_full;
229228
u64 rx_pp_recycle_released_ref;
230-
#endif
231229
#ifdef CONFIG_MLX5_EN_TLS
232230
u64 tx_tls_encrypted_packets;
233231
u64 tx_tls_encrypted_bytes;
@@ -385,7 +383,6 @@ struct mlx5e_rq_stats {
385383
u64 arfs_err;
386384
#endif
387385
u64 recover;
388-
#ifdef CONFIG_PAGE_POOL_STATS
389386
u64 pp_alloc_fast;
390387
u64 pp_alloc_slow;
391388
u64 pp_alloc_slow_high_order;
@@ -397,7 +394,6 @@ struct mlx5e_rq_stats {
397394
u64 pp_recycle_ring;
398395
u64 pp_recycle_ring_full;
399396
u64 pp_recycle_released_ref;
400-
#endif
401397
#ifdef CONFIG_MLX5_EN_TLS
402398
u64 tls_decrypted_packets;
403399
u64 tls_decrypted_bytes;

0 commit comments

Comments
 (0)