  DPIF-NETDEV COMMANDS
These commands are used to expose internal information (mostly statistics) about the "dpif-netdev" userspace datapath. If there is only one datapath (as is often the case, unless dpctl/ commands are used), the dp argument can be omitted. By default the commands present data for all pmd threads in the datapath. By specifying the "-pmd Core" option one can filter the output for a single pmd in the datapath.

dpif-netdev/pmd-stats-clear [dp]
    Resets to zero the per pmd thread performance numbers shown by the dpif-netdev/pmd-perf-show command. It will NOT reset datapath or bridge statistics, only the values shown by the above command.

dpif-netdev/pmd-perf-show [-nh] [-it iter_len] [-ms ms_len] [-pmd core] [dp]
    Shows detailed performance metrics for one or all pmds threads of the user space datapath. The special thread "main" sums up the statistics of every non pmd thread. The collection of additional detailed statistics can be controlled by a configuration parameter other-config:pmd-perf-metrics. By default it is disabled. The run-time overhead, when enabled, is in the order of 1%. Collected statistics include:

    —   used cycles

    —   forwared packets

    —   number of rx batches

    —   packets/rx batch

    —   max. vhostuser queue fill level

    —   number of upcalls

    —   cycles spent in upcalls

    This raw recorded data is used threefold:

    1.  In histograms for each of the following metrics:

        —   cycles/iteration (logarithmic)

        —   packets/iteration (logarithmic)

        —   cycles/packet

        —   packets/batch

        —   max. vhostuser qlen (logarithmic)

        —   upcalls

        —   cycles/upcall (logarithmic) The histograms bins are divided linear or logarithmic.

    2.  A cyclic history of the above metrics for 1024 iterations

    3.  A cyclic history of the cummulative/average values per millisecond wall clock for the last 1024 milliseconds:

        —   number of iterations

        —   avg. cycles/iteration

        —   packets (Kpps)

        —   avg. packets/batch

        —   avg. max vhost qlen

        —   upcalls

        —   avg. cycles/upcall

    The command options are:

    -nh Suppress the histograms

    -it iter_len
        Display the last iter_len iteration stats

    -ms ms_len
        Display the last ms_len millisecond stats

    The output always contains the following global PMD statistics:

            Time: 15:24:55.270
            Measurement duration: 1.008 s
            pmd thread numa_id 0 core_id 1:
              Iterations:              572817  (1.76 us/it)
              - Used TSC cycles:   2419034712  ( 99.9 % of total cycles)
              - idle iterations:       486808  ( 15.9 % of used cycles)
              - busy iterations:        86009  ( 84.1 % of used cycles)
              Rx packets:             2399607  (2381 Kpps, 848 cycles/pkt)
              Datapath passes:        3599415  (1.50 passes/pkt)
              - PHWOL hits:                 0  (  0.0 %)
              - Simple Match hits:          0  (  0.0 %)
              - EMC hits:              336472  (  9.3 %)
              - SMC hits:                   0  (  0.0 %)
              - Megaflow hits:        3262943  ( 90.7 %, 1.00 subtbl lookups/hit)
              - Upcalls:                    0  (  0.0 %, 0.0 us/upcall)
              - Lost upcalls:               0  (  0.0 %)
              Tx packets:             2399607  (2381 Kpps)
              Tx batches:              171400  (14.00 pkts/batch)

    Here "Rx packets" actually reflects the number of packets forwarded by the datapath. The sum of "PHWOL hits", "Simple Match hits", "EMC hits", "SMC hits", "Megaflow hits" and "Upcalls" is the number of packet lookups performed by the datapath and it is reported as "Datapath passes". Beware that a recirculated packet experiences one additional lookup per recirculation, so there may be more lookups than forwarded packets in the datapath. The "MFEX Opt hits" displays the number of packets that are processed by the optimized miniflow extract implementations. Cycles are counted using the TSC or similar facilities (when available on the platform). The duration of one cycle depends on the processing platform. Statistics based on cycles are not reported for the "main" thread, since the accurate accounting of CPU cycles is not possible in this case. "idle iterations" refers to PMD iterations that did not result in processing any packets. "busy iterations" refers to PMD iterations that included processing of at least one packet. The reported used TSC cycles include the cost for polling, processing and transmitting said packets. To reset the counters and start a new measurement use dpif-netdev/pmd-stats-clear.

dpif-netdev/pmd-perf-log-set on|off [-b before] [-a after] [-e|-ne] [-us usec] [-q qlen]
    The userspace "netdev" datapath is able to supervise the PMD performance metrics and detect iterations with suspicious statistics according to the following criteria:

    —   The iteration lasts longer than usec microseconds (default 250). This can be used to capture events where a PMD is blocked or interrupted for such a period of time that there is a risk for dropped packets on any of its Rx queues.

    —   The max vhost qlen exceeds a threshold qlen (default 128). This can be used to infer virtio queue overruns and dropped packets inside a VM, which are not visible in OVS otherwise.

    Such suspicious iterations can be logged together with their iteration statistics in the ovs-vswitchd.log to be able to correlate them to packet drop or other events outside OVS. The above command enables (on) or disables (off) supervision and logging at run-time and can be used to adjust the above thresholds for detecting suspicious iterations. By default supervision and logging is disabled. The command options are:

    -b before
        The number of iterations before the suspicious iteration to be logged (default 5).

    -a after
        The number of iterations after the suspicious iteration to be logged (default 5).

    -e  Extend logging interval if another suspicious iteration is detected before logging occurs.

    -ne Do not extend logging interval if another suspicious iteration is detected before logging occurs (default).

    -q qlen
        Suspicious vhost queue fill level threshold. Increase this to 512 if the Qemu supports 1024 virtio queue length (default 128).

    -us usec
        Change the duration threshold for a suspicious iteration (default 250 us).
Note: Logging of suspicious iterations itself consumes a considerable amount of processing cycles of a PMD which may be visible in the iteration history. In the worst case this can lead OVS to detect another suspicious iteration caused by logging. If more than 100 iterations around a suspicious iteration have been logged once, OVS falls back to the safe default values (-b 5 -a 5 -ne) to avoid that logging itself continuously causes logging of further suspicious iterations.

dpif-netdev/pmd-rxq-show [-pmd core] [dp]
    For one or all pmd threads of the datapath dp show the list of queue-ids with port names, which this thread polls.

dpif-netdev/pmd-rxq-rebalance [dp]
    Reassigns rxqs to pmds in the datapath dp based on their current usage.

dpif-netdev/bond-show [dp]
    When "other_config:lb-output-action" is set to "true", the userspace datapath handles the load balancing of bonds directly instead of depending on flow recirculation (only in balance-tcp mode). When this is the case, the above command prints the load-balancing information of the bonds configured in datapath dp showing the interface associated with each bucket (hash).