Article View: linux.kernel.netdev
Article #8968[PATCH RFC 0/2] net/mlx5: Cut workqueue traffic of firmware commands and stats
From: Breno Leitao
Date: Fri, 30 Oct 2026 16:31
Date: Fri, 30 Oct 2026 16:31
46 lines
11839 bytes
11839 bytes
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>
Technical Details
Message-ID:
<20261030-mlx5-cmd-wq-v1-0-1458b2aed637@debian.org>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!eternal-september.org!feeder.eternal-september.org!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-353844-linux-kernel-netdev=dewy.ruShow Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!eternal-september.org!feeder.eternal-september.org!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-353844-linux-kernel-netdev=dewy.ru From: leitao@debian.org (Breno Leitao) Newsgroups: linux.kernel.netdev Subject: [PATCH RFC 0/2] net/mlx5: Cut workqueue traffic of firmware commands and stats Date: Fri, 30 Oct 2026 09:31:42 -0700 Organization: Usenet Network Message-ID: <20261030-mlx5-cmd-wq-v1-0-1458b2aed637@debian.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Injection-Info: usenet.network; logging-data="2275672"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:AwChptER7l8AV/CRoNQWXsVEMWY= sha256:rf62xhyiuwXBAqYBRI8rkKRrLyW5PaqTXtRWHH5MN3A= sha1:nxujyIjx1yJ+iR4ls7hXGhbA3WQ= sha256:TYlDmfGdMzCYAC6JsH8g2F8W9G6w1K6QZXhdJPc0JSA= List-ID: <netdev.vger.kernel.org> X-Mailpost-Empty-Hdrs: X-Spam-Level X-Received: from localhost (localhost [127.0.0.1]) by mail.dewy.ru (Postfix) with ESMTP id F2CB5125CA0; Fri, 30 Oct 2026 19:36:28 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.051 X-Spam-Status: No, score=-3.051 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.25, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key) header.d=debian.org X-Received: from mail.dewy.ru ([127.0.0.1]) by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id l-SyqFGb1dEA; Fri, 30 Oct 2026 19:36:26 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-353844-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=debian.org X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10]) by mail.dewy.ru (Postfix) with ESMTPS id A96C6125CA3; Fri, 30 Oct 2026 19:36:16 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sea.lore.kernel.org (Postfix) with ESMTP id BB4D02E4BD; Fri, 30 Oct 2026 16:32:02 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1793377922; b=GzhIhxhuZH9hZdXmIQ2QvlPSDGwuctGo+RinG5iubYM4nPfINqX8GxIfqKG3weqiQBNJ YtV7ldpVBOx0U+khouygbLldGAdQl9sBPDXrVwmi04lLtZKmmlHCjmjHraZLiZw8DHBMJ UK43qiJlTm+gu1l+1x3rkPGioHf4mG22H2DMwhzzWo+KV7TMkhci/5xbbeHYpwTdG3SBl lC++Xy8syGYG7S9dpC2VO9FPYxZkSpeZYa2wk2VSj99ATzuY+4xM+CodHqNfM3Xz38Dk+ eE5vNgVBW5Od8eH13Rlzx146LRetUJ44u4siF5J2j8IxsOcEwJOeQmKo6NslfXi678w== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1793377922; h=X-Original-To:Received:DMARC-Filter:DKIM-Signature:Received:From: Subject:Date:Message-Id:X-Mailing-List:List-Id:List-Post:List-Help: List-Subscribe:List-Unsubscribe:List-Owner:Precedence:MIME-Version: Content-Type:Content-Transfer-Encoding:X-B4-Tracking:X-Change-ID:To: Cc:X-Mailer:X-Developer-Signature:X-Developer-Key:X-Debian-User; bh=18iLjx7wEgVFJMWjkIMOjrBL+KFsjnRPIBJEFlbdmjc=; b=0ioQrDK9jrQ89SOwWFRqBHYvkxftpXSW+xPkDHkCQdtloV0xWBRGyJ6NufS1RSKzLOYh 6pNncO3PsHsu0BlqYWvfnRyhqXP0sC/vQ/LPWP0Gck5IB5x06NChLTyjAUKzsueVkL3Cf KyXC1fgjRburZsvwBVWDBMiMIjf/cB+LwoKMIxdxTdk0vBxEtTheKsoZWzz6cbHeKhOq3 ZXsHBIZkYjWF0yaxxTRygHDY0HNv1muWUr06iJP3AkPZWuRzIXCIK1mjQGIvhGMbGPdaJ QWcb3Fy68+c+5boDocHmZqqESl6P3iQRqi8l1p6ZdxZKPOoyU6i7czwNAGp044046Jg== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=debian.org header.i=@debian.org header.a=rsa-sha256 header.s=smtpauto.stravinsky header.b=fBbgBfwZ; dmarc=pass header.from=debian.org; spf=pass smtp.mailfrom=debian.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9409B606A321; Fri, 30 Oct 2026 16:32:02 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=debian.org header.i=@debian.org header.a=rsa-sha256 header.s=smtpauto.stravinsky header.b=fBbgBfwZ X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=82.195.75.108 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1793377916; b=Oci34ZhrCDE5ey+U0Aw791x0t7XRW2rSt+GBOWFlnyEqvqnZgNSEzEctmDhH3EUxvF5i cTJwbKqNsg3W4M9rZVfU9vt1j71NLOQsdKhM7jUwXCEDKbI5cgvp0DQEaDkH/N6iE/hPv MUjd3pOfb2dmkaN7LQ0Cd54v5njARiUifuOM+D5cPP5O7ukGvBDVOpbX6peSb6q9bk0mI D1gw6gA3XMCYUuyCJGk508Ho1/qaJDeGpUHgDBXKQt2gaVcZdXbXzSp8FQNH3cb7Cb4fV c/3d5yNeVMQf6Wx+izSmpa8GCMCzYCrQ4aSM2O1W0JA/nKqeBQNLvEob6c0AyQuL+fQ== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1793377916; h=DMARC-Filter:DKIM-Signature:Received:From:Subject:Date:Message-Id: MIME-Version:Content-Type:Content-Transfer-Encoding:X-B4-Tracking: X-Change-ID:To:Cc:X-Mailer:X-Developer-Signature:X-Developer-Key: X-Debian-User; bh=18iLjx7wEgVFJMWjkIMOjrBL+KFsjnRPIBJEFlbdmjc=; b=UEm8gDdnCsBtgvDFrI1sMxqQ1PFocfqx3Wg+NlugchMTYzaJ6uUl196PaMM16GM7ds9l foq6HQW15xXqG1JEqq8hEFNbu7cawwOfEGq80DkIm1LksxHrQmmWb4iDXYnwEGpuhHl8c rLFBGfCOEPbjJEOMIubvpTaGvMnGzlmBVGyrxMXsQSjl9wBwsN3UPNUsPBGDVaDjgxCKw NVFzSF+0gBChalOSPVpBuQsCUUlsdjv6nUvw/RrX8ZSm61n19xgTgHaF0weurY/SKyUEO kBiVJJKIKZ5Hr9OiWK1BvDFGTV0UiwQSBTamq5vA1R1fsVCUqbc321Dr2Qe05v3YszQ== X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=debian.org; spf=pass smtp.mailfrom=debian.org; dkim=pass header.d=debian.org header.i=@debian.org header.a=rsa-sha256 header.s=smtpauto.stravinsky header.b=fBbgBfwZ; arc=none smtp.remote-ip=82.195.75.108 X-Received: from stravinsky.debian.org (stravinsky.debian.org [82.195.75.108]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1101F606A31C; Fri, 30 Oct 2026 16:31:55 +0000 (UTC) X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 1101F606A31C X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=debian.org X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=debian.org X-DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debian.org; s=smtpauto.stravinsky; h=X-Debian-User:Cc:To:Content-Transfer-Encoding: Content-Type:MIME-Version:Message-Id:Date:Subject:From:Reply-To:Content-ID: Content-Description:In-Reply-To:References; bh=18iLjx7wEgVFJMWjkIMOjrBL+KFsjnRPIBJEFlbdmjc=; b=fBbgBfwZBI7t5A1Qja0Z6xR5Zh 80mbJmMoLiW0Xjg039OjFMOlVm7jYeJiVq2j3K7R8jI32Jio4ZwGzDUQxTy3dUGZmSVIPk3BYMN0X ZVw21m9mju3B+LD8sowr9rz57eHN2vEHLAa4Qz+qcZFfTfZ++yc7guHY5leYJytiSRir+aU8Hk4Xt v02EHKcjnQLug47DN+OMkCHkuHCAHP9J8H13mrNePOmOAeorCJOeFCQWsR+V7YHSGEKbvQ/yWtCdL LBPnDbkRL7yClDCmlHRACP4jajhwhokW4W/3m3DQp6gZFUuATKfS9XOqUWY/lBWDtmkFBJqvH72dW yAfMBapA==; X-Received: from authenticated-user by stravinsky.debian.org with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.96) (envelope-from <leitao@debian.org>) id 1xMpWA-003x1s-02; Fri, 30 Oct 2026 16:31:50 +0000 X-Mailing-List: netdev@vger.kernel.org X-List-Post: <mailto:netdev@vger.kernel.org> X-List-Help: <mailto:netdev+help@vger.kernel.org> X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org> X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org> X-List-Owner: <mailto:netdev+owner@vger.kernel.org> X-Precedence: list X-B4-Tracking: v=1; b=H4sIAG7G5GoC/6tWKk4tykwtVrJSqFYqSi3LLM7MzwNyDHUUlJIzE vPSU3UzU4B8JSMDIzNDA2MD3dycClPd5NwU3fJC3URDUzMLY6C4SWKaElBHQVFqWmYF2LRopSA 3Z6VYiGBxaVJWanIJyByl2loAkhji9XQAAAA= X-Change-ID: 20261030-mlx5-cmd-wq-a156836104af X-Cc: netdev@vger.kernel.org, linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org, Breno Leitao <leitao@debian.org>, kernel-team@meta.com X-Mailer: b4 0.15-dev-47773 X-Developer-Signature: v=1; a=openpgp-sha256; l=1993; i=leitao@debian.org; h=from:subject:message-id; bh=fSYl3YbyV2t6dd8c0/OYqNO+5zzMvz+WgutkCutaf7k=; b=owEBbQKS/ZANAwAIATWjk5/8eHdtAcsmYgBq5MZysrKXg7y6xjuVzIDGwQqgOhGpKI51hAczy /Q71TivthGJAjMEAAEIAB0WIQSshTmm6PRnAspKQ5s1o5Of/Hh3bQUCauTGcgAKCRA1o5Of/Hh3 bXf+D/9VTpEbaUSWrfBo4XO7zEo8VTP2E9GDAdqPBNa+x1+tiITaryl4wU+YQtmUG5MUeHF/Jwi 9JB331eUDcyRABbMwJTw/vyQLpMUVnmvf8hi/3Rnj0krVA9DjP6U1qN84aQL7VqCQi4pAqhJPJf yExm4uxyuaVr8/Kf+SJUPVy6TC69Mzm/NgIIxPp+p2s/4dOI7TUAKTGmibpojYQkRUzB6peEixO RYpDCN7Gsw9KpUn/IHdnhX410hgDN0JH2aoCzUHn/9k35CfF7mg1EisGQ/eBJ+Lt1cE47UGFPul yelSieAmggekIEXtV0bTvImklLpNFoX5XC6TDQfUKoqJ1cPLU7Snr9HJus8A6k8U/5WYrCfrX33 swAqnxozXRzK3itnj1NxItHXydyh5WKhmtzbZuu01gV/apVoQBIwt9L1TSkDATdjIrcJs6CKMDH NyvLDVLc08Bk3f6UqiZa4MC0BgdW4+fGkFDG+xcVAXgAb6659xureWag356JLVLH/BM0noobc3/ BXpEPSBWsN32s3/SLbPqBPiz7USkdAspJPIcdEUPneSrJ417q+CaKSU2cfzlrNLz5pRc8T9AiTA w+VHY2JMveBY+xtF9vVMcBi5VCb+B3OiBwtD4/vSKodOmc3rQC8bi6xeB5LCa8AA0hdQibX+q0t QvpOVfQpP4S2AYw== X-Developer-Key: i=leitao@debian.org; a=openpgp; fpr=AC8539A6E8F46702CA4A439B35A3939FFC78776D X-Debian-User: leitao