Intel® Ethernet Controller E810 Application Device Queues (ADQ)

Configuration Guide

ID 609008
Date 04/03/2023
Version 2.8
Document Table of Contents

Configure Independent Pollers

The following variables are used in the examples in this section:

$iface

The interface in use (PF).

$iface_​bdf

The network interface BDF notation (Bus:Device.Function) used by devlink (PF).

$queues

The number of queues in the TC.

$qps_​per_​poller

The number of queue pairs per independent poller for a given TC (max value is #queues in the TC).

$poller_​timeout

The timeout value for the independent pollers for a given TC (nonzero integer value in jiffies, default value 10000).

Note:Independent poller feature is currently supported on PF only (not supported on VF). Note:ADQ devlink parameters are only exposed when ADQ traffic class is configured via mqprio in Create TCs. Note:$poller_​timeout is specified in jiffies, where the size of a jiffy is determined by the kernel software clock as a measure of HZ. This differs from the global system settings for sysctl.net.core.busy_​poll and sysctl.net.core.busy_​read, which controls the number of microseconds to wait for packages on the device queue for socket selects (busy_​poll) and socket reads (busy_​read). A more detailed description of jiffies can be found in the Linux time(7) man page: https://man7.org/linux/man-pages/man7/time.7.html.

Setting global sysctl.net.core.busy_​poll and sysctl.net.core.busy_​read settings is NOT needed with ADQ independent poller configuration.

After creating TCs (in Create TCs):

  1. Set the interface BDF, needed for devlink param commands. iface_bdf=$(ethtool -i ${iface} | grep bus-info | awk '{print $2}')
  2. Set the number of queue pairs per poller for the TC. devlink dev param set pci/${iface_bdf} name tc1_qps_per_poller value \ $qps_per_poller cmode runtime Note:The example above is for TC1. Valid devlink param flags include tc1_​qps_​per_​poller through tc15_​qps_​per_​poller, to configure independent pollers on up to 16 TCs (max #TCs). If the TC does not exist, the devlink command will return error: devlink answers: Invalid argument Note:The maximum allowed value for $qps_​per_​poller is the number of $queues in the TC. If the $qps_​per_​poller value specified is greater than $queues, the following error will be returned by the ice driver: Error: ice: Value cannot be greater than number of queues in TC. devlink answers: Invalid argument
  3. Set the poller timeout value for the TC. devlink dev param set pci/${iface_bdf} name tc1_poller_timeout value \ $poller_timeout cmode runtime Note:The example above is for TC1. Valid devlink param flags include tc1_​poller_​timeout through tc15_​poller_​timeout, to configure independent poller timeout values on up to 16 TCs (max #TCs). If not specified, the default $poller_​timout is set to 10000 jiffies.
  4. Enable threaded napi. echo 1 > /sys/class/net/$iface/threaded Note:Independent pollers work with both threaded napi as well as default napi that runs in softirq context and triggers ksoftirqd threads.
  5. Pin Independent Poller kthreads to specific CPU cores. Note:Threaded napi must be enabled in order to pin application threads/pollers to specific CPU cores.
    1. Get the napi threads PIDs (order from highest to lowest). ps -x | grep "$iface" | head -n -1 | tac | awk '{print $1}'
    2. Affinitize all Poller threads to a specific CPU core (skipping the PIDs that are for non-polled queues). taskset -c 2 -p <pid of thread 2> taskset -c 2 -p <pid of thread 3> taskset -c 2 -p <pid of thread 4> taskset -c 2 -p <pid of thread 5> etc Note:Depending on the application workload, it is preferable to pin application threads and pollers to different CPU cores. If the application is not overly busy, running both types of threads on the same cores may yield better performance results.
  6. Verify independent pollers configuration.

    To query all devlink parameters:

    devlink dev param show

    To query a specific devlink parameter for the pci device:

    devlink dev param show pci/${iface_bdf} name tc1_qps_per_poller

Example Configuration Using devlink Commands

To configure 4 queues of TC1 to be polled by each independent poller:

# devlink dev param set pci/0000:3b:00.0 name tc1_qps_per_poller value 4 \ cmode runtime

If TC1 has a total of 8 $queues, the above command will configure 2 independent pollers, where each poller is used to poll 4 queues. If TC1 has a total of 16 $queues, the above command will configure 4 independent pollers, each polling 4 queues.

To set the timeout value in jiffies for TC1 when no traffic is flowing (setting to 5000 jiffies in this example, default is 10000 jiffies):

# devlink dev param set pci/0000:3b:00.0 name tc1_poller_timeout value 5000 \ cmode runtime Note:Clear the ADQ Configuration provides more information on clearing the ADQ configuration.

Example Configuration Using ADQ Setup Script

Note:The ADQ Setup script uses the pollers parameter with a value that specifies the total number of independent pollers to be configured for the TC. This differs from the devlink param commands above, which use the number of RX/TX queue pairs per poller. See ADQ Setup Using ADQ Setup Script for details on adqseup.

  1. To configure TC1 with 8 queues using 2 independent pollers (4 queue pairs per poller) with default poller timeout: # adqsetup --dev=ens8f0 create myapp queues 8 pollers 2 ports 7000
  2. To configure TC1 with 16 queues using 4 independent pollers (4 queue pairs per poller) with default poller timeout: # adqsetup --dev=ens8f0 create myapp queues 16 pollers 4 ports 7000
  3. To configure TC1 with 16 queues using 8 independent pollers (2 queue pairs per poller) with modified poller timeout of 5000 jiffies: # adqsetup --dev=ens8f0 create myapp queues 16 pollers 8 \ poller_timeout 5000 ports 7000 Note:The last example uses modified poller_​timeout argument (using underscore rather than hyphen). This is a known issue with adqsetup not recognizing poller-timeout, fixed in adqsetup v1.2.3. Note:The adqsetup examples above specify only the device and port (required) and parameters to configure independent pollers. Additional recommended parameters, depending on the workload:

    --priority=skbedit to configure clsact qdisc and create egress TC filters for Tx traffic (instead of using Linux cgroups to align Tx packets to queues)

    --rxadapt=off --rxusecs=0 --txadapt=off --txusecs=500 to set the interrupt moderation rate to a static value for Tx and turn off interrupt moderation for Rx. These values are recommended for most ADQ workloads. Setting rx-usecs to a non-zero value, such as 50 or 100, might improve interrupt handling and ADQ performance for certain applications and workloads. Experiment with rxusecs=0, 50, 100 to determine best ADQ performance.

    Note:Global system settings for --busypoll, --busyread, --optimize, --bpstop, and --bpstop-cfg are not used when pollers is specified. Independent pollers use the $poller_​timeout for the TC, rather than global sysctl settings.