]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
net/mlx5e: set the tx_queue_len for pfifo_fast
authorWilliam Tu <witu@nvidia.com>
Sun, 9 Feb 2025 10:17:09 +0000 (12:17 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 4 Jun 2025 12:37:05 +0000 (14:37 +0200)
[ Upstream commit a38cc5706fb9f7dc4ee3a443f61de13ce1e410ed ]

By default, the mq netdev creates a pfifo_fast qdisc. On a
system with 16 core, the pfifo_fast with 3 bands consumes
16 * 3 * 8 (size of pointer) * 1024 (default tx queue len)
= 393KB. The patch sets the tx qlen to representor default
value, 128 (1<<MLX5E_REP_PARAMS_DEF_LOG_SQ_SIZE), which
consumes 16 * 3 * 8 * 128 = 49KB, saving 344KB for each
representor at ECPF.

Signed-off-by: William Tu <witu@nvidia.com>
Reviewed-by: Daniel Jurgens <danielj@nvidia.com>
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
Reviewed-by: Michal Swiatkowski <michal.swiatkowski@linux.intel.com>
Link: https://patch.msgid.link/20250209101716.112774-9-tariqt@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/mellanox/mlx5/core/en_rep.c

index 6512bb231e7e0301327ff585a13e9673814dd566..8eb7288f820a4a0726e09992975730aac01b87c5 100644 (file)
@@ -740,6 +740,8 @@ static void mlx5e_build_rep_netdev(struct net_device *netdev)
        }
 
        netdev->watchdog_timeo    = 15 * HZ;
+       if (mlx5_core_is_ecpf(mdev))
+               netdev->tx_queue_len = 1 << MLX5E_REP_PARAMS_DEF_LOG_SQ_SIZE;
 
        netdev->features       |= NETIF_F_NETNS_LOCAL;