DPDK-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Isaac Boukris <iboukris@gmail.com>
To: Maxime Coquelin <maxime.coquelin@redhat.com>,
	Chenbo Xia <chenbox@nvidia.com>
Cc: dev@dpdk.org, David Marchand <david.marchand@redhat.com>,
	Aman Singh <aman.deep.singh@intel.com>,
	Luca Vizzarro <luca.vizzarro@arm.com>,
	Patrick Robb <patrickrobb1997@gmail.com>,
	Isaac Boukris <iboukris@gmail.com>
Subject: [PATCH v4 0/8] net/virtio: fix Rx interrupts with MSI-X
Date: Wed, 18 Nov 2026 10:27:44 +0200	[thread overview]
Message-ID: <20261118082752.1043794-1-iboukris@gmail.com> (raw)
In-Reply-To: <20261117124303.717447-1-iboukris@gmail.com>

Since 26.11-rc2, a virtio-net PCI device on vfio-pci cannot be
configured with Rx interrupts and an offload or RSS, nor configured a
second time. l3fwd-power fails to start on it.

Patch 1 is the fix, for 26.11 and stable. The others can wait for
27.03:

- Patch 2 fixes a packet loss on virtio-user ports with vhost-net,
  which the unit test of v2 found. When the application uses fewer Rx
  queues than the port has queue pairs, the kernel still sends flows
  to the TAP queues of the unused pairs. The driver detached these
  queues before 21.11.
- Patch 3 fixes unaligned reads in virtio-user's control queue, which
  the sanitizer reports on the port of the unit tests.
- Patch 4 is a unit test of patch 2, on a virtio-user port with two
  queue pairs and one Rx queue.
- Patch 5 is a unit test of Rx interrupts on that port. It fails
  without the handle type check of patch 1 ("EAL: Wrong intr vector
  number"), which is why patch 1 has that check.
- Patch 6 adds testpmd's --rxq-interrupt. Idle forwarding lcores then
  sleep on the Rx queue interrupts, as l3fwd-power does. It will need
  a line in the 27.03 release notes.
- Patches 7 and 8 add a DTS suite that uses it. Each packet must wake
  the lcore up, also after the port is configured again with the same
  number of queues (first case), and with two queues and then one
  (second case, where both queues must receive packets).

Tested in a VM (QEMU 10.2, vhost-net):

- l3fwd-power in interrupt-only mode on a virtio-net PCI port fails
  without patch 1, as in its commit message. With it, each packet
  wakes its lcore up.
- The DTS suite on a virtio-net PCI port fails without patch 1 at the
  second configuration, and passes with it. It also passes on an
  emulated Intel 82576 port (igb).
- testpmd on a virtio-user port with two queue pairs and one Rx queue
  receives 22 of 64 UDP flows from the kernel without patch 2, and
  all 64 with it. A port of the TAP driver, and a virtio-net PCI port
  of QEMU with four queue pairs, receive all 64 on one Rx queue.
- The unit tests pass, also with ASan and UBSan. The first fails
  without patch 2, and the second without the handle type check of
  patch 1. UBSan reports the unaligned read without patch 3.

The unit tests log "Some interrupt handle is leaking an event FD" when
they close their port. This series does not cause it. main logs it
for any virtio-user port since commit 67813957d8 ("interrupts: warn
on leaked event FDs"), because virtio-user frees its interrupt handle
before it closes its call fds.

v4:
- Patch 3 is new.
- Patch 2 detaches the TAP queue again when a later step of the
  enable fails. One comment now says when a queue is attached, and
  why TUNSETQUEUE is not called twice for a state (AI review).
- Patch 4 ignores a flow number that is out of range (AI review).
- Patch 5 asks for the Rx offload without checking the capability
  first.
- Shorter commit messages and comments in all patches. Patches 1, 6,
  7 and 8 have no code change.

v3:
- The fix of the packet loss and its unit test were new. In v2, the
  unit test of Rx interrupts failed on about half of the CI hosts,
  because the kernel sent its frame to the TAP queue of the unused
  queue pair.
- The unit test of Rx interrupts moved on top of them, with an IPv4
  frame.
- testpmd logs an error when the interrupt of an Rx queue cannot be
  registered (AI review).

v2:
- Patch 1 keeps the eventfds when the number of Rx queues did not
  change (David Marchand). It releases them only when the number
  changed, and only then must an application register the Rx queue
  interrupts again.
- The unit test, the testpmd option and the DTS suite were new.

Patches generated with AI assistance.

Isaac Boukris (8):
  net/virtio: fix Rx interrupt setup with MSI-X
  net/virtio-user: fix packet loss with unused queue pairs
  net/virtio-user: fix unaligned reads of control commands
  test/virtio_user: add unit test of unused queue pairs
  test/virtio_user: add unit test of Rx interrupts
  app/testpmd: add Rx queue interrupts option
  dts: support virtio PCI ports
  dts: add Rx interrupt test suite

 MAINTAINERS                                   |   1 +
 app/test-pmd/parameters.c                     |   8 +
 app/test-pmd/testpmd.c                        |  89 ++++-
 app/test-pmd/testpmd.h                        |   2 +
 app/test/meson.build                          |   1 +
 app/test/test_pmd_virtio_user.c               | 327 ++++++++++++++++++
 doc/api/dts/tests.TestSuite_rx_interrupt.rst  |   8 +
 doc/guides/testpmd_app_ug/run_app.rst         |   7 +
 drivers/net/virtio/virtio_ethdev.c            |  18 +-
 drivers/net/virtio/virtio_user/vhost_kernel.c |  24 +-
 .../net/virtio/virtio_user/vhost_kernel_tap.c |  14 +
 .../net/virtio/virtio_user/vhost_kernel_tap.h |   4 +
 .../net/virtio/virtio_user/virtio_user_dev.c  |  26 +-
 dts/api/params/types.py                       |   1 +
 dts/api/testpmd/config.py                     |   2 +
 dts/framework/testbed_model/linux_session.py  |   9 +-
 dts/tests/TestSuite_rx_interrupt.py           | 119 +++++++
 17 files changed, 637 insertions(+), 23 deletions(-)
 create mode 100644 app/test/test_pmd_virtio_user.c
 create mode 100644 doc/api/dts/tests.TestSuite_rx_interrupt.rst
 create mode 100644 dts/tests/TestSuite_rx_interrupt.py

-- 
2.56.1


  parent reply	other threads:[~2026-11-18  8:28 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-17 12:43 [PATCH 0/1] net/virtio: fix Rx interrupts with MSI-X Isaac Boukris
2026-11-17 12:43 ` [PATCH 1/1] net/virtio: fix Rx interrupt setup " Isaac Boukris
2026-11-17 14:29   ` David Marchand
2026-11-17 19:51     ` Isaac Boukris
2026-11-17 21:59 ` [PATCH v2 0/5] net/virtio: fix Rx interrupts " Isaac Boukris
2026-11-17 21:59   ` [PATCH v2 1/5] net/virtio: fix Rx interrupt setup " Isaac Boukris
2026-11-17 21:59   ` [PATCH v2 2/5] test/virtio_user: add unit test of Rx interrupts Isaac Boukris
2026-11-17 21:59   ` [PATCH v2 3/5] app/testpmd: add Rx queue interrupts option Isaac Boukris
2026-11-17 22:00   ` [PATCH v2 4/5] dts: support virtio PCI ports Isaac Boukris
2026-11-17 22:00   ` [PATCH v2 5/5] dts: add Rx interrupt test suite Isaac Boukris
2026-11-18  0:19 ` [PATCH v3 0/7] net/virtio: fix Rx interrupts with MSI-X Isaac Boukris
2026-11-18  0:19   ` [PATCH v3 1/7] net/virtio: fix Rx interrupt setup " Isaac Boukris
2026-11-18  0:19   ` [PATCH v3 2/7] net/virtio-user: fix packet loss with unused queue pairs Isaac Boukris
2026-11-18  0:19   ` [PATCH v3 3/7] test/virtio_user: add unit test of " Isaac Boukris
2026-11-18  0:19   ` [PATCH v3 4/7] test/virtio_user: add unit test of Rx interrupts Isaac Boukris
2026-11-18  0:19   ` [PATCH v3 5/7] app/testpmd: add Rx queue interrupts option Isaac Boukris
2026-11-18  0:19   ` [PATCH v3 6/7] dts: support virtio PCI ports Isaac Boukris
2026-11-18  0:19   ` [PATCH v3 7/7] dts: add Rx interrupt test suite Isaac Boukris
2026-11-18  8:27 ` Isaac Boukris [this message]
2026-11-18  8:27   ` [PATCH v4 1/8] net/virtio: fix Rx interrupt setup with MSI-X Isaac Boukris
2026-11-18  8:27   ` [PATCH v4 2/8] net/virtio-user: fix packet loss with unused queue pairs Isaac Boukris
2026-11-18  8:27   ` [PATCH v4 3/8] net/virtio-user: fix unaligned reads of control commands Isaac Boukris
2026-11-18  8:27   ` [PATCH v4 4/8] test/virtio_user: add unit test of unused queue pairs Isaac Boukris
2026-11-18  8:27   ` [PATCH v4 5/8] test/virtio_user: add unit test of Rx interrupts Isaac Boukris
2026-11-18  8:27   ` [PATCH v4 6/8] app/testpmd: add Rx queue interrupts option Isaac Boukris
2026-11-18  8:27   ` [PATCH v4 7/8] dts: support virtio PCI ports Isaac Boukris
2026-11-18  8:27   ` [PATCH v4 8/8] dts: add Rx interrupt test suite Isaac Boukris

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=20261118082752.1043794-1-iboukris@gmail.com \
    --to=iboukris@gmail.com \
    --cc=aman.deep.singh@intel.com \
    --cc=chenbox@nvidia.com \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=luca.vizzarro@arm.com \
    --cc=maxime.coquelin@redhat.com \
    --cc=patrickrobb1997@gmail.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