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 v3 0/7] net/virtio: fix Rx interrupts with MSI-X
Date: Wed, 18 Nov 2026 02:19:11 +0200	[thread overview]
Message-ID: <20261118001918.990884-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, and it cannot be
configured a second time. For example, l3fwd-power fails to start on
it.

Patch 1 is the fix, for 26.11 and stable. The other patches can wait
for 27.03.

- Patch 2 fixes a packet loss on virtio-user ports with vhost-net.
  The unit test of v2 found it. 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 queue pairs, and they are lost. The
  driver detached these queues before 21.11.
- Patch 3 is a unit test of it, on a virtio-user port with two queue
  pairs and one Rx queue.
- Patch 4 adds a unit test of Rx interrupts on that port. Without the
  check of the interrupt handle type in patch 1, this test fails
  ("EAL: Wrong intr vector number"). This is why patch 1 has that
  check.
- Patch 5 adds a testpmd option, --rxq-interrupt. With it, idle
  forwarding lcores sleep on the Rx queue interrupts, as l3fwd-power
  does. It will need a line in the 27.03 release notes.
- Patches 6 and 7 add a DTS suite that uses this option. It has two
  test cases. In the first, each packet sent to the port must wake
  the lcore up, also after the port is configured a second time with
  the same number of queues. The second does the same after the
  number of queues changed, to two queues and back to one. With two
  queues, both must receive packets. It is skipped if the port cannot
  have two queues, or if the packets do not reach both.

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

- l3fwd-power in interrupt-only mode on a virtio-net PCI port. Without
  patch 1 it fails as in the commit message. With it, each packet
  wakes its lcore up.
- The DTS suite on a virtio-net PCI port. Without patch 1 both test
  cases fail at the second configuration. With it, they pass. They
  also pass on an emulated Intel 82576 port (igb driver). On a
  virtio-net port with one queue pair, the second test case is
  skipped.
- testpmd, receiving, on a virtio-user port with two queue pairs,
  while the kernel sends 64 UDP flows on the TAP interface. With one
  Rx queue, 22 flows arrive without patch 2, and all 64 with it. With
  two Rx queues, all arrive with and without 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. Without patch 2, the first one fails. Without
  the handle type check of patch 1, the second one fails.

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, with testpmd too, since commit 67813957d8
("interrupts: warn on leaked event FDs"), because virtio-user frees
its interrupt handle before it closes its call fds.

v3:
- Patches 2 and 3 are 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. Patch 2 fixes that
  in the driver.
- Patch 4 is that unit test, on top of patch 3. Its frame is now an
  IPv4 one.
- Patch 5: testpmd logs an error when the interrupt of an Rx queue
  cannot be registered (AI review).
- Patches 1, 6 and 7 are unchanged.

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 are new.

Patches generated with AI assistance.

Isaac Boukris (7):
  net/virtio: fix Rx interrupt setup with MSI-X
  net/virtio-user: fix packet loss with unused queue pairs
  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                        |  93 ++++-
 app/test-pmd/testpmd.h                        |   2 +
 app/test/meson.build                          |   1 +
 app/test/test_pmd_virtio_user.c               | 339 ++++++++++++++++++
 doc/api/dts/tests.TestSuite_rx_interrupt.rst  |   8 +
 doc/guides/testpmd_app_ug/run_app.rst         |   8 +
 drivers/net/virtio/virtio_ethdev.c            |  18 +-
 drivers/net/virtio/virtio_user/vhost_kernel.c |  12 +
 .../net/virtio/virtio_user/vhost_kernel_tap.c |  14 +
 .../net/virtio/virtio_user/vhost_kernel_tap.h |   4 +
 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           | 122 +++++++
 16 files changed, 635 insertions(+), 7 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  0:19 UTC|newest]

Thread overview: 18+ 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 ` Isaac Boukris [this message]
2026-11-18  0:19   ` [PATCH v3 1/7] net/virtio: fix Rx interrupt setup with MSI-X 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

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=20261118001918.990884-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