Skip to content

net: mana: reconfigure by replacing the queue set

Long Li linux-hyperv linux-rdma lkml netdev 5 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v5 Latest13 patches 1 replyIn review
  2. v413 patches 1 replySuperseded
  3. v313 patches 5 repliesSuperseded
Earlier versions · 2
VersionPostedPatchesRepliesStatus
v2 posting 2/213 patches9 repliesSuperseded
v2 posting 1/213 patches1 replySuperseded

Changes in v5 from the cover letter

- Rebase onto net-next at ce48a0fdc564 ("Merge branch

Patches in v5 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/13net: mana: add queue-set allocation and teardown helpersdrivers/net/ethernet/microsoft/mana/mana_bpf.c drivers/net/ethernet/microsoft/mana/mana_en.c include/net/mana/mana.h+353 -470 replies
2/13net: mana: share the EQ pool across a queue-set swapdrivers/net/ethernet/microsoft/mana/mana_en.c include/net/mana/mana.h+76 -160 replies
3/13net: mana: swap queue sets in mana_set_channelsdrivers/net/ethernet/microsoft/mana/mana_bpf.c drivers/net/ethernet/microsoft/mana/mana_en.c drivers/net/ethernet/microsoft/mana/mana_ethtool.c +1 more+313 -320 replies
4/13net: mana: swap queue sets in mana_set_ringparamdrivers/net/ethernet/microsoft/mana/mana_ethtool.c+45 -230 replies
5/13net: mana: swap queue sets in mana_set_priv_flagsdrivers/net/ethernet/microsoft/mana/mana_ethtool.c+34 -380 replies
6/13net: mana: swap queue sets in mana_change_mtudrivers/net/ethernet/microsoft/mana/mana_en.c drivers/net/ethernet/microsoft/mana/mana_ethtool.c include/net/mana/mana.h+46 -240 replies
7/13net: mana: swap queue sets in mana_xdp_setdrivers/net/ethernet/microsoft/mana/mana_bpf.c drivers/net/ethernet/microsoft/mana/mana_en.c drivers/net/ethernet/microsoft/mana/mana_ethtool.c +1 more+46 -430 replies
8/13net: mana: do not bail out of mana_detach on dealloc failuredrivers/net/ethernet/microsoft/mana/mana_en.c+1 -30 replies
9/13net: mana: keep per-queue statistics in the port contextdrivers/net/ethernet/microsoft/mana/mana_bpf.c drivers/net/ethernet/microsoft/mana/mana_en.c drivers/net/ethernet/microsoft/mana/mana_ethtool.c +1 more+242 -440 replies
10/13net: mana: release EQs left idle by a channel-count reductiondrivers/net/ethernet/microsoft/mana/mana_en.c drivers/net/ethernet/microsoft/mana/mana_ethtool.c+41 -90 replies
11/13net: mana: keep a user-configured RSS table across a queue rebuilddrivers/net/ethernet/microsoft/mana/mana_en.c drivers/net/ethernet/microsoft/mana/mana_ethtool.c include/net/mana/mana.h+42 -40 replies
12/13net: mana: keep the surviving queues when the channel count is reduceddrivers/net/ethernet/microsoft/mana/mana_en.c drivers/net/ethernet/microsoft/mana/mana_ethtool.c include/net/mana/mana.h+143 -30 replies
13/13net: mana: keep the existing queues when the channel count is raiseddrivers/net/ethernet/microsoft/mana/mana_bpf.c drivers/net/ethernet/microsoft/mana/mana_en.c drivers/net/ethernet/microsoft/mana/mana_ethtool.c +2 more+217 -400 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v5 yet.

Read the v5 thread

Cover letter [PATCH net-next v5 00/13] net: mana: reconfigure by replacing the queue set

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/[email protected]/

[2] net: mana: do not discard an ethtool-configured RSS table on a queue rebuild
https://lore.kernel.org/all/[email protected]/

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 v5:

- Rebase onto net-next at ce48a0fdc564 ("Merge branch

    'dpll-fix-lies-in-the-netlink-spec'").

- Refresh patch 1's mana_bpf.c context after upstream commit 8d5f1bda7e8b ("net: mana: remove unreachable dead code in mana_bpf()"). This resolves v4's application failure caused by the removed "return ret;" context.
- No functional changes to the series; patches 2-13 are unchanged apart from rebasing.

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.
- Shorten comments and commit messages; correct failure-path, ownership and resource-limit descriptions. Document the two net submissions and their merge overlap.

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:
v4: https://lore.kernel.org/all/[email protected]/
v3: https://lore.kernel.org/all/[email protected]/
v2: https://patchwork.kernel.org/project/netdevbpf/list/?series=1145125
v1: https://lore.kernel.org/netdev/[email protected]/

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: ce48a0fdc56464b1afb03471dbdf38a5e0d571ad

Signature · 1 line
2.43.0