mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH RFC 0/2] net/mlx5: Cut workqueue traffic of firmware commands and stats
@ 2026-10-30 16:31 Breno Leitao
  2026-10-30 16:31 ` [PATCH RFC 1/2] net/mlx5: Submit blocking commands from the caller's context Breno Leitao
  2026-10-30 16:31 ` [PATCH RFC 2/2] net/mlx5e: Rate limit the HW stats refresh from ndo_get_stats64 Breno Leitao
  0 siblings, 2 replies; 4+ messages in thread
From: Breno Leitao @ 2026-10-30 16:31 UTC (permalink / raw)
  To: Saeed Mahameed, Leon Romanovsky, Tariq Toukan, Mark Bloch,
	Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni
  Cc: netdev, linux-rdma, linux-kernel, Breno Leitao, kernel-team

While looking for Meta's arm64 fleet wide lockstat, I found that mlx5 is
one of the major culprit for the locks in the fleet, and this is the
motivation for this patchset.

On an arm64 host with a dozen mlx5 functions in switchdev mode, lock
contention profiling showed the pool->lock of the unbound worker pool
that all ordered workqueues share as the hottest workqueue lock.
Monitoring daemons read /proc/net/dev, so every mlx5e netdev keeps
queueing update_stats_work. Each refresh sends one to three firmware
commands, and each command is one more work item, on the ordered
cmd->wq of its function.

Patch 1 submits blocking firmware commands from the caller's context,
as page-queue commands already do, and keeps the workqueue for
callback commands.

Patch 2 brings back the 200 msecs stats refresh interval that the
driver used until 2018, as the minimum time between two on-demand
refreshes.

Tested on a ConnectX-4 Lx host (x86, firmware 14.32) against the base
commit, in legacy mode and in switchdev mode with 8 VFs. With one
/proc/net/dev reader in switchdev mode, the firmware commands of a
13 second run drop from 13.4k to 1.8k, and the mlx5_cmd work items of
32 parallel ethtool -S loops drop from 46.7k to none. Channel
reconfiguration, switchdev enable/disable and the load above ran with
no failed firmware commands and no warnings.

Signed-off-by: Breno Leitao <leitao@debian.org>
---
Breno Leitao (2):
      net/mlx5: Submit blocking commands from the caller's context
      net/mlx5e: Rate limit the HW stats refresh from ndo_get_stats64

 drivers/net/ethernet/mellanox/mlx5/core/cmd.c     | 3 ++-
 drivers/net/ethernet/mellanox/mlx5/core/en.h      | 2 ++
 drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 9 +++++++++
 3 files changed, 13 insertions(+), 1 deletion(-)
---
base-commit: 4dd16e31135ea8437a720222df34e8745f385d6d
change-id: 20261030-mlx5-cmd-wq-a156836104af

Best regards,
--  
Breno Leitao <leitao@debian.org>


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-11-09 16:13 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-30 16:31 [PATCH RFC 0/2] net/mlx5: Cut workqueue traffic of firmware commands and stats Breno Leitao
2026-10-30 16:31 ` [PATCH RFC 1/2] net/mlx5: Submit blocking commands from the caller's context Breno Leitao
2026-11-09 16:12   ` Moshe Shemesh
2026-10-30 16:31 ` [PATCH RFC 2/2] net/mlx5e: Rate limit the HW stats refresh from ndo_get_stats64 Breno Leitao

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®