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 specific 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:
- CPUs do not have to compete as much for the same transmit queue, which reduces lock conflicts when NIC queues send data. Transmission is more efficient.
- 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
- 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

- Configure XPS based on the number of CPUs and transmit queues. For details, see Enabling NIC Multi-Queue.
- (Optional) Check whether XPS is configured.
NIC eth0 is used as an example.
cat /sys/class/net/eth0/queues/tx-*/xps_cpus
The output depends on how many CPUs and queues there are. In the output shown here, XPS has been configured.

Clearing XPS
Although XPS is configured to improve network performance, network performance may be affected by XPS. If this problem occurs, run the command below to delete the XPS configuration. eth0 is the NIC that XPS was configured for.
sudo sh -c 'for txq in /sys/class/net/eth0/queues/tx-*; do echo 0 > $txq/xps_cpus; done'
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot