From patchwork Fri Dec 8 12:04:26 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Bodireddy, Bhanuprakash" X-Patchwork-Id: 846200 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=openvswitch.org (client-ip=140.211.169.12; helo=mail.linuxfoundation.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) 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 3ytWcw1C88z9s82 for ; Fri, 8 Dec 2017 23:19:44 +1100 (AEDT) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 6A52BD06; Fri, 8 Dec 2017 12:15:52 +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 A7F9DD05 for ; Fri, 8 Dec 2017 12:15:49 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 0630C189 for ; Fri, 8 Dec 2017 12:15:48 +0000 (UTC) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 08 Dec 2017 04:15:48 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.45,377,1508828400"; d="scan'208";a="185249762" Received: from silpixa00393942.ir.intel.com (HELO silpixa00393942.ger.corp.intel.com) ([10.237.223.42]) by fmsmga006.fm.intel.com with ESMTP; 08 Dec 2017 04:15:48 -0800 From: Bhanuprakash Bodireddy To: dev@openvswitch.org Date: Fri, 8 Dec 2017 12:04:26 +0000 Message-Id: <1512734667-23202-8-git-send-email-bhanuprakash.bodireddy@intel.com> X-Mailer: git-send-email 2.4.11 In-Reply-To: <1512734667-23202-1-git-send-email-bhanuprakash.bodireddy@intel.com> References: <1512734667-23202-1-git-send-email-bhanuprakash.bodireddy@intel.com> X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, T_RP_MATCHES_RCVD autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Subject: [ovs-dev] [PATCH v6 7/8] Documentation: Update DPDK doc with Keepalive feature. 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: , MIME-Version: 1.0 Sender: ovs-dev-bounces@openvswitch.org Errors-To: ovs-dev-bounces@openvswitch.org Keepalive feature is aimed at achieving Fastpath Service Assurance in OVS-DPDK deployments. It adds support for monitoring the packet processing threads by dispatching heartbeats at regular intervals. The implementation uses OvSDB for reporting the health of the PMD threads. Any external monitoring application can query the OvSDB for status at regular intervals (or) subscribe to OvSDB updates. keepalive feature can be enabled through below OVSDB settings. enable-keepalive=true - Keepalive feature is disabled by default and should be enabled at startup before ovs-vswitchd daemon is started. keepalive-interval="5000" - Timer interval in milliseconds for monitoring the packet processing cores. When KA is enabled, 'ovs-keepalive' thread shall be spawned that wakes up at regular intervals to update the timestamp and status of pmd threads in process map. This information shall be read by vswitchd thread and written in to 'keepalive' column of Open_vSwitch table in OVSDB. An external monitoring framework like collectd with ovs events support can read (or) subscribe to the datapath status changes in ovsdb. When the state is updated, the collectd shall be notified and will eventually relay the status to ceilometer service running in the controller. Below is the high level overview of deployment model. Compute Node Controller Compute Node Collectd <----------> Ceilometer <--------> Collectd OvS DPDK OvS DPDK +-----+ | VM | +--+--+ \---+---/ | +--+---+ +------------+----------+ +------+-------+ | OVS |-----> | ovsevents plugin | --> | collectd | +--+---+ +------------+----------+ +------+-------+ +------+-----+ +---------------+------------+ | | Ceilometer | <-- | collectd ceilometer plugin | <--- +------+-----+ +---------------+------------+ Performance impact: No noticeable performance or latency impact is observed with KA feature enabled. Signed-off-by: Bhanuprakash Bodireddy Acked-by: Antonio Fischetti --- Documentation/howto/dpdk.rst | 112 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 112 insertions(+) diff --git a/Documentation/howto/dpdk.rst b/Documentation/howto/dpdk.rst index d123819..e7a2b27 100644 --- a/Documentation/howto/dpdk.rst +++ b/Documentation/howto/dpdk.rst @@ -439,6 +439,118 @@ For certain traffic profiles with many parallel flows, it's recommended to set For more information on the EMC refer to :doc:`/intro/install/dpdk` . +.. _dpdk_keepalive: + +Keepalive +--------- + +OvS Keepalive(KA) feature is disabled by default. To enable KA feature:: + + $ ovs-vsctl --no-wait set Open_vSwitch . other_config:enable-keepalive=true + +The KA feature can't be enabled at run time and should be done at startup +before ovs-vswitchd daemon is started. + +The default timer interval for monitoring packet processing threads is 1000ms. +To set a different timer value, run:: + + $ ovs-vsctl --no-wait set Open_vSwitch . \ + other_config:keepalive-interval="5000" + +The events comprise of thread states and the last seen timestamps. The events +are written in to process map periodically by keepalive thread. + +The events in the process map are retrieved by main(vswitchd) thread and +updated in to keepalive column of Open_vSwitch table in OVSDB. Any external +monitoring application can read the status from OVSDB at intervals or subscribe +to the updates so that they get notified when the changes happen on OvSDB. + +To monitor the datapath status using ovsdb-client, run:: + + $ ovsdb-client monitor Open_vSwitch + $ ovsdb-client monitor Open_vSwitch Open_vSwitch keepalive + +The datapath thread states are explained below:: + + KA_STATE_UNUSED - Not registered to KA framework. + KA_STATE_ALIVE - Thread alive. + KA_STATE_MISSING - Thread missed first heartbeat. + KA_STATE_DEAD - Thread missed two heartbeats. + KA_STATE_GONE - Thread missed two or more heartbeats and burried. + KA_STATE_SLEEP - Thread is sleeping. + +To query the datapath status, run:: + + $ ovs-appctl keepalive/pmd-health-show + +`collectd `__ has built-in support for DPDK and provides +a `ovs_events` and `ovs_stats` plugin that can be enabled to relay the datapath +status and the PMD status to OpenStack service `Ceilometer +`__. + +To install and configure `collectd`, run:: + + # Clone collectd from Git repository + $ git clone https://github.com/collectd/collectd.git + + # configure and install collectd + $ cd collectd + $ ./build.sh + $ ./configure --enable-syslog --enable-logfile --with-libdpdk=/usr + $ make + $ make install + +`collectd` is installed in ``/opt/collectd`` by default. Edit the configuration +file in ``/opt/collectd/etc/collectd.conf`` to enable logfile, dpdkevents +and csv plugin:: + + LoadPlugin logfile + + LogLevel debug + File "/var/log/collectd/collectd.log" + Timestamp true + PrintSeverity false + + + + LogLevel info + + +Enable `ovs_events` plugin and update the plugindetails as below:: + + LoadPlugin ovs_events + + + Port "6640" + Address "127.0.0.1" + Socket "/usr/local/var/run/openvswitch/db.sock" + SendNotification true + DispatchValues false + + +Enable `ovs_stats` plugin and update the plugindetails as below:: + + LoadPlugin ovs_stats + + + Port "6640" + Address "127.0.0.1" + Socket "/usr/local/var/run/openvswitch/db.sock" + Bridges "br0" + + +Enable ``csv`` plugin as below:: + + LoadPlugin csv + + + DataDir "/var/log/collectd/csv" + StoreRates false + + +With csv plugin enabled, *meter* or *gauge* file is created and timestamp +and thread status gets updated which are sent to ceilometer service. + .. _dpdk-ovs-in-guest: OVS with DPDK Inside VMs