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

Re: [PATCH v2 0/4] XenVif receive backpressure adjustments


  • To: Tu Dinh <ngoc-tu.dinh@xxxxxxxxxx>, "win-pv-devel@xxxxxxxxxxxxxxxxxxxx" <win-pv-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Owen Smith <owen.smith@xxxxxxxxxx>
  • Date: Thu, 16 Jul 2026 07:07:37 +0000
  • Accept-language: en-GB, en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=GeGqKvSiVptpjN/sj9Tvpm8CgxJTagR7tVb1o6LCEeg=; b=JfvGw808HsjK5m6ksuvY9L+vc0MBu/lCr0sr8tOkevPXQqQ6lsZM7StFIOv49styZSHHh2qDUFQoFQb/MLGbzPmkXNlz1cz9/Ut0ul7k0y7ZDPm3eEpvimZr7/d9KuXbHB6FPHp4RiwDv0TvxteZX9+agmX4s1bDOIGSsZo4Y7/xN//tYzIAjwL5JQHRG0Zb2EmYc6UpxpuQ9E41Fcv8q5rfPnWCntl4uk+svUdZBdMp1bLA53i/rLUA4z4uEdEf975PjJdFMOTYCjh1Uu44XRIfNRg7n0ZC89xjFI3rzdLK8QAElIwVeVG7P3gCCaOu93q/R5kY5p+0aa5k7ARPpQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=wAn9orqTm7jzYJ397ZYZFmiHIGuAFAAA3eOpf5ykQxRQnyn84+rNgWriOVkYGUv1WX2wIoeZNzKAY6TsoK9hU1yCtljoaDxVMNbzmglZRFG0o37uVzXCQ+YXqfsSfQF1zXrudO3SE5CTtVrjFe9VfPg6DU8Bs+n5C7AYrGoprbRARWpytT1AwTWm3dSOdZIxgnTny5kPkjZFlIacoc3VAG1MqoQ3H+PqkfRuR9CFYLFUh6/khaWWNEa2lx1eTUFV3F5hMzGmeqNpdKqopt9SJ/O+63YyAleZ7124t+pTz9LDwjNRxvI9tD8SqQza0+QK5kTB4z5gqOTsQodYPUiO/w==
  • Authentication-results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=citrix.com header.i="@citrix.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:x-ms-exchange-senderadcheck"
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
  • Delivery-date: Thu, 16 Jul 2026 07:07:46 +0000
  • List-id: Developer list for the Windows PV Drivers subproject <win-pv-devel.lists.xenproject.org>
  • Msip_labels:
  • Thread-index: AQHdFENhaOXF1pK43Eia+CnvdkqscLZvus3f
  • Thread-topic: [PATCH v2 0/4] XenVif receive backpressure adjustments

This series on xenvif, and the cache logging change to xenbus
Reviewed-by: Owen Smith <owen.smith@xxxxxxxxxx>

________________________________________
From: win-pv-devel <win-pv-devel-bounces@xxxxxxxxxxxxxxxxxxxx> on behalf of Tu 
Dinh <ngoc-tu.dinh@xxxxxxxxxx>
Sent: 15 July 2026 11:18 AM
To: win-pv-devel@xxxxxxxxxxxxxxxxxxxx
Cc: Tu Dinh
Subject: [PATCH v2 0/4] XenVif receive backpressure adjustments

Changes in v2:
* The error message in ReceiverPacketCtor() has been kept, since that
  is a genuine OOM and not related to quota limits.
* The moving of __ReceiverRingReturnPacket has been split to a separate
  patch.
* CacheCreateSlab quota errors now only suppressed in release builds.

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 (4):
  Cap the size of the receiver PacketCache
  Move __ReceiverRingReturnPacket below ReceiverRingFill
  Conditionally restart the RX ring from packet return
  Avoid requeuing QueueDpc in __ReceiverRingSwizzle

 src/xenvif/receiver.c | 109 +++++++++++++++++++++++-------------------
 1 file changed, 61 insertions(+), 48 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®.