All of lore.kernel.org
 help / color / mirror / Atom feed
From: Long Li <longli@microsoft.com>
To: Long Li <longli@microsoft.com>, Long Li <longli@kernel.org>,
	Konstantin Taranov <kotaranov@microsoft.com>,
	Jakub Kicinski <kuba@kernel.org>,
	"David S . Miller" <davem@davemloft.net>,
	Paolo Abeni <pabeni@redhat.com>,
	Eric Dumazet <edumazet@google.com>,
	Andrew Lunn <andrew+netdev@lunn.ch>,
	Jason Gunthorpe <jgg@ziepe.ca>, Leon Romanovsky <leon@kernel.org>,
	Haiyang Zhang <haiyangz@microsoft.com>,
	"K . Y . Srinivasan" <kys@microsoft.com>,
	Wei Liu <wei.liu@kernel.org>, Dexuan Cui <decui@microsoft.com>,
	shradhagupta@linux.microsoft.com, Simon Horman <horms@kernel.org>,
	ernis@linux.microsoft.com, stephen@networkplumber.org,
	shirazsaleem@microsoft.com
Cc: netdev@vger.kernel.org, linux-rdma@vger.kernel.org,
	linux-hyperv@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH net-next v4 00/13] net: mana: reconfigure by replacing the queue set
Date: Mon,  7 Sep 2026 20:28:30 -0700	[thread overview]
Message-ID: <20260908032843.397667-1-longli@microsoft.com> (raw)

Replace detach/attach reconfiguration with pre-allocation and queue-set
replacement. Allocation failure leaves the running configuration intact.
Publication failure attempts rollback; if rollback also fails, the port
is stopped and requires administrative recovery.

EQs and statistics belong to the port, and valid user RSS tables survive
queue rebuilds. Channel-count changes reuse surviving queues: reductions
retire only the tail, and increases allocate only the added queues. Ring,
MTU, private-flag and XDP changes that rebuild queues still require both
sets temporarily and can fail at hardware resource limits.

Patch layout:
  1-2:   Queue-set helpers and the shared EQ pool.
  3-7:   Convert channel, ring, private-flag, MTU and XDP reconfiguration.
  8:     Remove an unreachable early return from mana_detach().
  9-11:  Preserve statistics, release unused EQs and preserve RSS tables.
  12-13: Reuse queues across channel-count reductions and increases.

Overlap with submitted net fixes:

Two independent fixes have been submitted to net:

  [1] net: mana: restore the XDP program pointer when pre-allocation fails
  https://lore.kernel.org/all/20260904202640.3900685-1-longli@microsoft.com/

  [2] net: mana: do not discard an ethtool-configured RSS table on a queue
      rebuild
  https://lore.kernel.org/all/20260905004401.3937066-1-longli@microsoft.com/

Neither is a prerequisite for this series, and they are not resent here
as standalone patches. Their handling is incorporated into patches 7
and 11, respectively. Merging the trees can conflict in these blocks:

  - Patch 7, mana_bpf.c: retain the queue-set version of mana_xdp_set().
    It leaves the live program unchanged during allocation, replacing
    the pre-allocation failure path repaired by [1].
  - Patch 11, mana_en.c: retain the three-argument mana_rss_table_keep()
    and its callers, which validate the prospective queue count and
    defer swap-path loss notifications until publication succeeds.
    ETHTOOL_OP_NEEDS_RTNL_RSS in mana_ethtool.c is identical in [2] and
    this series.

These resolutions apply to the overlapping blocks, not unrelated net
changes. The two patch mails also carry the corresponding merge notes.

Changes in v4:

  - Retain pcie_flr() instead of pci_try_reset_function(), avoiding the
    device-lock conflict in the remove path.
  - Delay lowering real_num_rx_queues until retiring RQs are destroyed,
    including after rollback.
  - Add the full barrier between reopening port_is_up and reading TX
    ring state, preventing a missed queue wakeup.
  - Report persistent statistics while down or swapping; keep only the
    hardware PHY query gated on port_is_up.
  - Derive the live port inside mana_free_qset() instead of passing a
    redundant port argument.
  - Require RTNL for RSS setters. Remove loss notification from the
    non-swap allocation path, whose callers do not consistently hold
    the required netdev instance lock.
  - Wait for TX-selection readers before freeing the old RSS table in
    both channel-count paths. Clear TX slots after partial teardown.

Changes in v3:

  - Move shared EQ ownership before the first converted caller.
  - Separate retiring RX statistics and fold them on teardown or rollback.
  - Preserve carrier through successful swaps and rollback, and track
    software-forced carrier shutdown separately from hardware link events.
  - Correct kernel-doc and EQ/vector lifetime descriptions.
  - Rebase onto net-next and move the resize-recovery capability to BIT(31).

Changes in v2:

  - Replace post-failure retries with pre-allocated queue-set replacement.

Previous versions:
  v3: https://lore.kernel.org/all/20260901014442.2945689-1-longli@microsoft.com/
  v2: https://patchwork.kernel.org/project/netdevbpf/list/?series=1145125
  v1: https://lore.kernel.org/netdev/20260711041415.3008868-1-dipayanroy@linux.microsoft.com/

Dipayaan Roy (1):
  net: mana: do not bail out of mana_detach on dealloc failure

Long Li (12):
  net: mana: add queue-set allocation and teardown helpers
  net: mana: share the EQ pool across a queue-set swap
  net: mana: swap queue sets in mana_set_channels
  net: mana: swap queue sets in mana_set_ringparam
  net: mana: swap queue sets in mana_set_priv_flags
  net: mana: swap queue sets in mana_change_mtu
  net: mana: swap queue sets in mana_xdp_set
  net: mana: keep per-queue statistics in the port context
  net: mana: release EQs left idle by a channel-count reduction
  net: mana: keep a user-configured RSS table across a queue rebuild
  net: mana: keep the surviving queues when the channel count is reduced
  net: mana: keep the existing queues when the channel count is raised

 .../net/ethernet/microsoft/mana/mana_bpf.c    |   94 +-
 drivers/net/ethernet/microsoft/mana/mana_en.c | 1256 +++++++++++++++--
 .../ethernet/microsoft/mana/mana_ethtool.c    |  312 ++--
 include/net/mana/gdma.h                       |    8 +-
 include/net/mana/mana.h                       |  105 +-
 5 files changed, 1524 insertions(+), 251 deletions(-)


base-commit: 1bb784eb6e38fd73143f021608e4ef3095d0c0d7
-- 
2.43.0

             reply	other threads:[~2026-09-08  3:29 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-08  3:28 Long Li [this message]
2026-09-08  3:28 ` [PATCH net-next v4 01/13] net: mana: add queue-set allocation and teardown helpers Long Li
2026-09-09  3:29   ` sashiko-bot
2026-09-08  3:28 ` [PATCH net-next v4 02/13] net: mana: share the EQ pool across a queue-set swap Long Li
2026-09-09  3:29   ` sashiko-bot
2026-09-08  3:28 ` [PATCH net-next v4 03/13] net: mana: swap queue sets in mana_set_channels Long Li
2026-09-09  3:29   ` sashiko-bot
2026-09-08  3:28 ` [PATCH net-next v4 04/13] net: mana: swap queue sets in mana_set_ringparam Long Li
2026-09-09  3:29   ` sashiko-bot
2026-09-09 23:25     ` [EXTERNAL] " Long Li
2026-09-08  3:28 ` [PATCH net-next v4 05/13] net: mana: swap queue sets in mana_set_priv_flags Long Li
2026-09-09  3:29   ` sashiko-bot
2026-09-08  3:28 ` [PATCH net-next v4 06/13] net: mana: swap queue sets in mana_change_mtu Long Li
2026-09-09  3:29   ` sashiko-bot
2026-09-08  3:28 ` [PATCH net-next v4 07/13] net: mana: swap queue sets in mana_xdp_set Long Li
2026-09-09  3:29   ` sashiko-bot
2026-09-08  3:28 ` [PATCH net-next v4 08/13] net: mana: do not bail out of mana_detach on dealloc failure Long Li
2026-09-09  3:29   ` sashiko-bot
2026-09-08  3:28 ` [PATCH net-next v4 09/13] net: mana: keep per-queue statistics in the port context Long Li
2026-09-09  3:29   ` sashiko-bot
2026-09-08  3:28 ` [PATCH net-next v4 10/13] net: mana: release EQs left idle by a channel-count reduction Long Li
2026-09-09  3:29   ` sashiko-bot
2026-09-08  3:28 ` [PATCH net-next v4 11/13] net: mana: keep a user-configured RSS table across a queue rebuild Long Li
2026-09-09  3:29   ` sashiko-bot
2026-09-08  3:28 ` [PATCH net-next v4 12/13] net: mana: keep the surviving queues when the channel count is reduced Long Li
2026-09-09  3:29   ` sashiko-bot
2026-09-08  3:28 ` [PATCH net-next v4 13/13] net: mana: keep the existing queues when the channel count is raised Long Li
2026-09-09  3:29   ` sashiko-bot

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=20260908032843.397667-1-longli@microsoft.com \
    --to=longli@microsoft.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=decui@microsoft.com \
    --cc=edumazet@google.com \
    --cc=ernis@linux.microsoft.com \
    --cc=haiyangz@microsoft.com \
    --cc=horms@kernel.org \
    --cc=jgg@ziepe.ca \
    --cc=kotaranov@microsoft.com \
    --cc=kuba@kernel.org \
    --cc=kys@microsoft.com \
    --cc=leon@kernel.org \
    --cc=linux-hyperv@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=longli@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=shirazsaleem@microsoft.com \
    --cc=shradhagupta@linux.microsoft.com \
    --cc=stephen@networkplumber.org \
    --cc=wei.liu@kernel.org \
    /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.