﻿# An XPS map change need not move an established flow

Account for cached socket transmit queues and safe reselection before judging whether a Linux XPS mapping change took effect.

Author: Retrivium team
Updated: 2026-11-06
Canonical URL: https://retrivium.ai/journal/linux-xps-socket-queue-cache-migration/
Language: en

## The map changed but the busy socket did not

An operator changes transmit steering and sees an established transfer continue using its previous queue. Reapplying the map repeatedly may not resolve anything because the map is not a command to move every live flow immediately. XPS selects transmit queues under a socket-lifetime and packet-ordering contract. Distinguish whether a setting was accepted from whether this particular connection reached a safe point to choose again.

## Identify the selection input

The [Linux networking scaling guide](https://docs.kernel.org/networking/scaling.html) describes CPU-to-transmit-queue and receive-queue-to-transmit-queue mappings. These serve different placement designs. Receive-queue mapping can be useful when a thread follows its connection's queue association rather than remaining pinned to one CPU. Record which map applies and the actual receiving association or running CPU used for selection. An application thread moving CPUs does not by itself prove that its transmit queue must move simultaneously.

## The socket caches a queue

The guide explains that the selected queue is stored in the socket and reused to avoid packet reordering and repeated selection cost. Changing it later depends on the transport marking a safe reselection condition. For TCP, the documented example marks that condition when all connection data has been acknowledged. A continuously busy transfer may therefore behave differently from a fresh connection after the same mapping update without indicating that the update failed.

## Inspect the actual ABI and queue set

The [network queue ABI](https://raw.githubusercontent.com/torvalds/linux/master/Documentation/ABI/testing/sysfs-class-net-queues) defines xps_cpus and xps_rxqs as masks associated with a transmit queue. Preserve the device, active queue set, effective maps and driver context. A map applied to a nonexistent or unused queue cannot establish distribution. The scaling guide also notes that a single-transmit-queue device has no alternative for XPS to select. Keep these capability and configuration facts separate from the cached state of a particular socket.

## Compare fresh and continuing flows

In an authorized isolated check, observe a continuing connection, a fresh connection and a connection that reaches the documented safe reselection condition. Hold workload and endpoint identity constant while recording queue-level activity and useful byte progress. Where available, use supported per-flow observations rather than inferring socket identity from aggregate queue totals alone. Acceptance should explain when the intended map participates in selection without forcing unsafe queue migration or declaring a lack of immediate movement a configuration error.

## Bound the placement claim

XPS does not choose the receive queue, change the route or guarantee lower latency for every message. Moving transmit work can alter completion processing and cache locality, so correctness and accepted workload behavior remain necessary checks. The [receive steering guide](/journal/guide-net-rss-queues/) describes the other direction, while [counter population accounting](/journal/guide-net-link-counters/) prevents a queue total from becoming an unsupported per-flow claim. Preserve the map generation and connection lifecycle together. That record distinguishes a stale socket selection from an unapplied policy without inventing an instant-remapping guarantee.
