Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'mlx5-cleanups-2025-03-19'

Tariq Toukan says:

====================
mlx5 cleanups 2025-03-19

This series contains small cleanups to the mlx5 core and Eth drivers.
====================

Link: https://patch.msgid.link/1742412199-159596-1-git-send-email-tariqt@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

+10 -34
+1
drivers/net/ethernet/mellanox/mlx5/core/Kconfig
··· 31 31 bool "Mellanox 5th generation network adapters (ConnectX series) Ethernet support" 32 32 depends on NETDEVICES && ETHERNET && INET && PCI && MLX5_CORE 33 33 select PAGE_POOL 34 + select PAGE_POOL_STATS 34 35 select DIMLIB 35 36 help 36 37 Ethernet support in Mellanox Technologies ConnectX-4 NIC.
+3 -6
drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun.c
··· 31 31 { 32 32 if (attr->n) 33 33 neigh_release(attr->n); 34 - if (attr->route_dev) 35 - dev_put(attr->route_dev); 34 + dev_put(attr->route_dev); 36 35 } 37 36 38 37 struct mlx5e_tc_tunnel *mlx5e_get_tc_tun(struct net_device *tunnel_dev) ··· 67 68 * while holding rcu read lock. Take the net_device for correctness 68 69 * sake. 69 70 */ 70 - if (uplink_upper) 71 - dev_hold(uplink_upper); 71 + dev_hold(uplink_upper); 72 72 rcu_read_unlock(); 73 73 74 74 dst_is_lag_dev = (uplink_upper && 75 75 netif_is_lag_master(uplink_upper) && 76 76 real_dev == uplink_upper && 77 77 mlx5_lag_is_sriov(priv->mdev)); 78 - if (uplink_upper) 79 - dev_put(uplink_upper); 78 + dev_put(uplink_upper); 80 79 81 80 /* if the egress device isn't on the same HW e-switch or 82 81 * it's a LAG device, use the uplink
+3 -6
drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun_encap.c
··· 42 42 &attr->action, out_index); 43 43 44 44 out: 45 - if (route_dev) 46 - dev_put(route_dev); 45 + dev_put(route_dev); 47 46 48 47 return err; 49 48 } ··· 752 753 } 753 754 754 755 out: 755 - if (route_dev) 756 - dev_put(route_dev); 756 + dev_put(route_dev); 757 757 return err; 758 758 } 759 759 ··· 786 788 mlx5e_tc_match_to_reg_mod_hdr_change(esw->dev, mod_hdr_acts, VPORT_TO_REG, act_id, data); 787 789 788 790 out: 789 - if (route_dev) 790 - dev_put(route_dev); 791 + dev_put(route_dev); 791 792 return err; 792 793 } 793 794
+2 -2
drivers/net/ethernet/mellanox/mlx5/core/en_main.c
··· 359 359 return 0; 360 360 361 361 err_nomem: 362 - kvfree(shampo->bitmap); 362 + bitmap_free(shampo->bitmap); 363 363 kvfree(shampo->pages); 364 364 365 365 return -ENOMEM; ··· 367 367 368 368 static void mlx5e_rq_shampo_hd_info_free(struct mlx5e_rq *rq) 369 369 { 370 - kvfree(rq->mpwqe.shampo->bitmap); 370 + bitmap_free(rq->mpwqe.shampo->bitmap); 371 371 kvfree(rq->mpwqe.shampo->pages); 372 372 } 373 373
-14
drivers/net/ethernet/mellanox/mlx5/core/en_stats.c
··· 37 37 #include "en/ptp.h" 38 38 #include "en/port.h" 39 39 40 - #ifdef CONFIG_PAGE_POOL_STATS 41 40 #include <net/page_pool/helpers.h> 42 - #endif 43 41 44 42 void mlx5e_ethtool_put_stat(u64 **data, u64 val) 45 43 { ··· 194 196 { MLX5E_DECLARE_STAT(struct mlx5e_sw_stats, rx_arfs_err) }, 195 197 #endif 196 198 { MLX5E_DECLARE_STAT(struct mlx5e_sw_stats, rx_recover) }, 197 - #ifdef CONFIG_PAGE_POOL_STATS 198 199 { MLX5E_DECLARE_STAT(struct mlx5e_sw_stats, rx_pp_alloc_fast) }, 199 200 { MLX5E_DECLARE_STAT(struct mlx5e_sw_stats, rx_pp_alloc_slow) }, 200 201 { MLX5E_DECLARE_STAT(struct mlx5e_sw_stats, rx_pp_alloc_slow_high_order) }, ··· 205 208 { MLX5E_DECLARE_STAT(struct mlx5e_sw_stats, rx_pp_recycle_ring) }, 206 209 { MLX5E_DECLARE_STAT(struct mlx5e_sw_stats, rx_pp_recycle_ring_full) }, 207 210 { MLX5E_DECLARE_STAT(struct mlx5e_sw_stats, rx_pp_recycle_released_ref) }, 208 - #endif 209 211 #ifdef CONFIG_MLX5_EN_TLS 210 212 { MLX5E_DECLARE_STAT(struct mlx5e_sw_stats, rx_tls_decrypted_packets) }, 211 213 { MLX5E_DECLARE_STAT(struct mlx5e_sw_stats, rx_tls_decrypted_bytes) }, ··· 373 377 s->rx_arfs_err += rq_stats->arfs_err; 374 378 #endif 375 379 s->rx_recover += rq_stats->recover; 376 - #ifdef CONFIG_PAGE_POOL_STATS 377 380 s->rx_pp_alloc_fast += rq_stats->pp_alloc_fast; 378 381 s->rx_pp_alloc_slow += rq_stats->pp_alloc_slow; 379 382 s->rx_pp_alloc_empty += rq_stats->pp_alloc_empty; ··· 384 389 s->rx_pp_recycle_ring += rq_stats->pp_recycle_ring; 385 390 s->rx_pp_recycle_ring_full += rq_stats->pp_recycle_ring_full; 386 391 s->rx_pp_recycle_released_ref += rq_stats->pp_recycle_released_ref; 387 - #endif 388 392 #ifdef CONFIG_MLX5_EN_TLS 389 393 s->rx_tls_decrypted_packets += rq_stats->tls_decrypted_packets; 390 394 s->rx_tls_decrypted_bytes += rq_stats->tls_decrypted_bytes; ··· 490 496 } 491 497 } 492 498 493 - #ifdef CONFIG_PAGE_POOL_STATS 494 499 static void mlx5e_stats_update_stats_rq_page_pool(struct mlx5e_channel *c) 495 500 { 496 501 struct mlx5e_rq_stats *rq_stats = c->rq.stats; ··· 512 519 rq_stats->pp_recycle_ring_full = stats.recycle_stats.ring_full; 513 520 rq_stats->pp_recycle_released_ref = stats.recycle_stats.released_refcnt; 514 521 } 515 - #else 516 - static void mlx5e_stats_update_stats_rq_page_pool(struct mlx5e_channel *c) 517 - { 518 - } 519 - #endif 520 522 521 523 static MLX5E_DECLARE_STATS_GRP_OP_UPDATE_STATS(sw) 522 524 { ··· 2119 2131 { MLX5E_DECLARE_RX_STAT(struct mlx5e_rq_stats, arfs_err) }, 2120 2132 #endif 2121 2133 { MLX5E_DECLARE_RX_STAT(struct mlx5e_rq_stats, recover) }, 2122 - #ifdef CONFIG_PAGE_POOL_STATS 2123 2134 { MLX5E_DECLARE_RX_STAT(struct mlx5e_rq_stats, pp_alloc_fast) }, 2124 2135 { MLX5E_DECLARE_RX_STAT(struct mlx5e_rq_stats, pp_alloc_slow) }, 2125 2136 { MLX5E_DECLARE_RX_STAT(struct mlx5e_rq_stats, pp_alloc_slow_high_order) }, ··· 2130 2143 { MLX5E_DECLARE_RX_STAT(struct mlx5e_rq_stats, pp_recycle_ring) }, 2131 2144 { MLX5E_DECLARE_RX_STAT(struct mlx5e_rq_stats, pp_recycle_ring_full) }, 2132 2145 { MLX5E_DECLARE_RX_STAT(struct mlx5e_rq_stats, pp_recycle_released_ref) }, 2133 - #endif 2134 2146 #ifdef CONFIG_MLX5_EN_TLS 2135 2147 { MLX5E_DECLARE_RX_STAT(struct mlx5e_rq_stats, tls_decrypted_packets) }, 2136 2148 { MLX5E_DECLARE_RX_STAT(struct mlx5e_rq_stats, tls_decrypted_bytes) },
-4
drivers/net/ethernet/mellanox/mlx5/core/en_stats.h
··· 215 215 u64 ch_aff_change; 216 216 u64 ch_force_irq; 217 217 u64 ch_eq_rearm; 218 - #ifdef CONFIG_PAGE_POOL_STATS 219 218 u64 rx_pp_alloc_fast; 220 219 u64 rx_pp_alloc_slow; 221 220 u64 rx_pp_alloc_slow_high_order; ··· 226 227 u64 rx_pp_recycle_ring; 227 228 u64 rx_pp_recycle_ring_full; 228 229 u64 rx_pp_recycle_released_ref; 229 - #endif 230 230 #ifdef CONFIG_MLX5_EN_TLS 231 231 u64 tx_tls_encrypted_packets; 232 232 u64 tx_tls_encrypted_bytes; ··· 383 385 u64 arfs_err; 384 386 #endif 385 387 u64 recover; 386 - #ifdef CONFIG_PAGE_POOL_STATS 387 388 u64 pp_alloc_fast; 388 389 u64 pp_alloc_slow; 389 390 u64 pp_alloc_slow_high_order; ··· 394 397 u64 pp_recycle_ring; 395 398 u64 pp_recycle_ring_full; 396 399 u64 pp_recycle_released_ref; 397 - #endif 398 400 #ifdef CONFIG_MLX5_EN_TLS 399 401 u64 tls_decrypted_packets; 400 402 u64 tls_decrypted_bytes;
+1 -2
drivers/net/ethernet/mellanox/mlx5/core/lag/lag.c
··· 523 523 ndev = ldev->pf[last_idx].netdev; 524 524 } 525 525 526 - if (ndev) 527 - dev_hold(ndev); 526 + dev_hold(ndev); 528 527 529 528 unlock: 530 529 spin_unlock_irqrestore(&lag_lock, flags);