From: Jakub Kicinski <kuba@kernel.org>
To: Mina Almasry <almasrymina@google.com>
Cc: davem@davemloft.net, netdev@vger.kernel.org, edumazet@google.com,
pabeni@redhat.com, andrew+netdev@lunn.ch, horms@kernel.org,
willemdebruijn.kernel@gmail.com, sdf@fomichev.me,
Willem de Bruijn <willemb@google.com>
Subject: Re: [PATCH net-next v2 6/8] netdevsim: add queue management API support
Date: Tue, 7 Jan 2025 16:45:29 -0800 [thread overview]
Message-ID: <20250107164529.27603de6@kernel.org> (raw)
In-Reply-To: <CAHS8izO3FWZ6Wgnf0jwHLo8xDczz1zmCq_ypXRAWijYuxUY0MA@mail.gmail.com>
On Tue, 7 Jan 2025 14:53:09 -0800 Mina Almasry wrote:
> > +/* Queue reset mode is controlled by ns->rq_reset_mode.
> > + * - normal - new NAPI new pool (old NAPI enabled when new added)
>
> Nit, probably not worth a respin: Normal seems to me to delete old
> napi after the new one is added and enabled.
Yes, the comment doesn't really focus on removal order, it's less
important. I may be missing your point..
> queue stop -> napi_disable(old)
> queue alloc -> netif_napi_add_config(new)
> queue start -> napi_enable(new)
> queue free -> netif_napi_del(old)
I think you have stop and alloc swapped here.
> > + * - mode 1 - allocate new pool (NAPI is only disabled / enabled)
> > + * - mode 2 - new NAPI new pool (old NAPI removed before new added)
> > + * - mode 3 - new NAPI new pool (old NAPI disabled when new added)
> > + */
>
> Which modes are 'correct' for a driver to implement? 2/3 is for
> testing only, as you note in the code, the add/del functions should
> really be called from alloc/free and not from queue_start. I assume
> modes normal and 1 are both correct implementations of the queue API
> and the driver gets to pick whether to reuse the napi instance or not?
> Asking because IIRC GVE implements mode 1, not what you consider
> 'normal'.
I can't think why any of them would be "incorrect" per se, but 2 and 3
are likely weird and unnatural. I thought mode 0 would simply be most
common, maybe I shouldn't have called it "normal". But because of all
the "modes" netdevsim implementation seemed too messy to be considered
a blueprint..
next prev parent reply other threads:[~2025-01-08 0:45 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-07 16:08 [PATCH net-next v2 0/8] net: make sure we retain NAPI ordering on netdev->napi_list Jakub Kicinski
2025-01-07 16:08 ` [PATCH net-next v2 1/8] " Jakub Kicinski
2025-01-07 16:08 ` [PATCH net-next v2 2/8] netdev: define NETDEV_INTERNAL Jakub Kicinski
2025-01-07 16:08 ` [PATCH net-next v2 3/8] netdevsim: support NAPI config Jakub Kicinski
2025-01-07 16:08 ` [PATCH net-next v2 4/8] netdevsim: allocate rqs individually Jakub Kicinski
2025-01-07 16:08 ` [PATCH net-next v2 5/8] netdevsim: add queue alloc/free helpers Jakub Kicinski
2025-01-07 16:08 ` [PATCH net-next v2 6/8] netdevsim: add queue management API support Jakub Kicinski
2025-01-07 22:53 ` Mina Almasry
2025-01-08 0:45 ` Jakub Kicinski [this message]
2025-01-07 16:08 ` [PATCH net-next v2 7/8] netdevsim: add debugfs-triggered queue reset Jakub Kicinski
2025-01-07 23:00 ` Mina Almasry
2025-01-08 0:50 ` Jakub Kicinski
2025-01-07 16:08 ` [PATCH net-next v2 8/8] selftests: net: test listing NAPI vs queue resets Jakub Kicinski
2025-01-09 14:40 ` [PATCH net-next v2 0/8] net: make sure we retain NAPI ordering on netdev->napi_list patchwork-bot+netdevbpf
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=20250107164529.27603de6@kernel.org \
--to=kuba@kernel.org \
--cc=almasrymina@google.com \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=sdf@fomichev.me \
--cc=willemb@google.com \
--cc=willemdebruijn.kernel@gmail.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;
as well as URLs for NNTP newsgroup(s).