This series lets a dpaa2 worker sleep on a queue's data-availability
notification instead of busy-polling, exposed through the generic
rte_eth_dev_rx_intr_* API (NAPI-style: poll while frames keep coming,
arm the interrupt and sleep when the queue runs dry).

Why it is not a trivial .rx_queue_intr_enable
----------------------------------------------
A worker wakes on its software portal's DQRI, which fires when the
portal's DQRR holds frames. The default dpaa2 Rx burst pulls frames
from the FQ with a volatile dequeue and cannot be interrupt-driven; to
wake on the DQRI the FQ must instead be pushed to the portal's DQRR.

The natural dpni_set_queue with a notification destination would have to
target the worker's portal, but that portal is only known once a worker
affines, after dev_start, and that MC command holds the global MC lock
long enough to wedge the firmware while traffic runs. So the bind cannot
be done late, against the polling lcore.

Design
------
Each Rx FQ is bound to its own DPCON channel, statically, at dev_start
while the dpni is still disabled (no knowledge of the polling lcore). A
worker later subscribes its own ethrx portal to the channel and arms the
DQRI in rx_queue_intr_enable, a one-shot per-portal op, never the wedging
set_queue. On a wakeup the worker drains each of its queues by a volatile
dequeue on the queue's own DPCON channel (one FQ per channel, so no
per-frame demux); it polls all its queues, the same scheduling contract
as plain DPDK polling. A queue can be re-homed to another lcore at
runtime with no set_queue and no port stop.

This reuses the event PMD's pushed/DQRR model but with one DPCON per FQ
and static affinity (no QBMan scheduling), so the DPCON allocator is
moved from the event driver to the fslmc bus and shared.

Patch 1 disables the DPCON channel before closing it, an event/dpaa2 fix
the shared allocator depends on. Patches 2 to 4 move the DPCON allocator
to the fslmc bus, make the portal DQRI epoll optional, and add the
dpcon_set_notification MC command. Patch 5 adds the interrupt support
proper; patch 6 pins each DPIO's MSI to the lcore that arms it, a latency
optimisation.

Tested on LX2160A (lx2160acex7).

v3:
- Reworked the Rx drain. Both versions bind one DPCON per FQ, but v2
  drained the shared portal DQRR and demuxed frames to their FQ by
  fqd_ctx, stashing foreign frames in a per-queue FIFO. v3 drains each
  queue with a volatile dequeue on its own channel (one FQ per channel),
  which drops the demux and stash code.
- Dropped the rx_queue_count fix; it is applied to main.
- Dropped the software VLAN strip patch; an independent net/dpaa2 cleanup,
  sent standalone and now applied to next-net.
- Dropped the Depends-on: the ethdev fast-path ops fix is now in main.
- Split the dpcon_set_notification MC command into its own patch.
- Added an event/dpaa2 fix to disable the DPCON channel before close,
  needed once the allocator is shared.
- Dropped the DQRI holdoff-tuning patch; the immediate-DQRI holdoff is now
  set inline in the arm path.
- Added a patch reusing the event driver's MSI-affinity helper (exposed
  from its RTE_EVENT_DPAA2 guard) to pin the portal MSI to the lcore that
  arms it, so a CDAN wake lands on the worker's own core.

v2:
- Dropped the RSS RETA patch, an independent net/dpaa2 change the
  interrupt path does not require; it will be sent as its own series.
- Dropped the ethdev fast-path ops fix; it is now a standalone series.
- Dropped the eal/interrupts -EEXIST fix, applied to main by David
  Marchand.
- Declared qbman_swp_interrupt_set_inhibit and qbman_swp_dqrr_size
  __rte_internal (David Marchand).
- Minor formatting cleanup in the Rx interrupt setup.

Maxime Leroy (6):
  event/dpaa2: disable channel before closing it
  bus/fslmc: move DPCON management from event driver to bus
  bus/fslmc/dpio: make the portal DQRI epoll optional
  bus/fslmc/mc: implement dpcon_set_notification
  net/dpaa2: support Rx queue interrupts
  net/dpaa2: pin Rx queue interrupt to the polling core

 doc/guides/nics/dpaa2.rst                     |  21 +
 doc/guides/nics/features/dpaa2.ini            |   1 +
 doc/guides/rel_notes/release_26_07.rst        |   1 +
 drivers/bus/fslmc/mc/dpcon.c                  |  31 ++
 drivers/bus/fslmc/mc/fsl_dpcon.h              |  18 +
 drivers/bus/fslmc/meson.build                 |   1 +
 .../fslmc/portal}/dpaa2_hw_dpcon.c            |  17 +-
 drivers/bus/fslmc/portal/dpaa2_hw_dpio.c      | 112 ++++--
 drivers/bus/fslmc/portal/dpaa2_hw_dpio.h      |  12 +
 drivers/bus/fslmc/portal/dpaa2_hw_pvt.h       |  12 +
 .../fslmc/qbman/include/fsl_qbman_portal.h    |   5 +
 drivers/bus/fslmc/qbman/qbman_portal.c        |   5 +
 drivers/event/dpaa2/dpaa2_eventdev.h          |   3 -
 drivers/event/dpaa2/meson.build               |   1 -
 drivers/net/dpaa2/dpaa2_ethdev.c              | 372 +++++++++++++++++-
 drivers/net/dpaa2/dpaa2_ethdev.h              |   4 +
 drivers/net/dpaa2/dpaa2_rxtx.c                | 104 +++--
 17 files changed, 649 insertions(+), 71 deletions(-)
 rename drivers/{event/dpaa2 => bus/fslmc/portal}/dpaa2_hw_dpcon.c (88%)


base-commit: 030328f5f920a87dabde54dacd4f5ac411ddcac9
-- 
2.43.0

Reply via email to