[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 0/3] XenVif receive backpressure adjustments


  • To: win-pv-devel@xxxxxxxxxxxxxxxxxxxx
  • From: Tu Dinh <ngoc-tu.dinh@xxxxxxxxxx>
  • Date: Sat, 11 Jul 2026 13:51:17 +0200
  • Authentication-results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=vates.tech header.i="@vates.tech" header.h="From:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:Feedback-ID"
  • Cc: Tu Dinh <ngoc-tu.dinh@xxxxxxxxxx>
  • Delivery-date: Sat, 11 Jul 2026 11:51:32 +0000
  • Feedback-id: default:8631fc262581453bbf619ec5b2062170:Sweego
  • List-id: Developer list for the Windows PV Drivers subproject <win-pv-devel.lists.xenproject.org>

To be accompanied with the Xenbus patch for suppressing quota-related
error messages in CacheCreateSlab.

Currently, traffic floods can cause anything from system lockups to
resource exhaustion (OOM) due to insufficient backpressure. The causes
are uncontrolled packet cache allocation, uncontrolled restarts and
queue DPC cascades.

An easy reproducer is to start a UDP flood from a Linux VM:

    #!/bin/sh

    set -e

    IFACE="enX0"  # replace with real VM's iface name
    SRC_MAC="02:00:00:00:00:01"
    DST_MAC="02:00:00:00:00:02"  # replace with real victim VIF's MAC
    DST_IP="192.0.2.1"  # replace with real victim VIF's IP
    UDP_PORT="9"

    modprobe pktgen
    PG=/proc/net/pktgen

    echo rem_device_all > "$PG/kpktgend_0"
    echo "add_device $IFACE" > "$PG/kpktgend_0"
    echo clone_skb 1000 > "$PG/$IFACE"
    echo pkt_size 60 > "$PG/$IFACE"
    echo count 0 > "$PG/$IFACE"
    echo delay 0 > "$PG/$IFACE"
    echo "dst_mac $DST_MAC" > "$PG/$IFACE"
    echo "src_mac $SRC_MAC" > "$PG/$IFACE"
    echo "dst $DST_IP" > "$PG/$IFACE"
    echo "dst_min $DST_IP" > "$PG/$IFACE"
    echo "dst_max $DST_IP" > "$PG/$IFACE"
    echo "udp_dst_min $UDP_PORT" > "$PG/$IFACE"
    echo "udp_dst_max $UDP_PORT" > "$PG/$IFACE"

    echo start > "$PG/pgctrl"

To stop:

    echo stop > /proc/net/pktgen/pgctrl

The following patches attempt to address this problem by adding
backpressure at key exhaustion-prone locations (packet cache size, ring
restart behavior, ring unpause behavior). With these patches, the victim
VM's system and networking remain responsive throughout the flood.

Tu Dinh (3):
  Cap the size of the receiver PacketCache
  Conditionally restart the RX ring from packet return
  Avoid requeuing QueueDpc during ring swizzles

 src/xenvif/receiver.c | 113 +++++++++++++++++++++++-------------------
 1 file changed, 63 insertions(+), 50 deletions(-)

--
2.54.0.windows.1


--
Ngoc Tu Dinh | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates solutions

web: https://vates.tech

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.