Netdev List
 help / color / mirror / Atom feed
From: Maxime Chevallier <maxime.chevallier@bootlin.com>
To: Stanislav Fomichev <sdf@fomichev.me>
Cc: netdev@vger.kernel.org, davem@davemloft.net, edumazet@google.com,
	kuba@kernel.org, pabeni@redhat.com,
	Saeed Mahameed <saeed@kernel.org>
Subject: Re: [PATCH net-next v8 08/12] net: ethtool: try to protect all callback with netdev instance lock
Date: Thu, 27 Feb 2025 09:48:00 +0100	[thread overview]
Message-ID: <20250227094800.7ff48a71@fedora.home> (raw)
In-Reply-To: <20250226211108.387727-9-sdf@fomichev.me>

Hi,

On Wed, 26 Feb 2025 13:11:04 -0800
Stanislav Fomichev <sdf@fomichev.me> wrote:

> From: Jakub Kicinski <kuba@kernel.org>
> 
> Protect all ethtool callbacks and PHY related state with the netdev
> instance lock, for drivers which want / need to have their ops
> instance-locked. Basically take the lock everywhere we take rtnl_lock.
> It was tempting to take the lock in ethnl_ops_begin(), but turns
> out we actually nest those calls (when generating notifications).
> 
> Cc: Saeed Mahameed <saeed@kernel.org>
> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
> Signed-off-by: Stanislav Fomichev <sdf@fomichev.me>
> ---
>  drivers/net/netdevsim/ethtool.c |  2 --
>  net/dsa/conduit.c               | 16 +++++++++++++++-
>  net/ethtool/cabletest.c         | 20 ++++++++++++--------
>  net/ethtool/cmis_fw_update.c    |  7 ++++++-
>  net/ethtool/features.c          |  6 ++++--
>  net/ethtool/ioctl.c             |  6 ++++++
>  net/ethtool/module.c            |  8 +++++---
>  net/ethtool/netlink.c           | 12 ++++++++++++
>  net/ethtool/phy.c               | 20 ++++++++++++++------
>  net/ethtool/rss.c               |  2 ++
>  net/ethtool/tsinfo.c            |  9 ++++++---
>  net/sched/sch_taprio.c          |  5 ++++-
>  12 files changed, 86 insertions(+), 27 deletions(-)

FWIW I've tested that patchset with various PHY-related ethtool ops as
well as the module ops and didn't notice any issue or strangeness.

So to some extent,

Tested-by: Maxime Chevallier <maxime.chevallier@bootlin.com>

Thanks,

Maxime

  reply	other threads:[~2025-02-27  8:48 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-26 21:10 [PATCH net-next v8 00/12] net: Hold netdev instance lock during ndo operations Stanislav Fomichev
2025-02-26 21:10 ` [PATCH net-next v8 01/12] net: hold netdev instance lock during ndo_open/ndo_stop Stanislav Fomichev
2025-02-26 21:10 ` [PATCH net-next v8 02/12] net: hold netdev instance lock during ndo_setup_tc Stanislav Fomichev
2025-02-26 21:10 ` [PATCH net-next v8 03/12] net: hold netdev instance lock during queue operations Stanislav Fomichev
2025-02-26 21:11 ` [PATCH net-next v8 04/12] net: hold netdev instance lock during rtnetlink operations Stanislav Fomichev
2025-02-26 21:11 ` [PATCH net-next v8 05/12] net: hold netdev instance lock during ioctl operations Stanislav Fomichev
2025-02-26 21:11 ` [PATCH net-next v8 06/12] net: hold netdev instance lock during sysfs operations Stanislav Fomichev
2025-02-26 21:11 ` [PATCH net-next v8 07/12] net: hold netdev instance lock during ndo_bpf Stanislav Fomichev
2025-02-26 21:11 ` [PATCH net-next v8 08/12] net: ethtool: try to protect all callback with netdev instance lock Stanislav Fomichev
2025-02-27  8:48   ` Maxime Chevallier [this message]
2025-02-27 22:40     ` Stanislav Fomichev
2025-02-26 21:11 ` [PATCH net-next v8 09/12] net: replace dev_addr_sem " Stanislav Fomichev
2025-02-26 21:11 ` [PATCH net-next v8 10/12] net: add option to request " Stanislav Fomichev
2025-02-26 21:11 ` [PATCH net-next v8 11/12] docs: net: document new locking reality Stanislav Fomichev
2025-02-26 21:11 ` [PATCH net-next v8 12/12] eth: bnxt: remove most dependencies on RTNL Stanislav Fomichev
2025-02-28  1:27 ` [PATCH net-next v8 00/12] net: Hold netdev instance lock during ndo operations Jakub Kicinski

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=20250227094800.7ff48a71@fedora.home \
    --to=maxime.chevallier@bootlin.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=saeed@kernel.org \
    --cc=sdf@fomichev.me \
    /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