From patchwork Fri Oct 25 13:56:01 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eelco Chaudron X-Patchwork-Id: 1184198 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=140.211.169.12; helo=mail.linuxfoundation.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.b="curqrRYe"; dkim-atps=neutral Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4705Hd07VZz9sPK for ; Sat, 26 Oct 2019 00:56:13 +1100 (AEDT) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 489B01314; Fri, 25 Oct 2019 13:56:11 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@mail.linuxfoundation.org Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id 09A441310 for ; Fri, 25 Oct 2019 13:56:10 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from us-smtp-delivery-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by smtp1.linuxfoundation.org (Postfix) with ESMTP id 847B789C for ; Fri, 25 Oct 2019 13:56:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1572011768; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YED5fFAdZvt5e8d2xst2KnYqgmWoAT3DNE3QIkPUBso=; b=curqrRYen81/up0ABByyM8OPIklSxl9Y78vs1reRRLC67LlNrrHlzlsDxS19IHPI7sWxBC GCo1Io4+zhocJD+k5BTeCIxbUPrMIQm0IHxeh+3oK3vhhNWE2cy9wLS35ZywE4vJRQLrhZ jwWXjESG4ZCbJwFW3YF1Nf5tWGeqytM= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-71-aNZE6M-LOx6KPqtGOSU2SQ-1; Fri, 25 Oct 2019 09:56:04 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 8DA991800DCA; Fri, 25 Oct 2019 13:56:03 +0000 (UTC) Received: from netdev64.ntdv.lab.eng.bos.redhat.com (wsfd-netdev64.ntdv.lab.eng.bos.redhat.com [10.19.188.127]) by smtp.corp.redhat.com (Postfix) with ESMTP id 37C4C7E21; Fri, 25 Oct 2019 13:56:03 +0000 (UTC) From: Eelco Chaudron To: dev@openvswitch.org Date: Fri, 25 Oct 2019 09:56:01 -0400 Message-Id: <20191025135601.19535.55564.stgit@netdev64> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-MC-Unique: aNZE6M-LOx6KPqtGOSU2SQ-1 X-Mimecast-Spam-Score: 0 X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Cc: i.maximets@ovn.org Subject: [ovs-dev] [dpdk-latest PATCH v2] netdev-dpdk: add coverage counter to count vhost IRQs X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: ovs-dev-bounces@openvswitch.org Errors-To: ovs-dev-bounces@openvswitch.org 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 "dpdk_vhost_irqs" and can be read with: $ ovs-appctl coverage/show | grep dpdk_vhost_irqs dpdk_vhost_irqs 275880.6/sec 129962.683/sec 6561.7250/sec total: 23684319 $ ovs-appctl coverage/read-counter dpdk_vhost_irqs 23684319 Signed-off-by: Eelco Chaudron --- lib/netdev-dpdk.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c index ba92e89..8c6aaeb 100644 --- a/lib/netdev-dpdk.c +++ b/lib/netdev-dpdk.c @@ -46,6 +46,7 @@ #include "dpdk.h" #include "dpif-netdev.h" #include "fatal-signal.h" +#include "coverage.h" #include "netdev-provider.h" #include "netdev-vport.h" #include "odp-util.h" @@ -72,6 +73,8 @@ enum {VIRTIO_RXQ, VIRTIO_TXQ, VIRTIO_QNUM}; VLOG_DEFINE_THIS_MODULE(netdev_dpdk); static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(5, 20); +COVERAGE_DEFINE(dpdk_vhost_irqs); + #define DPDK_PORT_WATCHDOG_INTERVAL 5 #define OVS_CACHE_LINE_SIZE CACHE_LINE_SIZE @@ -165,6 +168,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, @@ -173,6 +178,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, }; enum { DPDK_RING_SIZE = 256 }; @@ -3746,6 +3752,12 @@ destroy_connection(int vid) } } +static +void vhost_guest_notified(int vid OVS_UNUSED) +{ + COVERAGE_INC(dpdk_vhost_irqs); +} + /* * Retrieve the DPDK virtio device ID (vid) associated with a vhostuser * or vhostuserclient netdev.