Package: adqsetup
adqsetupSPDX-License-Identifier: BSD-3-ClauseCopyright (c) 2022, Intel CorporationDependencies:Python 2.7-3.10Distro Support:Redhat:7.1-9.xFedora:28-35Ubuntu:19.04-22.04Debian:11InstallationPython Package Index (pip):python -m pip install adqsetupIncluded with driver:python scripts/adqsetup/adqsetup.py installUsageThe basic usage is:adqsetup [options] <command> [parameters ...]Please see the output ofadqsetup helpfor a complete list of
command line options.Commandshelp:Show help messageexamples:Create an 'examples' subdirectoryThe examples subdirectory - created in the current directory -
contains a set of sample config filesapply {filename}:Apply a config file{filename}:Config file (relative or full path)If empty or '-', config file is read from stdin.create { [{name}] { {key} {value} }... }...:Create a config from the command lineEach section consisting of a bracketed name and one or more {key} {value} pairs.[{name}]:User-defined name of sectionMust be unique within a configuration, '[globals]' is reserved but can be used.{key}{value}:Configuration ParameterOne or more space-seperated key and value pairs.
See the above Class Configuration Parameter list for possible keys and values.reset:Remove ADQ traffic classes and filtersAttempts to perform a cleanup of any ADQ-related setup.
Note: '--priority=skbedit' option must be included to remove the egress filters.persist {filename}:Persist a config file across rebootsCreates a systemd service unit set to run once on boot after the network is running.
One config per network interface, new configs overwrite old ones.{filename}:Config file (relative or full path)If empty or '-', config file is read from stdin.install:Install the adqsetup scriptInstalls the current script at /usr/local/binConfiguration ParametersGlobals Sectionarpfilter: (bool)Enable selective ARP activitybpstop: (bool)Channel-packet-clean-bp-stop featurebpstop-cfg: (bool)Channel-packet-clean-bp-stop-cfg featurebusypoll: (integer)busy_poll valuebusyread: (integer)busy_read valuecpus: (integer list|'auto')CPUs to use for handling 'default'
traffic, default 'auto'numa: (integer|'local'|'remote'|'all')Numa node to use for 'default'
traffic, default 'all' (prefer local)dev: (string)Network interface device to configureoptimize: (bool)Channel-inspect-optimize featurepriority: ('skbedit')Method to use for setting socket priority, default nonequeues: (integer)Number of queues in 'default' traffic class, default 2txring: (integer)Transmit ring buffer sizetxadapt: (bool)Adaptive transmit interrupt coalescingtxusecs: (integer)Usecs for transmit interrupt coalescingrxring: (integer)Receive ring buffer sizerxadapt: (bool)Adaptive receive interrupt coalescingrxusecs: (integer)Usecs for receive interrupt coalescingUser-defined Section (for each application or traffic class)addrs: (string list)Local IP addresses of trafficcpus: (integer list|'auto')CPUs to use for handling traffic,
default 'auto'mode: ('exclusive'|'shared')Mode for traffic classnuma: (integer|'local'|'remote'|'all')Numa node to use for traffic,
default 'all' (prefer local)pollers: (integer)Number of independent pollers, default 0poller-timeout: (integer)Independent poller timeout value,
default 10000ports: (integer list)Local IP ports of trafficprotocol: ('tcp'|'udp')IP Protocol of trafficqueues: (integer)Number of queues in traffic classremote-addrs: (string list)Remote IP addresses of trafficremote-ports: (integer list)Remote IP ports of trafficSample Usageadqsetup help
adqsetup examples

adqsetup apply memcached.conf
adqsetup --dev=eth4 apply nginx.conf
adqsetup --dev=eth3 persist eth3.conf

cat memcached.conf | adqsetup apply

adqsetup create [myapp] queues 4 ports 11211

adqsetup --verbose create \
  [globals] priority skbedit \
  [myapp] queues 2 ports 11211

adqsetup --verbose create \
  [app1] mode shared queues 4 ports 6379-6382
  [app2] queues 2 ports 11211 pollers 2Sample Usage Bash Script#!/bin/bash 
QUEUES=8
# this will loop through a range
# of busy_poll values
for BP in {10000..50000..5000}; do 
    adqsetup create [globals] busypoll $BP [nginx] queues $QUEUES ports 80
    # run test here
doneSample Usage With Pipes From Bash Script#!/bin/bash 
QUEUES=8
# this will loop through a range
# of busy_poll values
for BP in {10000..20000..5000}; do 
adqsetup apply <<EOF
    [globals]
    dev=eth2
    busypoll=$BP
    [nginx]
    queues=$QUEUES
    ports=80
EOF
# run test here
doneSample Usage With Pipes From External Scriptpython makeconf.py | adqsetup --json applymakeconf.pyimport json
conf = {
    "globals": {
        "dev": "eth2",
        "busypull": 10000
    },
    "app1": {
        "queues": 4,
        "ports": "80,443"
    }
}
print(json.dumps(conf))NotesTo load/use a different device driver while creating the setup,
the--driverparameter may be used. Device driver path is the full path
to the .ko file (ex: ice-1.9.x/src/ice.ko). Interfacemustbe set to
come up automatically with an ip address (via NetworkManager or other).
adqsetup will wait up to three seconds for this to occur before erroring out.
Conversely, you can load the driver and setup the interface manually
before running the adqsetup.The independentpollersargument passed to adqsetup doesn’t map directly
to theqps_per_pollerarguments passed to the driver. adqsetup
allows the user to specify how many pollers for a particular TC instead of
having to specify qps_per_poller.adqsetup 1.x required updated versions of the 'tc', 'ethtool', and 'devlink'
commands to be installed on the system. With adqsetup 2.x and onward, this
requirement has been removed.Common IssuesIf you get a/usr/bin/env: ‘python’: No such file or directoryerror
when you run the script, please install Python. If you have already installed
Python, then trywhereis pythonand you should see a message like:python: /usr/bin/python2.7 /usr/bin/python3.6 /usr/bin/python3.6m /usr/bin/python3.9on the first line of the output. Either run the version you wish to use
manually:python3.6 adqsetup.py help, or create a 'python' symbolic
link on the path:ln -s /usr/bin/python3.6 /usr/local/bin/pythonMany advanced features, such aspollersand the per-tc flow director may
not be supported by older versions of the driver or kernel. adqsetup
will attempt to use an equivalent fallback feature, and if none are available
a descriptive error will be provided. Please refer to the ADQ Config Guide for
more information.Other IssuesPlease run the malfunctioning config with the command line--debugoption,
which should include a short stack trace at the end of the output. Send the
configuration file (if used), full commmand line, and program output to your
Intel support contact.JSON Supportadqsetup accepts configurations in the JSON format from either a file or stdin
with the--jsonoption. Parameters are the same as listed above, using the
following basic structure:{
    "globals": {
        "dev": "eth4",
        "priority": "skbedit"
    },
    "app1": {
        "queues": 2,
        "ports": 11211
    },
    "app2": {
        "queues": 4,
        "mode": "shared",
        "ports": "6379-6382"
    }
}