netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Mina Almasry <almasrymina@google.com>
Cc: Cosmin Ratiu <cratiu@nvidia.com>, Mark Bloch <mbloch@nvidia.com>,
	Dragos Tatulea <dtatulea@nvidia.com>,
	"andrew+netdev@lunn.ch" <andrew+netdev@lunn.ch>,
	"hawk@kernel.org" <hawk@kernel.org>,
	"davem@davemloft.net" <davem@davemloft.net>,
	"john.fastabend@gmail.com" <john.fastabend@gmail.com>,
	"leon@kernel.org" <leon@kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"pabeni@redhat.com" <pabeni@redhat.com>,
	"ast@kernel.org" <ast@kernel.org>,
	"richardcochran@gmail.com" <richardcochran@gmail.com>,
	Leon Romanovsky <leonro@nvidia.com>,
	"linux-rdma@vger.kernel.org" <linux-rdma@vger.kernel.org>,
	"edumazet@google.com" <edumazet@google.com>,
	"horms@kernel.org" <horms@kernel.org>,
	"daniel@iogearbox.net" <daniel@iogearbox.net>,
	Tariq Toukan <tariqt@nvidia.com>,
	Saeed Mahameed <saeedm@nvidia.com>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	Gal Pressman <gal@nvidia.com>,
	"bpf@vger.kernel.org" <bpf@vger.kernel.org>
Subject: Re: [PATCH net-next v3 10/12] net/mlx5e: Implement queue mgmt ops and single channel swap
Date: Thu, 12 Jun 2025 15:52:26 -0700	[thread overview]
Message-ID: <20250612155226.770f0676@kernel.org> (raw)
In-Reply-To: <CAHS8izOG+LoJ-GvyRu6zSVCUvoW4VzYX5CEdDhCdVLimOSP0KQ@mail.gmail.com>

On Thu, 12 Jun 2025 13:44:44 -0700 Mina Almasry wrote:
> > On Wed, 2025-06-11 at 22:33 -0700, Mina Almasry wrote:  
> > > Is this really better than maintaining uniformity of behavior between
> > > the drivers that support the queue mgmt api and just doing the
> > > mlx5e_deactivate_priv_channels and mlx5e_close_channel in the stop
> > > like core sorta expects?
> > >
> > > We currently use the ndos to restart a queue, but I'm imagining in
> > > the
> > > future we can expand it to create queues on behalf of the queues. The
> > > stop queue API may be reused in other contexts, like maybe to kill a
> > > dynamically created devmem queue or something, and this specific
> > > driver may stop working because stop actually doesn't do anything?
> > >  
> >
> > The .ndo_queue_stop operation doesn't make sense by itself for mlx5,
> > because the current mlx5 architecture is to atomically swap in all of
> > the channels.
> > The scenario you are describing, with a hypothetical ndo_queue_stop for
> > dynamically created devmem queues would leave all of the queues stopped
> > and the old channel deallocated in the channel array. Worse problems
> > would happen in that state than with today's approach, which leaves the
> > driver in functional state.
> >
> > Perhaps Saeed can add more details to this?  
> 
> I see, so essentially mlx5 supports restarting a queue but not
> necessarily stopping and starting a queue as separate actions?
> 
> If so, can maybe the comment on the function be reworded to more
> strongly indicate that this is a limitation? Just asking because
> future driver authors interested in implementing the queue API will
> probably look at one of mlx5/gve/bnxt to see what an existing
> implementation looks like, and I would rather them follow bnxt/gve
> that is more in line with core's expectations if possible. But that's
> a minor concern; I'm fine with this patch.
> 
> FWIW this may break in the future if core decides to add code that
> actually uses the stop operation as a 'stop', not as a stepping stone
> to 'restart', but I'm not sure we can do anything about that if it's a
> driver limitation.

Agreed, would be good to add a TODO and follow up on this.
It will bite us sooner or later. I suppose state_lock may
need to be dropped in favor of the netdev instance lock first?

I'm disappointed that mlx5 once again disrupts all rings to restart 
a single one. But all existing drivers seem to do this, so I guess
it'd be unfair to push back based on just that :|

  reply	other threads:[~2025-06-12 22:52 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-09 14:58 [PATCH net-next v3 00/12] net/mlx5e: Add support for devmem and io_uring TCP zero-copy Mark Bloch
2025-06-09 14:58 ` [PATCH net-next v3 01/12] net: Allow const args for of page_to_netmem() Mark Bloch
2025-06-09 14:58 ` [PATCH net-next v3 02/12] net: Add skb_can_coalesce for netmem Mark Bloch
2025-06-09 14:58 ` [PATCH net-next v3 03/12] net/mlx5e: SHAMPO: Reorganize mlx5_rq_shampo_alloc Mark Bloch
2025-06-09 14:58 ` [PATCH net-next v3 04/12] net/mlx5e: SHAMPO: Remove redundant params Mark Bloch
2025-06-09 14:58 ` [PATCH net-next v3 05/12] net/mlx5e: SHAMPO: Improve hw gro capability checking Mark Bloch
2025-06-09 14:58 ` [PATCH net-next v3 06/12] net/mlx5e: SHAMPO: Separate pool for headers Mark Bloch
2025-06-09 14:58 ` [PATCH net-next v3 07/12] net/mlx5e: SHAMPO: Headers page pool stats Mark Bloch
2025-06-09 15:21   ` Jakub Kicinski
2025-06-09 15:31     ` Dragos Tatulea
2025-06-09 23:22       ` Jakub Kicinski
2025-06-09 14:58 ` [PATCH net-next v3 08/12] net/mlx5e: Convert over to netmem Mark Bloch
2025-06-09 14:58 ` [PATCH net-next v3 09/12] net/mlx5e: Add support for UNREADABLE netmem page pools Mark Bloch
2025-06-09 14:58 ` [PATCH net-next v3 10/12] net/mlx5e: Implement queue mgmt ops and single channel swap Mark Bloch
2025-06-12  5:33   ` Mina Almasry
2025-06-12  9:05     ` Cosmin Ratiu
2025-06-12 20:44       ` Mina Almasry
2025-06-12 22:52         ` Jakub Kicinski [this message]
2025-06-09 14:58 ` [PATCH net-next v3 11/12] net/mlx5e: Support ethtool tcp-data-split settings Mark Bloch
2025-06-09 14:58 ` [PATCH net-next v3 12/12] net/mlx5e: Add TX support for netmems Mark Bloch

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=20250612155226.770f0676@kernel.org \
    --to=kuba@kernel.org \
    --cc=almasrymina@google.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=cratiu@nvidia.com \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=dtatulea@nvidia.com \
    --cc=edumazet@google.com \
    --cc=gal@nvidia.com \
    --cc=hawk@kernel.org \
    --cc=horms@kernel.org \
    --cc=john.fastabend@gmail.com \
    --cc=leon@kernel.org \
    --cc=leonro@nvidia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=mbloch@nvidia.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=richardcochran@gmail.com \
    --cc=saeedm@nvidia.com \
    --cc=tariqt@nvidia.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).