From patchwork Fri Feb 12 17:17:13 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Van Haaren, Harry" X-Patchwork-Id: 1439954 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.137; helo=fraxinus.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4DcgG025YGz9sVX for ; Sat, 13 Feb 2021 04:19:04 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id D355287034; Fri, 12 Feb 2021 17:19:02 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id AiBHJIYfgd4g; Fri, 12 Feb 2021 17:19:01 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by fraxinus.osuosl.org (Postfix) with ESMTP id D4B5C870B2; Fri, 12 Feb 2021 17:18:39 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id A7C65C1D9F; Fri, 12 Feb 2021 17:18:39 +0000 (UTC) X-Original-To: ovs-dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by lists.linuxfoundation.org (Postfix) with ESMTP id 77F29C0891 for ; Fri, 12 Feb 2021 17:18:37 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 4B95F6F7B8 for ; Fri, 12 Feb 2021 17:18:37 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id gTOdtMp8b2mX for ; Fri, 12 Feb 2021 17:18:35 +0000 (UTC) Received: by smtp3.osuosl.org (Postfix, from userid 1001) id C628F6F90C; Fri, 12 Feb 2021 17:18:35 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by smtp3.osuosl.org (Postfix) with ESMTPS id F42136F8BF for ; Fri, 12 Feb 2021 17:17:49 +0000 (UTC) IronPort-SDR: sPcrEoa8vHwmynA+6+cChy5fFmM4HVoOo42XOigU0/z9WYif/YSuoQW/EQTqjoaU25hdqJo2A0 ALcMJDgqc7Rw== X-IronPort-AV: E=McAfee;i="6000,8403,9893"; a="201595232" X-IronPort-AV: E=Sophos;i="5.81,174,1610438400"; d="scan'208";a="201595232" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Feb 2021 09:17:49 -0800 IronPort-SDR: LKP9BbFeiVswSo4LT0qiaq//RHrXUkZ6/drE2VYG1se/xFy8vFuETSiM/N4stflVagEe+jg9s8 VwhPXlKyG2kA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.81,174,1610438400"; d="scan'208";a="360485113" Received: from silpixa00400633.ir.intel.com ([10.237.213.44]) by orsmga003.jf.intel.com with ESMTP; 12 Feb 2021 09:17:48 -0800 From: Harry van Haaren To: ovs-dev@openvswitch.org Date: Fri, 12 Feb 2021 17:17:13 +0000 Message-Id: <20210212171718.2189798-12-harry.van.haaren@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210212171718.2189798-1-harry.van.haaren@intel.com> References: <20210104163653.2218575-1-harry.van.haaren@intel.com> <20210212171718.2189798-1-harry.van.haaren@intel.com> MIME-Version: 1.0 Cc: i.maximets@ovn.org Subject: [ovs-dev] [PATCH v9 11/16] dpif-netdev/dpcls: specialize more subtable signatures. 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" This commit adds more subtables to be specialized. The traffic pattern here being matched is VXLAN traffic subtables, which commonly have (5,3), (9,1) and (9,4) subtable fingerprints. Signed-off-by: Harry van Haaren --- v8: Add NEWS entry. --- NEWS | 2 ++ lib/dpif-netdev-lookup-avx512-gather.c | 6 ++++++ lib/dpif-netdev-lookup-generic.c | 6 ++++++ 3 files changed, 14 insertions(+) diff --git a/NEWS b/NEWS index d3b9221ed..a5bb16da2 100644 --- a/NEWS +++ b/NEWS @@ -8,6 +8,8 @@ Post-v2.15.0 packets. It supports partial HWOL, EMC, SMC and DPCLS lookups. * Add commands to get and set the dpif implementations. * Enable AVX512 optimized DPCLS to search subtables with larger miniflows. + * Add more specialized DPCLS subtables to cover common rules, enhancing + the lookup performance. v2.15.0 - xx xxx xxxx --------------------- diff --git a/lib/dpif-netdev-lookup-avx512-gather.c b/lib/dpif-netdev-lookup-avx512-gather.c index 1f27c0536..3a684fadf 100644 --- a/lib/dpif-netdev-lookup-avx512-gather.c +++ b/lib/dpif-netdev-lookup-avx512-gather.c @@ -299,6 +299,9 @@ avx512_lookup_impl(struct dpcls_subtable *subtable, return avx512_lookup_impl(subtable, keys_map, keys, rules, U0, U1); \ } \ +DECLARE_OPTIMIZED_LOOKUP_FUNCTION(9, 4) +DECLARE_OPTIMIZED_LOOKUP_FUNCTION(9, 1) +DECLARE_OPTIMIZED_LOOKUP_FUNCTION(5, 3) DECLARE_OPTIMIZED_LOOKUP_FUNCTION(5, 1) DECLARE_OPTIMIZED_LOOKUP_FUNCTION(4, 1) DECLARE_OPTIMIZED_LOOKUP_FUNCTION(4, 0) @@ -331,6 +334,9 @@ dpcls_subtable_avx512_gather_probe(uint32_t u0_bits, uint32_t u1_bits) return NULL; } + CHECK_LOOKUP_FUNCTION(9, 4); + CHECK_LOOKUP_FUNCTION(9, 1); + CHECK_LOOKUP_FUNCTION(5, 3); CHECK_LOOKUP_FUNCTION(5, 1); CHECK_LOOKUP_FUNCTION(4, 1); CHECK_LOOKUP_FUNCTION(4, 0); diff --git a/lib/dpif-netdev-lookup-generic.c b/lib/dpif-netdev-lookup-generic.c index e3b6be4b6..6c74ac3a1 100644 --- a/lib/dpif-netdev-lookup-generic.c +++ b/lib/dpif-netdev-lookup-generic.c @@ -282,6 +282,9 @@ dpcls_subtable_lookup_generic(struct dpcls_subtable *subtable, return lookup_generic_impl(subtable, keys_map, keys, rules, U0, U1); \ } \ +DECLARE_OPTIMIZED_LOOKUP_FUNCTION(9, 4) +DECLARE_OPTIMIZED_LOOKUP_FUNCTION(9, 1) +DECLARE_OPTIMIZED_LOOKUP_FUNCTION(5, 3) DECLARE_OPTIMIZED_LOOKUP_FUNCTION(5, 1) DECLARE_OPTIMIZED_LOOKUP_FUNCTION(4, 1) DECLARE_OPTIMIZED_LOOKUP_FUNCTION(4, 0) @@ -303,6 +306,9 @@ dpcls_subtable_generic_probe(uint32_t u0_bits, uint32_t u1_bits) { dpcls_subtable_lookup_func f = NULL; + CHECK_LOOKUP_FUNCTION(9, 4); + CHECK_LOOKUP_FUNCTION(9, 1); + CHECK_LOOKUP_FUNCTION(5, 3); CHECK_LOOKUP_FUNCTION(5, 1); CHECK_LOOKUP_FUNCTION(4, 1); CHECK_LOOKUP_FUNCTION(4, 0);