All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Joe Damato <jdamato@fastly.com>
Cc: netdev@vger.kernel.org, gerhard@engleder-embedded.com,
	jasowang@redhat.com, leiyang@redhat.com,
	xuanzhuo@linux.alibaba.com, mkarsten@uwaterloo.ca,
	Andrew Lunn <andrew+netdev@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Paolo Abeni <pabeni@redhat.com>, Simon Horman <horms@kernel.org>,
	Kuniyuki Iwashima <kuniyu@amazon.com>,
	Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
	Lorenzo Bianconi <lorenzo@kernel.org>,
	Alexander Lobakin <aleksander.lobakin@intel.com>,
	linux-kernel@vger.kernel.org (open list)
Subject: Re: [RFC net-next v3 1/4] net: protect queue -> napi linking with netdev_lock()
Date: Mon, 27 Jan 2025 13:37:56 -0800	[thread overview]
Message-ID: <20250127133756.413efb24@kernel.org> (raw)
In-Reply-To: <20250121191047.269844-2-jdamato@fastly.com>

On Tue, 21 Jan 2025 19:10:41 +0000 Joe Damato wrote:
> From: Jakub Kicinski <kuba@kernel.org>
> 
> netdev netlink is the only reader of netdev_{,rx_}queue->napi,
> and it already holds netdev->lock. Switch protection of the
> writes to netdev->lock as well.
> 
> Add netif_queue_set_napi_locked() for API completeness,
> but the expectation is that most current drivers won't have
> to worry about locking any more. Today they jump thru hoops
> to take rtnl_lock.

I started having second thoughts about this patch, sorry to say.
NAPI objects were easy to protect with the lock because there's
a clear registration and unregistration API. Queues OTOH are made
visible by the netif_set_real_num_queues() call, which is tricky 
to protect with the instance lock. Queues are made visible, then
we configure them.

My thinking changed a bit, I think we should aim to protect all
ndos and ethtool ops with the instance lock. Stanislav and Saeed
seem to be working on that:
https://lore.kernel.org/all/Z5LhKdNMO5CvAvZf@mini-arch/
so hopefully that doesn't cause too much of a delay.
But you may need to rework this series further :(

  reply	other threads:[~2025-01-27 21:37 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-21 19:10 [RFC net-next v3 0/4] virtio_net: Link queues to NAPIs Joe Damato
2025-01-21 19:10 ` [RFC net-next v3 1/4] net: protect queue -> napi linking with netdev_lock() Joe Damato
2025-01-27 21:37   ` Jakub Kicinski [this message]
2025-01-27 22:21     ` Joe Damato
2025-01-21 19:10 ` [RFC net-next v3 2/4] virtio_net: Prepare for NAPI to queue mapping Joe Damato
2025-01-22  6:12   ` Jason Wang
2025-01-22 17:40     ` Joe Damato
2025-01-23  2:40       ` Jason Wang
2025-01-23  2:47         ` Joe Damato
2025-01-24  1:14           ` Jason Wang
2025-01-24 20:19             ` Joe Damato
2025-01-26  8:04               ` Jason Wang
2025-01-27 17:52                 ` Joe Damato
2025-01-27 19:31                   ` Joe Damato
2025-01-27 21:33                     ` Jakub Kicinski
2025-01-27 22:07                       ` Joe Damato
2025-01-27 22:24                         ` Jakub Kicinski
2025-01-27 22:32                           ` Joe Damato
2025-01-21 19:10 ` [RFC net-next v3 3/4] virtio_net: Map NAPIs to queues Joe Damato
2025-01-21 20:13   ` Gerhard Engleder
2025-01-22  6:13   ` Jason Wang
2025-01-21 19:10 ` [RFC net-next v3 4/4] virtio_net: Use persistent NAPI config Joe Damato
2025-01-21 20:18   ` Gerhard Engleder
2025-01-22  6:13   ` Jason Wang

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=20250127133756.413efb24@kernel.org \
    --to=kuba@kernel.org \
    --cc=aleksander.lobakin@intel.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=bigeasy@linutronix.de \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=gerhard@engleder-embedded.com \
    --cc=horms@kernel.org \
    --cc=jasowang@redhat.com \
    --cc=jdamato@fastly.com \
    --cc=kuniyu@amazon.com \
    --cc=leiyang@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lorenzo@kernel.org \
    --cc=mkarsten@uwaterloo.ca \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=xuanzhuo@linux.alibaba.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.