From patchwork Thu Jun 18 16:53:54 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Van Haaren, Harry" X-Patchwork-Id: 1312327 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.138; helo=whitealder.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=intel.com Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49np2X4lHKz9sRR for ; Fri, 19 Jun 2020 02:55:00 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id A998188A99; Thu, 18 Jun 2020 16:54:58 +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 CTKTVDT14+6W; Thu, 18 Jun 2020 16:54:51 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by whitealder.osuosl.org (Postfix) with ESMTP id 933E588B27; Thu, 18 Jun 2020 16:54:12 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 854CDC07FF; Thu, 18 Jun 2020 16:54:12 +0000 (UTC) X-Original-To: ovs-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 A8090C016E for ; Thu, 18 Jun 2020 16:54:11 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 9212588AB1 for ; Thu, 18 Jun 2020 16:54:11 +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 njb3c45cIQQk for ; Thu, 18 Jun 2020 16:54:06 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by whitealder.osuosl.org (Postfix) with ESMTPS id D0A6888ABD for ; Thu, 18 Jun 2020 16:53:56 +0000 (UTC) IronPort-SDR: 75Z0k0gLjNjNUzEckSuOEX57fTMOqN8Gf0jx7K0oi70iBdhfmfWnRkybXUvlWEd9rrujh0/gDF y63zC9QT0Uag== X-IronPort-AV: E=McAfee;i="6000,8403,9656"; a="141724130" X-IronPort-AV: E=Sophos;i="5.75,251,1589266800"; d="scan'208";a="141724130" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Jun 2020 09:53:56 -0700 IronPort-SDR: 3mPGwk4dRDwFPR1GpBCmzfPKT/Zn5W4h7WHlKvm4Rxh7HcLRhhYAqLJAl+tjvWQwUzd29qBVf/ a3pg5rppHy7g== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,251,1589266800"; d="scan'208";a="299760787" Received: from silpixa00399779.ir.intel.com (HELO silpixa00399779.ger.corp.intel.com) ([10.237.222.209]) by fmsmga004.fm.intel.com with ESMTP; 18 Jun 2020 09:53:55 -0700 From: Harry van Haaren To: ovs-dev@openvswitch.org Date: Thu, 18 Jun 2020 17:53:54 +0100 Message-Id: <20200618165354.87787-8-harry.van.haaren@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200618165354.87787-1-harry.van.haaren@intel.com> References: <20200610104839.54608-1-harry.van.haaren@intel.com> <20200618165354.87787-1-harry.van.haaren@intel.com> Cc: i.maximets@ovn.org Subject: [ovs-dev] [PATCH v4 7/7] docs/dpdk/bridge: add datapath performance section. 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: , MIME-Version: 1.0 Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" This commit adds a section to the dpdk/bridge.rst netdev documentation, detailing the added DPCLS functionality. The newly added commands are documented, and sample output is provided. Running the DPCLS autovalidator with unit tests by default is possible through re-compiling the autovalidator to have the highest priority at startup time. This avoids making changes to all tests, and enables debug and CI builds to validate every lookup implementation with all unit tests. Signed-off-by: Harry van Haaren Acked-by: William Tu --- v4: - Fix typos (William Tu) - Update get commands to use include "prio" as updated in v4 - Add section on enabling autovalidator by default for unit tests --- Documentation/topics/dpdk/bridge.rst | 77 ++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) diff --git a/Documentation/topics/dpdk/bridge.rst b/Documentation/topics/dpdk/bridge.rst index f0ef42ecc..526d5c959 100644 --- a/Documentation/topics/dpdk/bridge.rst +++ b/Documentation/topics/dpdk/bridge.rst @@ -137,3 +137,80 @@ currently turned off by default. To turn on SMC:: $ ovs-vsctl --no-wait set Open_vSwitch . other_config:smc-enable=true + +Datapath Classifier Performance +------------------------------- + +The datapath classifier (dpcls) performs wildcard rule matching, a compute +intensive process of matching a packet ``miniflow`` to a rule ``miniflow``. The +code that does this compute work impacts datapath performance, and optimizing +it can provide higher switching performance. + +Modern CPUs provide extensive SIMD instructions which can be used to get higher +performance. The CPU OVS is being deployed on must be capable of running these +SIMD instructions in order to take advantage of the performance benefits. +In OVS v2.14 runtime CPU detection was introduced to enable identifying if +these CPU ISA additions are available, and to allow the user to enable them. + +OVS provides multiple implementations of dpcls. The following command enables +the user to check what implementations are available in a running instance :: + + $ ovs-appctl dpif-netdev/subtable-lookup-prio-get + Available lookup functions (priority : name) + 0 : autovalidator + 1 : generic + 0 : avx512_gather + +To set the priority of a lookup function, run the ``prio-set`` command :: + + $ ovs-appctl dpif-netdev/subtable-lookup-prio-set avx512_gather 5 + Lookup priority change affected 1 dpcls ports and 1 subtables. + +The highest priority lookup function is used for classification, and the output +above indicates that one subtable of one DPCLS port is has changed its lookup +function due to the command being run. To verify the prioritization, re-run the +get command, note the updated priority of the ``avx512_gather`` function :: + + $ ovs-appctl dpif-netdev/subtable-lookup-prio-get + Available lookup functions (priority : name) + 0 : autovalidator + 1 : generic + 5 : avx512_gather + +If two lookup functions have the same priority, the first one in the list is +chosen, and the 2nd occurance of that priority is not used. Put in logical +terms, a subtable is chosen if its priority is greater than the previous +best candidate. + +CPU ISA Testing and Validation +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +As multiple versions of DPCLS can co-exist, each with different CPU ISA +optimizations, it is important to validate that they all give the exact same +results. To easily test all DPCLS implementations, an ``autovalidator`` +implementation of the DPCLS exists. This implementation runs all other +available DPCLS implementations, and verifies that the results are identical. + +Running the OVS unit tests with the autovalidator enabled ensures all +implementations provide the same results. Note that the performance of the +autovalidator is lower than all other implementations, as it tests the scalar +implementation against itself, and against all other enabled DPCLS +implementations. + +To adjust the DPCLS autovalidator priority, use this command :: + + $ ovs-appctl dpif-netdev/subtable-lookup-prio-set autovalidator 7 + +Running Unit Tests with Autovalidator ++++++++++++++++++++++++++++++++++++++ + +To run the OVS unit test suite with the DPCLS autovalidator as the default +implementation, it is required to recompile OVS. During the recompilation, +the default priority of the `autovalidator` implementation is set to the +maximum priority, ensuring every test will be run with every lookup +implementation :: + + $ ./configure --enable-autovalidator + +Compile OVS in debug mode to have `ovs_assert` statements error out if +there is a mis-match in the DPCLS lookup implementation.