Help Center/ Huawei Cloud EulerOS/ FAQs/ How Do I Configure XPS? Does XPS Affect the System?
Updated on 2025-10-09 GMT+08:00

How Do I Configure XPS? Does XPS Affect the System?

What Is XPS

Transmit Packet Steering (XPS) is designed to send data packets to specific transmit queues in a system with multi-queue NICs. It maps CPUs to transmit queues so that the kernel can automatically select transmit queues associated with a CPU. The kernel records the transmit queue selected for the first packet of a data flow and uses the queue to transmit subsequent packets. This reduces the overhead of selecting transmit queues for each packet.

XPS has the following advantages:

  • Less competition of different CPUs for the same transmit queue reduces lock conflicts when NIC queues send data. The data packet transmission efficiency is improved.
  • The mapping between transmit queues and CPUs is consistent with the queue affinity of VirtIO NICs. This reduces cache misses during packet sending and cache invalidation caused by lock contention and thereby improves network transmission performance.

Configuring XPS

  1. Check whether XPS is configured for your instance. (Ensure that CONFIG_XPS is enabled in the kernel.)

    NIC eth0 is used as an example.

    cat /sys/class/net/eth0/queues/tx-*/xps_cpus                                                                         

  2. Configure XPS based on the number of CPUs and transmit queues. For details, see Enabling NIC Multi-Queue.
  3. (Optional) Check whether XPS is configured.

    NIC eth0 is used as an example.

    cat /sys/class/net/eth0/queues/tx-*/xps_cpus

    As shown in the following figure (the result varies depending on the number of CPUs and queues), XPS is configured.

Impacts

Although XPS is configured to improve network performance, network performance may be affected by XPS. If this problem occurs, run the following command to delete the XPS configuration: NIC eth0 is used as an example.

sudo sh -c 'for txq in /sys/class/net/eth0/queues/tx-*; do echo 0 > $txq/xps_cpus; done'