Netdev List
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Wang Zhan <wang.zhan@smartx.com>
Cc: netdev@vger.kernel.org, davem@davemloft.net, edumazet@google.com,
	pabeni@redhat.com, horms@kernel.org, keyong.sun@smartx.com
Subject: Re: [PATCH net-next] net: sysfs: use ops lock for speed and duplex
Date: Wed, 2 Sep 2026 17:54:39 -0700	[thread overview]
Message-ID: <20260902175439.02f76447@kernel.org> (raw)
In-Reply-To: <20260831080623.1064001-1-wang.zhan@smartx.com>

On Mon, 31 Aug 2026 16:06:23 +0800 Wang Zhan wrote:
> Reading /sys/class/net/<dev>/{speed,duplex} takes rtnl_lock() before
> calling __ethtool_get_link_ksettings(). For ops-locked devices whose
> callbacks do not require RTNL, this unnecessarily serializes sysfs
> readers with rtnetlink users. On CPU-throttled hosts, a periodic reader
> such as node-exporter can keep RTNL held for hundreds of milliseconds
> while an mlx5 callback runs.
> 
> Ops-locked devices can run ethtool operations under the netdev instance
> lock. The ethtool netlink and ioctl paths use
> ETHTOOL_OP_NEEDS_RTNL_LINKSETTINGS to identify callbacks that still need
> RTNL, but the sysfs path currently does not. Apply the same rule to sysfs
> reads: call netif_get_link_ksettings() under netdev_lock_ops() when the
> callback does not require RTNL, and keep sysfs_rtnl_lock() for legacy
> devices and callbacks that opt in to RTNL.
> 
> Preserve the existing speed and duplex sysfs ABI, including -EINVAL for
> devices that are down or callbacks that fail.
> 
> Assisted-by: LLM

The diff is too ugly to look at. Learn how to break up your changes to
make them reviewable.
-- 
pw-bot: cr
pv-bot: slop

      parent reply	other threads:[~2026-09-03  0:54 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-31  8:06 [PATCH net-next] net: sysfs: use ops lock for speed and duplex Wang Zhan
2026-09-02 20:06 ` [net-next] " netdev-bot+sashiko
2026-09-03  0:54 ` Jakub Kicinski [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260902175439.02f76447@kernel.org \
    --to=kuba@kernel.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=keyong.sun@smartx.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=wang.zhan@smartx.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox