[PATCH v10 0/2] This patch series implements VirtIO network notification coalescing

Koushik Dutta posted 2 patches 1 week, 2 days ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20260716134421.3765533-1-kdutta@redhat.com
Maintainers: "Michael S. Tsirkin" <mst@redhat.com>, Jason Wang <jasowangio@gmail.com>, Stefano Garzarella <sgarzare@redhat.com>
hw/net/virtio-net.c            | 244 ++++++++++++++++++++++++++++++---
include/hw/virtio/virtio-net.h |  11 ++
net/passt.c                    |   1 +
net/tap.c                      |   1 +
net/vhost-user.c               |   1 +
net/vhost-vdpa.c               |   1 +
6 files changed, 241 insertions(+), 18 deletions(-)
[PATCH v10 0/2] This patch series implements VirtIO network notification coalescing
Posted by Koushik Dutta 1 week, 2 days ago
reduce interrupt overhead by configuring coalescing parameters via
ethtool.

Changes in v10:
---------------
  - Organized coalescing fields into VirtIONetCoal structure
  - Renamed property to x-vq_notf_coal
  - Fixed TX notification coalescing to delay interrupts, not packet
    transmission
  - Added performance benchmark data

Feature Overview:
-----------------
The notification coalescing feature allows guests to configure interrupt
coalescing parameters using standard ethtool commands:

  ethtool -C <interface> rx-usecs <N> rx-frames <M>
  ethtool -C <interface> tx-usecs <N> tx-frames <M>

The device will delay interrupt notifications until either:
  - N microseconds have elapsed since the first packet, OR
  - M packets have been processed

This reduces interrupt overhead without delaying packet transmission.

Performance Results:
-------------------

Test                      Throughput           CPU Usage       IRQ/sec
---------------------------------------------------------------------------------
Without Coalescing        9.75 Gbits/sec       41.59%          451
LIGHT_COALESCING          9.43 Gbits/sec       39.92%          431
MODERATE_COALESCING       9.38 Gbits/sec       32.71%          280
AGGRESSIVE_COALESCING     9.64 Gbits/sec       31.26%          116
---------------------------------------------------------------------------------
LIGHT_COALESCING:  RX: 100µs, 5 frames, TX: 150µs, 5 frames
MODERATE_COALESCING: RX: 1000µs, 10 frames, TX: 2000µs, 20 frames
AGGRESSIVE_COALESCING: RX: 5000µs, 50 frames, TX: 5000µs, 50 frames

Moderate Coalescing vs without coalescing:
  CPU Usage Reduction:  20.0%
  Interrupt Reduction:  30.0%

Key findings:
  - Throughput remains virtually unchanged (packet transmission is immediate)
  - CPU usage reduced by 25% due to fewer interrupt context switches
  - Interrupt rate reduced by 74% (451 → 116 interrupts/sec)

Koushik Dutta (2):
  Introduce virtio_net_handle_tx_dispatch() to unify TX path handling.
    This dispatcher dynamically selects between timer-based and BH-based
    TX processing based on configuration.
  Implement VirtIO Network Notification Coalescing
    (VIRTIO_NET_F_NOTF_COAL). This allows guests to reduce interrupt
    overhead by configuring coalescing parameters via ethtool -C for
    both RX and TX paths.

Koushik Dutta (2):
  Introduce virtio_net_handle_tx_dispatch() to unify TX path handling.
    This dispatcher dynamically selects between timer-based and BH-based
    TX processing based on configuration.
  Implement VirtIO Network Notification Coalescing
    (VIRTIO_NET_F_NOTF_COAL). This allows guests to reduce interrupt
    overhead by configuring coalescing parameters via ethtool -C for
    both RX and TX paths.

 hw/net/virtio-net.c            | 244 ++++++++++++++++++++++++++++++---
 include/hw/virtio/virtio-net.h |  11 ++
 net/passt.c                    |   1 +
 net/tap.c                      |   1 +
 net/vhost-user.c               |   1 +
 net/vhost-vdpa.c               |   1 +
 6 files changed, 241 insertions(+), 18 deletions(-)

-- 
2.53.0