General
Worker Thread mode is one of XLIO execution modes. See XLIO Library Architecture for information about XLIO execution modes.
Once Worker Threads Mode is selected, 3 possible polling modes are available:
-
Busy polling. In the mode, each worker thread constantly polls the HW queues for incoming traffic, never going to sleep. This means that every worker thread consumes an entire CPU core (Assuming the Linux scheduler allows it). This mode provides the lowest latency of all 3 polling modes, at the expense of high CPU usage.
-
Bounded polling. In this mode, each worker thread polls the HW queues for incoming traffic, and after a certain duration of non-activity, it goes to sleep and waits for a HW interrupt in order to respond to incoming traffic. The poll duration is configurable. In this mode, when traffic lower, CPU power is saved. The downside is that latency goes up because some packets need to wait for HW to wake up the worker thread.
-
Interrupt mode. In this mode the worker thread goes to sleep immediately after a single poll of the HW queues which produces no work. It is the least CPU-consuming mode, and it also has the highest latency.
Configuration
See XLIO Parameters for information on how to configure XLIO in general.
The example below use the XLIO_INLINE_CONFIG format, for clarity, but as with all configuration parameters, they can also be set using a .json file or by using environment variables.
Configuring Worker Threads Mode
To configure Worker Threads Mode, set the amount of XLIO worker threads to the desired amount of XLIO worker threads, like this:
performance.threading.worker_threads=2
(Matching environment variable name: XLIO_WORKER_THREADS)
The default value 0 disables Worker Threads Mode and selects R2C execution mode.
Configuring the polling mode
To select which polling mode to use, set performance.polling.iomux.poll_usec as described below.
(Matching environment variable name: XLIO_SELECT_POLL)
-
Busy polling: Use the value
-1 -
Bounded polling: Use a value which is the desired poll duration in microseconds, e.g.
1000configures 1 millisecond of polling without activity before going to sleep -
Interrupt mode: Use the value
0
The default value for this variable is 10000, configuring 10 milliseconds of polling without activity before going to sleep.
Statistics
See 'Worker Threads Mode - Entity Context Statistics' section in Monitoring via xlio_stats for information about tracking Worker Threads statistics with xlio_stats tool.
Common Issues and Solutions
Low throughput
-
Increase number of worker threads
-
Check for CPU bottlenecks
-
Verify buffer configuration
CPU usage concerns
-
Adjust worker threads count
-
Consider CPU pinning
-
Monitor worker thread utilization
High latency
-
Check CPU affinity settings
-
Monitor job queue sizes
-
Increase the poll duration
Last updated: