[ovs-dev] [PATCH v4] netdev-dpdk: add coverage counter to count vhost IRQs

Eelco Chaudron echaudro at redhat.com
Wed Dec 18 14:30:57 UTC 2019


Ilya,

Anything missing for this patch now that DPDK 19.11 is in?

Cheers,

Eelco


On 12 Dec 2019, at 4:00, Eelco Chaudron wrote:

> 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>
> ---
>
> v3 -> v4
>   - rebase to latest ovs master with DPDK 19.11
>
> v2 -> v3
>   - rebased on latest dpdk-latest
>
> v1 -> v2
>   - Moved to using a coverage counter
>
>  lib/netdev-dpdk.c |   10 ++++++++++
>  1 file changed, 10 insertions(+)
>
> diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c
> index 89c73a2..5796b72 100644
> --- a/lib/netdev-dpdk.c
> +++ b/lib/netdev-dpdk.c
> @@ -74,6 +74,7 @@ VLOG_DEFINE_THIS_MODULE(netdev_dpdk);
>  static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(5, 20);
>
>  COVERAGE_DEFINE(vhost_tx_contention);
> +COVERAGE_DEFINE(vhost_notification);
>
>  #define DPDK_PORT_WATCHDOG_INTERVAL 5
>
> @@ -168,6 +169,8 @@ static int new_device(int vid);
>  static void destroy_device(int vid);
>  static int vring_state_changed(int vid, uint16_t queue_id, int 
> enable);
>  static void destroy_connection(int vid);
> +static void vhost_guest_notified(int vid);
> +
>  static const struct vhost_device_ops virtio_net_device_ops =
>  {
>      .new_device =  new_device,
> @@ -176,6 +179,7 @@ static const struct vhost_device_ops 
> virtio_net_device_ops =
>      .features_changed = NULL,
>      .new_connection = NULL,
>      .destroy_connection = destroy_connection,
> +    .guest_notified = vhost_guest_notified,
>  };
>
>  /* Custom software stats for dpdk ports */
> @@ -3844,6 +3848,12 @@ destroy_connection(int vid)
>      }
>  }
>
> +static
> +void vhost_guest_notified(int vid OVS_UNUSED)
> +{
> +    COVERAGE_INC(vhost_notification);
> +}
> +
>  /*
>   * Retrieve the DPDK virtio device ID (vid) associated with a 
> vhostuser
>   * or vhostuserclient netdev.
>
> _______________________________________________
> dev mailing list
> dev at openvswitch.org
> https://mail.openvswitch.org/mailman/listinfo/ovs-dev



More information about the dev mailing list