Intel® Ethernet Controller E810 Application Device Queues (ADQ)

Configuration Guide

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

Example: Running DPDK-pktgen Traffic

This section provides an example for how to configure a standard server with a DPDK-pktgen software packet generator to generate network traffic to exercise the AF_​XDP server configured in AF_​XDP Server Configuration. Note that the server generating the traffic does not have to be configured with ADQ.

Note:This is not intended to be a complete DPDK-pktgen configuration guide. Refer to the Intel® Ethernet Controller E810 Data Plane Development Kit (DPDK) 21.08 Configuration Guide for more details on DPDK and pktgen installation, configuration, and usage.

The following are the attributes used to generate the traffic:

$pci_​id PCIe address of the interface in use.
$cores List of cores used to generate the traffic.
$mem_​channels Number of memory channels. Note:The -n 2 is a minimum required argument for DPDK (Range 2-4).
$socket_​mem DPDK allocated memory from each CPU.
$log_​level Set the specific log level (example: 1-8).
$protocol Traffic protocol (AF_​XDP must use UDP).
$packet_​size Size of the packet (example: 64-1518).
$src_​mac Client interface MAC Address.
$dst_​mac AF_​XDP server interface MAC Address.
$src_​ip IP Address configured on the client interface using pktgen set command.
$dst_​ip IP Address of the AF_​XDP server interface.
$src_​port Port number configured on client interface using pktgen set command.
$dst_​port Port number configured in the traffic class filters on the AF_​XDP server.
$min_​value Minimum range value configured using pktgen range command.
$max_​value Maximum range value configured using pktgen range command.
$increment Increment value configured using pktgen range command.
$RTE_​SDK Points to the DPDK installation directory. Note:Refer to DPDK configuration guide for more details.
$pathtopktgen Path to pktgen application. Note:Refer to DPDK configuration guide for more details.
$file_​prefix Hugepage filename prefix.
$port_​num Interface port number (example: port 0,1).
$rx_​cores Cores to handle specific port's Rx.
$tx_​cores Cores to handle specific port's Tx.
Notes:

To use all queues, the number of traffic streams (ports) should be equal to or a multiple of the number of ADQ queues configured on the AF_​XDP server ($num_​queues_​tc1 in AF_​XDP Server Configuration).

  1. pktgen configuration command. cd $RTE_SDK ./$pathtopktgen/pktgen -l $cores -n $mem_channels --proc-type auto --log-level $log_level --socket-mem=$socket_mem --file-prefix $file_prefix -a $pci_id -- -N -P -T -m [$rx_cores:$tx_cores].$port_num

    Following are the mandatory and optional command-line options:

    Mandatory fields:

    -l:

    -n:

    -m:

    -N:

    -P:

    --file-prefix:

    List of cores on which to run.

    Number of memory channels (range is 2-4).

    Matrix for mapping ports to logical cores.

    Enable NUMA support.

    Enable PROMISCUOUS mode on all ports.

    Prefix for huge page filenames.

    Optional fields:

    -T:

    --proc-type:

    --log-level:

    --socket-mem:

    Enable the color output.

    Type of the process (primary| secondary |auto).

    Set specific log level.

    Memory to allocate on specific sockets (comma separated values).

    Example commands:

    The following examples configure pktgen to use CPU cores specified by -l $cores, where the first core is used for the pktgen command line, for timers and for displaying the runtime metrics text on the terminal, and the remaining cores are used for the generated UDP packet streams. $cores are CPU cores on the same (local) NUMA node as the E810 network adapter. $rx_​cores and $tx_​cores are used to map Rx and Tx traffic from Port 0 of the network adapter to the CPU cores specified by -m.

    Note:The PCIe device 12:00.0 that is used in pktgen is on NUMA node 0, so -l <CPUs> are from NUMA node 0 inventory.

    The following command can be used to list inventory of available NUMA nodes on the system, and the respective CPU cores:

    numactl -hardware (or) lscpu | grep -i numa
    1. Example using five interleaved CPU cores (2,4,6,8,10):
      • Core 2 - Used for pktgen command line and displaying the run time metrics.

        Cores 4,6 - RX traffic.

        Cores 8,10 - TX traffic.

        ./pktgen -l 2,4,6,8,10 -n 4 --proc-type auto --log-level 7 --socket-mem=1024 --file-prefix pktgen1 -a 12:00.0 -- -N -P -T -m [4-6:8-10].0
    2. Example using nine consecutive CPU cores (1-9):
      • Core 1 - Used for pktgen command line and displaying the run time metrics.

        Cores 2-5 - RX traffic.

        Cores 6-9 - TX traffic.

        ./pktgen -l 1-9 -n 4 --socket-mem=256,256 --file- prefix=pktgen2 -a 12:00.0 -- -N -T -P -m "[2-5:6-9].0"
  2. Pktgen commands to generate the traffic. Pktgen:/> set $port_num proto $protocol Pktgen:/> set $port_num size $packet_size Pktgen:/> set $port_num src mac $src_mac Pktgen:/> set $port_num dst mac $dst_mac Pktgen:/> set $port_num src ip $src_ip/mask Pktgen:/> set $port_num dst ip $dst_ip pktgen:/> set $port_num dport $dst_port Pktgen:/> set $port_num sport $src_port Pktgen:/> enable $port_num range Pktgen:/> range $port_num proto $protocol Pktgen:/> range $port_num size $packet_size $min_value $max_value $increment Pktgen:/> range $port_num src mac $src_mac $min_value $max_value $increment Pktgen:/> range $port_num dst mac $dst_mac $min_value $max_value $increment Pktgen:/> range $port_num dst ip $dst_ip $min_value $max_value $increment Pktgen:/> range $port_num src ip $src_ip $min_value $max_value $increment Pktgen:/> range $port_num dst port $dst_port $min_value $max_value $increment Pktgen:/> range $port_num src port $src_port $min_value $max_value $increment Pktgen:/> start $port_num #To start the traffic Pktgen:/> stop $port_num #To stop the traffic Pktgen:/> quit #To quit the application

    Example commands:

    The following commands configure 64-byte UDP packets from the pktgen host (src) to the AF_​XDP server (dst), generating 8 traffic streams across 8 application ports. The destination port numbers (dport and dst port) must match the port numbers used in the ADQ configuration steps on the AF_​XDP server in AF_​XDP Server Configuration.

    Must send UDP traffic to an AF_​XDP socket.

    Pktgen:/> set 0 proto udp Pktgen:/> set 0 size 64 Pktgen:/> set 0 src mac b4:96:91:9c:f9:90 Pktgen:/> set 0 dst mac 40:a6:b7:19:08:d0

    Tested with /16 network mask, other range of network masks could also be used (Default is /32 for IPv4). Subnet mask not required on the destination IP address.

    Pktgen:/> set 0 src ip 61.1.1.50/16 Pktgen:/> set 0 dst ip 61.1.1.100

    Destination port number must match the starting $app_​port number configured on the ADQ AF_​XDP server (AF_​XDP Server Configuration).

    pktgen:/> set 0 dport 5002 Pktgen:/> set 0 sport 3002 Pktgen:/> enable 0 range Pktgen:/> range 0 proto udp Pktgen:/> range 0 size 64 64 64 1 Pktgen:/> range 0 src mac b4:96:91:9c:f9:90 b4:96:91:9c:f9:90 b4:96:91:9c:f9:90 00:00:00:00:00:01 Pktgen:/> range 0 dst mac 40:a6:b7:19:08:d0 40:a6:b7:19:08:d0 40:a6:b7:19:08:d0 00:00:00:00:00:01 Pktgen:/> range 0 dst ip 61.1.1.100 61.1.1.100 61.1.1.100 0.0.0.1 Pktgen:/> range 0 src ip 61.1.1.50 61.1.1.50 61.1.1.50 0.0.0.1

    Number of traffic streams (ports) should be equal to or a multiple of the number of ADQ queues configured on the AF_​XDP server ($num_​queues_​tc1 in AF_​XDP Server Configuration). $dst_​port numbers must match the port numbers configured on the ADQ server.

    Pktgen:/> range 0 dst port 5002 5002 5009 1 #Ports used to add TC filters in ADQ server Pktgen:/> range 0 src port 3002 3002 3009 1 #8 source ports Pktgen:/> start 0 Pktgen:/> stop 0
  3. Verify ADQ traffic is on the correct queues.

    After traffic is started in the client machine, on the AF_​XDP server start the XDPSOCK application and watch ethtool statistics to check that only the ADQ queues are being used. The pkt_​busy_​poll counter should have significantly higher traffic. If instead, pkt_​not_​busy_​poll show significantly higher traffic, or if traffic is not confined to ADQ queues, re-check the configuration steps carefully and/or make sure XDPSOCK is running on the AF_​XDP server.

    watch -d -n 0.5 "ethtool -S $iface | grep busy | column"

    See Verify ADQ Application Traffic and Independent Pollers (If Applicable) for example ethtool watch output.

Note:The ADQ Setup script clears the existing configuration before proceeding with the new ADQ configuration. To clear manually, follow the steps in Clear the ADQ Configuration.