Netdev List
 help / color / mirror / Atom feed
* [PATCH net-next v9 00/13] ibmveth: Add multi-queue RX support
@ 2026-12-01 19:02 Mingming Cao
  2026-12-01 19:02 ` [PATCH net-next v9 01/13] ibmveth: Keep a buffer pool enabled after its allocation fails Mingming Cao
                   ` (12 more replies)
  0 siblings, 13 replies; 14+ messages in thread
From: Mingming Cao @ 2026-12-01 19:02 UTC (permalink / raw)
  To: netdev
  Cc: Mingming Cao, maddy, mpe, npiggin, chleroy, ritesh.list, sshegde,
	nnac123, andrew+netdev, davem, edumazet, kuba, pabeni,
	linuxppc-dev, horms, davemarq, haren, ricklind, bjking1,
	shaik.abdulla1, willemb

ibmveth receives on a single RX queue with one interrupt, so all of a
virtual ethernet adapter's receive processing runs on one CPU. On
Power11, PHYP (the PowerVM hypervisor) can give the adapter several RX
queues, each with its own interrupt and buffers. TX is already
multi-queue; this series is about RX.

This is v9 of "ibmveth: Add multi-queue RX support" [3]. v8 patches
2-9 became "ibmveth: prepare the RX path for multi-queue" [1], now in
net-next, which made open/close, buffer pools, interrupts, replenish
and poll take a queue index, with IBMVETH_MAX_RX_QUEUES still 1. This
series is the rest of v8, reworked after Jakub's review [4], and turns
on multi-queue (MQ) RX on top of [1].

When firmware advertises MQ, ibmveth supports up to 16 RX queues. It
comes up with netif_get_num_default_rss_queues() of them, at most 8,
and ethtool -L can set 1 to 16. Older firmware stays single-queue.
PHYP picks the queue for each frame with a hash, so there is no RSS
configuration.

Patches 1-2 fix existing behavior and do not depend on the rest: 1
keeps a buffer pool enabled after its allocation fails, and 2 gives
each TX queue its own counters (today's TX queues race on shared
ones). One only matters after an allocation failure and the other
only loses statistics, so both go to net-next. The MQ patches build
on both, so they lead this series rather than go alone.

Patches 3-8 add MQ with it still off. 3-7 are the hypervisor calls
(hcalls): the hcall numbers (tools/perf names follow separately),
queue handles, subordinate queue registration, their interrupt
control, and the MQ buffer hcall. 8 starts every queue on open and
resume.

Patches 9-11 are RX statistics: per-queue RX counters, rx_no_buffer
kept across ifdown/up and reported as rx_missed_errors in ip -s link,
and per-queue qstats through netdev_stat_ops. ethtool -S keeps its
keys.

Patch 12 turns MQ on and raises IBMVETH_MAX_RX_QUEUES to 16. Patch 13
lets ethtool -L change the RX count (1-16) by closing and reopening
the device, as an MTU change does.

Each queue's buffers are refilled only from its own NAPI poll, and the
queue count only changes with the device closed, so the RX path takes
no locks.

Two error paths rely on PHYP behavior. An unexpected H_FUNCTION (hcall
not supported) from the MQ buffer hcall schedules a reset, and the
device is left down if it comes back after the reopen (patch 7). PHYP
fails H_FREE_LOGICAL_LAN only with H_PARAMETER, when no LAN is
registered. Any other failure in MQ mode leaks the RX memory, still
mapped, because PHYP may still write to it (patch 5).

Testing:

ppc64le W=1 build of ibmveth.o at every commit, no warnings.

ppc64le PowerVM LPAR (Power11, FW1130), MQ firmware (max RX 16),
iperf3 inbound traffic from a peer LPAR:
* ifdown/up churn, module reload, jumbo MTU, ethtool -L rx 1->8->16->1
  live and in down-state; 0 invalid buffers, 0 replenish failures
* ethtool -L cycling under iperf3 and 20 close/open rounds under load
* 300s parallel resize+churn stress; rx counters coherent across
  sysfs, ip -s link and /proc/net/dev throughout
* small-packet: about 1.6x the packet rate with 8 RX queues over one
  queue; this LPAR's VIOS (Virtual I/O Server) was on one socket

Changes in v9:

v8 was too large to review as one, and Jakub [4] suggested about
three smaller series. v8 patches 2-9 became [1], which addresses his
comments on them. This series is the rest of v8, cut down; together
with [1] it adds about 2100 lines, where v8 added 4300:
* ethtool -L closes and reopens the device instead of resizing live.
  That removes replenish_lock, H_FREE_LOGICAL_LAN_QUEUE, debugfs
  buffer_pools and the per-queue ethtool -S keys; qstats is the
  per-queue view. It also leaves ethtool -L as one small patch (13),
  so it ends this series instead of forming a third.
* v8 fell back to one queue when an MQ hcall returned H_FUNCTION.
  That is gone: PowerVM blocks Live Partition Migration to a host
  without MQ support, so the MQ hcalls cannot disappear under a
  running adapter.
* No defensive WARN_ON checks, and shorter commit messages, as [4]
  asked of the earlier patches.
* The two fixes come first: patch 1 is new (raised in review of [1]),
  and patch 2, the per-queue TX counters, was part of v8's statistics
  patch.
* The hcall numbers are a separate powerpc patch.

Based on net-next, which has the two ibmveth fixes [2] (eeb2b4377350,
60838e936e1c) and [1] (09a20f1c4a7d..ea25991402e7).

[1] https://lore.kernel.org/netdev/20261123075136.3278-1-mmc@linux.ibm.com/
[2] https://lore.kernel.org/netdev/20261123075102.2962-1-mmc@linux.ibm.com/
[3] https://lore.kernel.org/netdev/20261109235556.60604-1-mmc@linux.ibm.com/
[4] https://lore.kernel.org/netdev/20261116174225.7d9e9611@kernel.org/

Mingming Cao (13):
  ibmveth: Keep a buffer pool enabled after its allocation fails
  ibmveth: Keep TX statistics per queue
  powerpc/pseries: Add hcall numbers for multi-queue virtual ethernet
  ibmveth: Add RX queue handles
  ibmveth: Register subordinate RX queues
  ibmveth: Add subordinate RX queue interrupt control
  ibmveth: Add the MQ RX buffer submit hypercall
  ibmveth: Start every RX queue on open and resume
  ibmveth: Keep RX statistics per queue
  ibmveth: Keep rx_no_buffer across ifdown/up
  ibmveth: Report per-queue statistics through netdev_stat_ops
  ibmveth: Enable multi-queue RX
  ibmveth: Allow changing the RX queue count

 arch/powerpc/include/asm/hvcall.h  |    5 +-
 drivers/net/ethernet/ibm/ibmveth.c | 1022 +++++++++++++++++++++++++---
 drivers/net/ethernet/ibm/ibmveth.h |  170 ++++-
 3 files changed, 1075 insertions(+), 122 deletions(-)


base-commit: d7f7fac1c3220a430559c6d43904e27917ae1eb0
-- 
2.50.1 (Apple Git-155)


^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2026-12-01 19:03 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-01 19:02 [PATCH net-next v9 00/13] ibmveth: Add multi-queue RX support Mingming Cao
2026-12-01 19:02 ` [PATCH net-next v9 01/13] ibmveth: Keep a buffer pool enabled after its allocation fails Mingming Cao
2026-12-01 19:02 ` [PATCH net-next v9 02/13] ibmveth: Keep TX statistics per queue Mingming Cao
2026-12-01 19:02 ` [PATCH net-next v9 03/13] powerpc/pseries: Add hcall numbers for multi-queue virtual ethernet Mingming Cao
2026-12-01 19:02 ` [PATCH net-next v9 04/13] ibmveth: Add RX queue handles Mingming Cao
2026-12-01 19:02 ` [PATCH net-next v9 05/13] ibmveth: Register subordinate RX queues Mingming Cao
2026-12-01 19:02 ` [PATCH net-next v9 06/13] ibmveth: Add subordinate RX queue interrupt control Mingming Cao
2026-12-01 19:02 ` [PATCH net-next v9 07/13] ibmveth: Add the MQ RX buffer submit hypercall Mingming Cao
2026-12-01 19:02 ` [PATCH net-next v9 08/13] ibmveth: Start every RX queue on open and resume Mingming Cao
2026-12-01 19:02 ` [PATCH net-next v9 09/13] ibmveth: Keep RX statistics per queue Mingming Cao
2026-12-01 19:02 ` [PATCH net-next v9 10/13] ibmveth: Keep rx_no_buffer across ifdown/up Mingming Cao
2026-12-01 19:02 ` [PATCH net-next v9 11/13] ibmveth: Report per-queue statistics through netdev_stat_ops Mingming Cao
2026-12-01 19:02 ` [PATCH net-next v9 12/13] ibmveth: Enable multi-queue RX Mingming Cao
2026-12-01 19:02 ` [PATCH net-next v9 13/13] ibmveth: Allow changing the RX queue count Mingming Cao

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox