All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joe Damato <jdamato@fastly.com>
To: Jakub Kicinski <kuba@kernel.org>
Cc: "Jason Wang" <jasowang@redhat.com>,
	netdev@vger.kernel.org, gerhard@engleder-embedded.com,
	leiyang@redhat.com, xuanzhuo@linux.alibaba.com,
	mkarsten@uwaterloo.ca, "Michael S. Tsirkin" <mst@redhat.com>,
	"Eugenio Pérez" <eperezma@redhat.com>,
	"Andrew Lunn" <andrew+netdev@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	"Eric Dumazet" <edumazet@google.com>,
	"Paolo Abeni" <pabeni@redhat.com>,
	"open list:VIRTIO CORE AND NET DRIVERS"
	<virtualization@lists.linux.dev>,
	"open list" <linux-kernel@vger.kernel.org>
Subject: Re: [RFC net-next v3 2/4] virtio_net: Prepare for NAPI to queue mapping
Date: Mon, 27 Jan 2025 17:07:54 -0500	[thread overview]
Message-ID: <Z5gDut3Tuzd1npPe@LQ3V64L9R2> (raw)
In-Reply-To: <20250127133304.7898e4c2@kernel.org>

On Mon, Jan 27, 2025 at 01:33:04PM -0800, Jakub Kicinski wrote:
> On Mon, 27 Jan 2025 14:31:21 -0500 Joe Damato wrote:
> > Actually, I missed a patch Jakub submit to net [1], which prevents
> > dumping TX-only NAPIs.
> 
> That patch only addresses NAPI ops, here I think we're talking about
> attributes of the queue object.

Yea, that's true.

> > So, I think this RFC as-is (only calling netif_queue_set_napi
> > for RX NAPIs) should be fine without changes.
> 
> Weak preference towards making netdev_nl_queue_fill_one() "do the right
> thing" when NAPI does not have ID assigned. And right thing IMO would
> be to skip reporting the NAPI_ID attribute.

Ah, right. Your patch was for netdev_nl_napi_fill_one, so presumably
a similar patch would need to be written for
netdev_nl_queue_fill_one.

> Tx NAPIs are one aspect, whether they have ID or not we may want direct
> access to the struct somewhere in the core, via txq, at some point, and
> then people may forget the linking has an unintended effect of also
> changing the netlink attrs. The other aspect is that driver may link
> queue to a Rx NAPI instance before napi_enable(), so before ID is
> assigned. Again, we don't want to report ID of 0 in that case.

I'm sorry I'm not sure I'm following what you are saying here; I
think there might be separate threads concurrently and I'm probably
just confused :)

I think you are saying that netdev_nl_napi_fill_one should not
report 0, which I think is fine but probably a separate patch?

I think, but am not sure, that Jason was asking for guidance on
TX-only NAPIs and linking them with calls to netif_queue_set_napi.
It seems that Jason may be suggesting that the driver shouldn't have
to know that TX-only NAPIs have a NAPI ID of 0 and thus should call
netif_queue_set_napi for all NAPIs and not have to deal think about
TX-only NAPIs at all.

From you've written, Jakub, I think you are suggesting you agree
with that, but with the caveat that netdev_nl_napi_fill_one should
not report 0.

Then, one day in the future, if TX-only NAPIs get an ID they will
magically start to show up.

Is that right?

If so, I'll re-spin the RFC to call netif_queue_set_napi for all
NAPIs in virtio_net, including TX-only NAPIs and see about including
a patch to tweak netdev_nl_napi_fill_one, if necessary.

  reply	other threads:[~2025-01-27 22:07 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
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 [this message]
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=Z5gDut3Tuzd1npPe@LQ3V64L9R2 \
    --to=jdamato@fastly.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=eperezma@redhat.com \
    --cc=gerhard@engleder-embedded.com \
    --cc=jasowang@redhat.com \
    --cc=kuba@kernel.org \
    --cc=leiyang@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mkarsten@uwaterloo.ca \
    --cc=mst@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=virtualization@lists.linux.dev \
    --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.