FD.io VPP  v17.10-9-gd594711
Vector Packet Processing
DPDK and pcap tx

pcap tx trace

Summary/usage

pcap tx trace [on|off] [max <nn>] [intfc <interface>|any] [file <name>] [status].

Description

This command is used to start or stop a packet capture, or show the status of packet capture.

This command has the following optional parameters:

  • on|off - Used to start or stop a packet capture.
  • max <nn> - Depth of local buffer. Once 'nn' number of packets have been received, buffer is flushed to file. Once another 'nn' number of packets have been received, buffer is flushed to file, overwriting previous write. If not entered, value defaults to 100. Can only be updated if packet capture is off.
  • intfc <interface>|any - Used to specify a given interface, or use 'any' to run packet capture on all interfaces. 'any' is the default if not provided. Settings from a previous packet capture are preserved, so 'any' can be used to reset the interface setting.
  • file <name> - Used to specify the output filename. The file will be placed in the '/tmp' directory, so only the filename is supported. Directory should not be entered. If file already exists, file will be overwritten. If no filename is provided, '/tmp/vpe.pcap' will be used. Can only be updated if packet capture is off.
  • status - Displays the current status and configured attributes associated with a packet capture. If packet capture is in progress, 'status' also will return the number of packets currently in the local buffer. All additional attributes entered on command line with 'status' will be ingnored and not applied.
Example usage
Example of how to display the status of a tx packet capture when off:
vpp# pcap tx trace status
max is 100, for any interface to file /tmp/vpe.pcap
pcap tx capture is off...
Example of how to start a tx packet capture:
vpp# pcap tx trace on max 35 intfc GigabitEthernet0/8/0 file vppTest.pcap
pcap tx capture on...
Example of how to display the status of a tx packet capture in progress:
vpp# pcap tx trace status
max is 35, for interface GigabitEthernet0/8/0 to file /tmp/vppTest.pcap
pcap tx capture is on: 20 of 35 pkts...
Example of how to stop a tx packet capture:
vpp# vppctl pcap tx trace off
captured 21 pkts...
saved to /tmp/vppTest.pcap...

Declaration and implementation

Declaration: pcap_trace_command (src/plugins/dpdk/device/cli.c line 332)

Implementation: pcap_trace_command_fn.

set dpdk interface descriptors

Summary/usage

set dpdk interface descriptors <interface> [rx <nn>] [tx <nn>].

Description

This command sets the number of DPDK 'rx' and 'tx' descriptors for the given physical interface. Use the command 'show hardware-interface' to display the current descriptor allocation.

Example usage
Example of how to set the DPDK interface descriptors:
vpp# set dpdk interface descriptors GigabitEthernet0/8/0 rx 512 tx 512

Declaration and implementation

Declaration: cmd_set_dpdk_if_desc (src/plugins/dpdk/device/cli.c line 562)

Implementation: set_dpdk_if_desc.

set dpdk interface hqos pipe

Summary/usage

set dpdk interface hqos pipe <interface> subport <subport_id> pipe <pipe_id> profile <profile_id>.

Description

This command is used to change the profile associate with a HQoS pipe. The '<profile_id>' is zero based. Use the command 'show dpdk interface hqos' to display the content of each profile. See QoS Hierarchical Scheduler for more details.

Note
Currently there is not an API to create a new HQoS pipe profile. One is created by default in the code (search for 'hqos_pipe_params_default''). Additional profiles can be created in code and code recompiled. Then use this command to assign it.
Example usage
Example of how to assign a new profile to a HQoS pipe:
vpp# set dpdk interface hqos pipe GigabitEthernet0/8/0 subport 0 pipe 2 profile 1

Declaration and implementation

Declaration: cmd_set_dpdk_if_hqos_pipe (src/plugins/dpdk/device/cli.c line 824)

Implementation: set_dpdk_if_hqos_pipe.

set dpdk interface hqos pktfield

Summary/usage

set dpdk interface hqos pktfield <interface> id subport|pipe|tc offset <n> mask <hex-mask>.

Description

This command is used to set the packet fields required for classifiying the incoming packet. As a result of classification process, packet field information will be mapped to 5 tuples (subport, pipe, traffic class, pipe, color) and stored in packet mbuf.

This command has the following parameters:

  • <interface> - Used to specify the output interface.
  • id subport|pipe|tc - Classification occurs across three fields. This parameter indicates which of the three masks are being configured. Legacy code used 0-2 to represent these three fields, so 0-2 is still accepted.
    • subport|0 - Currently only one subport is supported, so only an empty mask is supported for the subport classification.
    • pipe|1 - Currently, 4096 pipes per subport are supported, so a 12-bit mask should be configure to map to the 0-4095 pipes.
    • tc|2 - The translation table (see 'set dpdk interface hqos tctbl' command) maps each value (0-63) into one of the 4 traffic classes per pipe. A 6-bit mask should be configure to map this field to a traffic class.
  • offset <n> - Offset in the packet to apply the 64-bit mask for classification. The offset should be on an 8-byte boundary (0,8,16,24..).
  • mask <hex-mask> - 64-bit mask to apply to packet at the given 'offset'. Bits must be contiguous and should not include '0x'.

The default values for the 'pktfield' assumes Ethernet/IPv4/UDP packets with no VLAN. Adjust based on expected packet format and desired classification field.

  • 'subport' is always empty (offset 0 mask 0000000000000000)
  • By default, 'pipe' maps to the UDP payload bits 12 .. 23 (offset 40 mask 0000000fff000000)
  • By default, 'tc' maps to the DSCP field in IP header (offset 48 mask 00000000000000fc)
Example usage
Example of how modify the 'pipe' classification filter to match VLAN:
vpp# set dpdk interface hqos pktfield GigabitEthernet0/8/0 id pipe offset 8 mask 0000000000000FFF

Declaration and implementation

Declaration: cmd_set_dpdk_if_hqos_pktfield (src/plugins/dpdk/device/cli.c line 1298)

Implementation: set_dpdk_if_hqos_pktfield.

set dpdk interface hqos placement

Summary/usage

set dpdk interface hqos placement <interface> thread <n>.

Description

This command is used to assign a given DPDK output interface and HQoS queue to a different thread. This will not create a thread, so the thread must already exist. Use '/etc/vpp/startup.conf' for the initial thread creation. See QoS Hierarchical Scheduler for more details.

Example usage
Example of how to display the DPDK output interface and HQoS queue placement:
vpp# show dpdk interface hqos placement
Thread 1 (vpp_hqos-threads_0 at lcore 3):
  GigabitEthernet0/8/0 queue 0
Thread 2 (vpp_hqos-threads_1 at lcore 4):
  GigabitEthernet0/9/0 queue 0
Example of how to assign a DPDK output interface and HQoS queue to a thread:
vpp# set dpdk interface hqos placement GigabitEthernet0/8/0 thread 2

Declaration and implementation

Declaration: cmd_set_dpdk_if_hqos_placement (src/plugins/dpdk/device/cli.c line 738)

Implementation: set_dpdk_if_hqos_placement.

set dpdk interface hqos subport

Summary/usage

set dpdk interface hqos subport <interface> subport <subport_id> [rate <n>] [bktsize <n>] [tc0 <n>] [tc1 <n>] [tc2 <n>] [tc3 <n>] [period <n>].

Description

This command is used to set the subport level parameters such as token bucket rate (bytes per seconds), token bucket size (bytes), traffic class rates (bytes per seconds) and token update period (Milliseconds).

By default, the 'rate' is set to 1250000000 bytes/second (10GbE rate) and each of the four traffic classes is set to 100% of the port rate. If the 'rate' is updated by this command, all four traffic classes are assigned the same value. Each of the four traffic classes can be updated individually.

Example usage
Example of how modify the subport attributes for a 1GbE link:
vpp# set dpdk interface hqos subport GigabitEthernet0/8/0 subport 0 rate 125000000

Declaration and implementation

Declaration: cmd_set_dpdk_if_hqos_subport (src/plugins/dpdk/device/cli.c line 962)

Implementation: set_dpdk_if_hqos_subport.

set dpdk interface hqos tctbl

Summary/usage

set dpdk interface hqos tctbl <interface> entry <map_val> tc <tc_id> queue <queue_id>.

Description

This command is used to set the traffic class translation table. The traffic class translation table is used to map 64 values (0-63) to one of four traffic class and one of four HQoS input queue. Use the 'show dpdk interface hqos' command to display the traffic class translation table. See QoS Hierarchical Scheduler for more details.

This command has the following parameters:

  • <interface> - Used to specify the output interface.
  • entry <map_val> - Mapped value (0-63) to assign traffic class and queue to.
  • tc <tc_id> - Traffic class (0-3) to be used by the provided mapped value.
  • queue <queue_id> - HQoS input queue (0-3) to be used by the provided mapped value.
Example usage
Example of how modify the traffic class translation table:
vpp# set dpdk interface hqos tctbl GigabitEthernet0/8/0 entry 16 tc 2 queue 2

Declaration and implementation

Declaration: cmd_set_dpdk_if_hqos_tctbl (src/plugins/dpdk/device/cli.c line 1079)

Implementation: set_dpdk_if_hqos_tctbl.

show dpdk buffer

Summary/usage

show dpdk buffer.

Description

This command displays statistics of each DPDK mempool.

Example usage
Example of how to display DPDK buffer data:
vpp# show dpdk buffer
name="mbuf_pool_socket0"  available =   15104 allocated =    1280 total =   16384

Declaration and implementation

Declaration: cmd_show_dpdk_bufferr (src/plugins/dpdk/device/cli.c line 379)

Implementation: show_dpdk_buffer.

show dpdk hqos queue

Summary/usage

show dpdk hqos queue <interface> subport <subport_id> pipe <pipe_id> tc <tc_id> tc_q <queue_id>.

Description

This command is used to display statistics associated with a HQoS traffic class queue.

Note
Statistic collection by the scheduler is disabled by default in DPDK. In order to turn it on, add the following line to '../vpp/dpdk/Makefile':
  • $(call set,RTE_SCHED_COLLECT_STATS,y)
Example usage
Example of how to display statistics of HQoS a HQoS traffic class queue:
vpp# show dpdk hqos queue GigabitEthernet0/9/0 subport 0 pipe 3181 tc 0 tc_q 0
     Stats Parameter          Value
         Packets               140
     Packets dropped            0
          Bytes               8400
      Bytes dropped             0

Declaration and implementation

Declaration: cmd_show_dpdk_hqos_queue_stats (src/plugins/dpdk/device/cli.c line 1850)

Implementation: show_dpdk_hqos_queue_stats.

show dpdk interface hqos

Summary/usage

show dpdk interface hqos <interface>.

Description

This command is used to display details of an output interface's HQoS settings.

Example usage
Example of how to display HQoS settings for an interfaces:
vpp# show dpdk interface hqos GigabitEthernet0/8/0
 Thread:
   Input SWQ size = 4096 packets
   Enqueue burst size = 256 packets
   Dequeue burst size = 220 packets
   Packet field 0: slab position =    0, slab bitmask = 0x0000000000000000   (subport)
   Packet field 1: slab position =   40, slab bitmask = 0x0000000fff000000   (pipe)
   Packet field 2: slab position =    8, slab bitmask = 0x00000000000000fc   (tc)
   Packet field 2  tc translation table: ([Mapped Value Range]: tc/queue tc/queue ...)
     [ 0 .. 15]: 0/0 0/1 0/2 0/3 1/0 1/1 1/2 1/3 2/0 2/1 2/2 2/3 3/0 3/1 3/2 3/3
     [16 .. 31]: 0/0 0/1 0/2 0/3 1/0 1/1 1/2 1/3 2/0 2/1 2/2 2/3 3/0 3/1 3/2 3/3
     [32 .. 47]: 0/0 0/1 0/2 0/3 1/0 1/1 1/2 1/3 2/0 2/1 2/2 2/3 3/0 3/1 3/2 3/3
     [48 .. 63]: 0/0 0/1 0/2 0/3 1/0 1/1 1/2 1/3 2/0 2/1 2/2 2/3 3/0 3/1 3/2 3/3
 Port:
   Rate = 1250000000 bytes/second
   MTU = 1514 bytes
   Frame overhead = 24 bytes
   Number of subports = 1
   Number of pipes per subport = 4096
   Packet queue size: TC0 = 64, TC1 = 64, TC2 = 64, TC3 = 64 packets
   Number of pipe profiles = 2
 Subport 0:
   Rate = 1250000000 bytes/second
   Token bucket size = 1000000 bytes
   Traffic class rate: TC0 = 1250000000, TC1 = 1250000000, TC2 = 1250000000, TC3 = 1250000000 bytes/second
   TC period = 10 milliseconds
 Pipe profile 0:
   Rate = 305175 bytes/second
   Token bucket size = 1000000 bytes
   Traffic class rate: TC0 = 305175, TC1 = 305175, TC2 = 305175, TC3 = 305175 bytes/second
   TC period = 40 milliseconds
   TC0 WRR weights: Q0 = 1, Q1 = 1, Q2 = 1, Q3 = 1
   TC1 WRR weights: Q0 = 1, Q1 = 1, Q2 = 1, Q3 = 1
   TC2 WRR weights: Q0 = 1, Q1 = 1, Q2 = 1, Q3 = 1
   TC3 WRR weights: Q0 = 1, Q1 = 1, Q2 = 1, Q3 = 1

Declaration and implementation

Declaration: cmd_show_dpdk_if_hqos (src/plugins/dpdk/device/cli.c line 1694)

Implementation: show_dpdk_if_hqos.

show dpdk interface hqos placement

Summary/usage

show dpdk interface hqos placement.

Description

This command is used to display the thread and core each DPDK output interface and HQoS queue is assigned too.

Example usage
Example of how to display the DPDK output interface and HQoS queue placement:
vpp# show dpdk interface hqos placement
Thread 1 (vpp_hqos-threads_0 at lcore 3):
  GigabitEthernet0/8/0 queue 0
Thread 2 (vpp_hqos-threads_1 at lcore 4):
  GigabitEthernet0/9/0 queue 0

Declaration and implementation

Declaration: cmd_show_dpdk_if_hqos_placement (src/plugins/dpdk/device/cli.c line 633)

Implementation: show_dpdk_if_hqos_placement.

show dpdk version

Summary/usage

show dpdk version.

Description

This command is used to display the current DPDK version and the list of arguments passed to DPDK when started.

Example usage
Example of how to display how many DPDK buffer test command has allcoated:
vpp# show dpdk version
DPDK Version:        DPDK 16.11.0
DPDK EAL init args:  -c 1 -n 4 --huge-dir /run/vpp/hugepages --file-prefix vpp -w 0000:00:08.0 -w 0000:00:09.0 --master-lcore 0 --socket-mem 256

Declaration and implementation

Declaration: show_vpe_version_command (src/plugins/dpdk/device/cli.c line 1881)

Implementation: show_dpdk_version_command_fn.

test dpdk buffer

Summary/usage

test dpdk buffer [allocate <nn>] [free <nn>].

Description

This command tests the allocation and freeing of DPDK buffers. If both 'allocate' and 'free' are entered on the same command, the 'free' is executed first. If no parameters are provided, this command display how many DPDK buffers the test command has allocated.

Example usage

Example of how to display how many DPDK buffer test command has allcoated:

vpp# test dpdk buffer

Currently 0 buffers allocated

Example of how to allocate DPDK buffers using the test command:

vpp# test dpdk buffer allocate 10

Currently 10 buffers allocated

Example of how to free DPDK buffers allocated by the test command:

vpp# test dpdk buffer free 10

Currently 0 buffers allocated

Declaration and implementation

Declaration: cmd_test_dpdk_buffer (src/plugins/dpdk/device/cli.c line 467)

Implementation: test_dpdk_buffer.

test dpdk buffers

Summary/usage

test dpdk buffers [poison] [trajectory].

Declaration and implementation

Declaration: test_dpdk_buffers_command (src/plugins/dpdk/device/cli.c line 1931)

Implementation: dpdk_validate_buffers_fn.