From patchwork Mon Nov 25 14:32: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: 1200422 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.166.136; helo=silver.osuosl.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="Zw6lj77g"; dkim-atps=neutral Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47M8d01WQTz9sNx for ; Tue, 26 Nov 2019 01:32:19 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 33FEB2107A; Mon, 25 Nov 2019 14:32:18 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id QO5ebqb2c2ds; Mon, 25 Nov 2019 14:32:16 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by silver.osuosl.org (Postfix) with ESMTP id A884B20021; Mon, 25 Nov 2019 14:32:16 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 7AC7BC1DD7; Mon, 25 Nov 2019 14:32:16 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by lists.linuxfoundation.org (Postfix) with ESMTP id F2870C0878 for ; Mon, 25 Nov 2019 14:32:14 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id DBD838654D for ; Mon, 25 Nov 2019 14:32:14 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id enhEhadFdywS for ; Mon, 25 Nov 2019 14:32:14 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by whitealder.osuosl.org (Postfix) with ESMTPS id C27D4862E8 for ; Mon, 25 Nov 2019 14:32:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1574692332; 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=Akubw/P3c4QhX5rkgwfcC3/cR6fyvwEcnAjEu/Y4zP4=; b=Zw6lj77gpgjIpFf6FkqVIBbx/Dxilti0BhxvFh2qn0DGr1i7afX65iqm3YydiBeHTURXX7 s1fNlhfqeNECWrvNAMm9+cXz9lM1RvajiouRWHwrUof7Me5sKaN1Pey1Hz06oXXFDdLU77 jR3Y2/nRZpu9xLmtFiRI7JqJBVjrEiI= 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-181-4vJwX6EUM0OVZWgCBKJI8w-1; Mon, 25 Nov 2019 09:32:09 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 0D88810BF996; Mon, 25 Nov 2019 14:32:08 +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 A691A600C8; Mon, 25 Nov 2019 14:32:07 +0000 (UTC) From: Eelco Chaudron To: dev@openvswitch.org Date: Mon, 25 Nov 2019 09:32:01 -0500 Message-Id: <20191125143107.80941.6751.stgit@netdev64> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-MC-Unique: 4vJwX6EUM0OVZWgCBKJI8w-1 X-Mimecast-Spam-Score: 0 Cc: i.maximets@ovn.org Subject: [ovs-dev] [dpdk-latest PATCH v3] netdev-dpdk: add coverage counter to count vhost IRQs X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" 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 --- v2 -> v3 - rebased on latest dpdk-latest - renamed coverage counter name to vhost_notification - limit commit message line length 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 2423d26..b20f5da 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.