[ovs-git] [openvswitch/ovs] 3d56e4: netdev-dpdk: Add coverage counter to count vhost I...

Ilya Maximets noreply at github.com
Thu Dec 19 08:16:54 UTC 2019


  Branch: refs/heads/master
  Home:   https://github.com/openvswitch/ovs
  Commit: 3d56e4ac445d17e69484a95b319ac578e3580b65
      https://github.com/openvswitch/ovs/commit/3d56e4ac445d17e69484a95b319ac578e3580b65
  Author: Eelco Chaudron <echaudro at redhat.com>
  Date:   2019-12-19 (Thu, 19 Dec 2019)

  Changed paths:
    M lib/netdev-dpdk.c

  Log Message:
  -----------
  netdev-dpdk: Add coverage counter to count vhost IRQs.

When the dpdk vhost library executes an eventfd_write() call,
i.e. waking up the guest, a new callback will be called.

This patch adds the callback to count the number of
interrupts sent to the VM to track the number of times
interrupts where generated.

This might be of interest to find out system-calls were
called in the DPDK fast path.

The coverage counter is called "vhost_notification" and
can be read with:

  $ ovs-appctl coverage/read-counter vhost_notification
  13238319

Signed-off-by: Eelco Chaudron <echaudro at redhat.com>
Signed-off-by: Ilya Maximets <i.maximets at ovn.org>


  Commit: 28d0501623bfe2ab0347c11a1d362400f9df041f
      https://github.com/openvswitch/ovs/commit/28d0501623bfe2ab0347c11a1d362400f9df041f
  Author: Ilya Maximets <i.maximets at ovn.org>
  Date:   2019-12-19 (Thu, 19 Dec 2019)

  Changed paths:
    M include/openvswitch/thread.h
    M lib/netdev-afxdp.c
    M lib/netdev-afxdp.h
    M lib/netdev-linux-private.h

  Log Message:
  -----------
  ovs-thread: Avoid huge alignment on a base spinlock structure.

Marking the structure as 64 bytes aligned forces compiler to produce
big holes in the containing structures in order to fulfill this
requirement.  Also, any structure that contains this one as a member
automatically inherits this huge alignment making resulted memory
layout not efficient.  For example, 'struct umem_pool' currently
uses 3 full cache lines (192 bytes) with only 32 bytes of actual data:

  struct umem_pool {
    int                        index;                /*  0   4 */
    unsigned int               size;                 /*  4   4 */

    /* XXX 56 bytes hole, try to pack */

    /* --- cacheline 1 boundary (64 bytes) --- */
    struct ovs_spin lock __attribute__((__aligned__(64))); /* 64  64 */

    /* XXX last struct has 48 bytes of padding */

    /* --- cacheline 2 boundary (128 bytes) --- */
    void * *                   array;                /* 128  8 */

    /* size: 192, cachelines: 3, members: 4 */
    /* sum members: 80, holes: 1, sum holes: 56 */
    /* padding: 56 */
    /* paddings: 1, sum paddings: 48 */
    /* forced alignments: 1, forced holes: 1, sum forced holes: 56 */
  } __attribute__((__aligned__(64)));

Actual alignment of a spin lock is required only for Tx queue locks
inside netdev-afxdp to avoid false sharing, in all other cases
alignment only produces inefficient memory usage.

Also, CACHE_LINE_SIZE macro should be used instead of 64 as different
platforms may have different cache line sizes.

Using PADDED_MEMBERS to avoid alignment inheritance.

Fixes: ae36d63d7e3c ("ovs-thread: Make struct spin lock cache aligned.")
Signed-off-by: Ilya Maximets <i.maximets at ovn.org>
Acked-by: William Tu <u9012063 at gmail.com>


  Commit: 138d30a9c045c2883164b6392094fd56c8f13196
      https://github.com/openvswitch/ovs/commit/138d30a9c045c2883164b6392094fd56c8f13196
  Author: Ilya Maximets <i.maximets at ovn.org>
  Date:   2019-12-19 (Thu, 19 Dec 2019)

  Changed paths:
    M lib/dpctl.c
    M tests/mpls-xlate.at
    M tests/nsh.at
    M tests/ofproto-dpif.at
    M tests/packet-type-aware.at
    M tests/pmd.at

  Log Message:
  -----------
  dpctl: Fix referencing DPDK in a flow dump.

Few reasons to replace 'non-dpdk interfaces' with 'the main thread':

* Flows are dumped from threads (from per thread flow tables) not from
  the interfaces.

* 'non-dpdk' here sounds like all other flows (dumped from PMDs) has
  some relation with DPDK which is not true at least because we have
  afxdp and dummy ports that could be polled by PMD threads.

* 'main thread' is the same term as we're using in the output of
  ovs-appctl dpif-netdev/pmd-stats-show.

Signed-off-by: Ilya Maximets <i.maximets at ovn.org>
Acked-by: Ben Pfaff <blp at ovn.org>


Compare: https://github.com/openvswitch/ovs/compare/6d77abf4f7ea...138d30a9c045


More information about the git mailing list