From patchwork Thu Jun 17 16:18:23 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Ferriter, Cian" X-Patchwork-Id: 1493719 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=smtp4.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4G5S1m13y0z9s24 for ; Fri, 18 Jun 2021 02:19:40 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 7D68642380; Thu, 17 Jun 2021 16:19:37 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 8QJmd-R90JTJ; Thu, 17 Jun 2021 16:19:35 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp4.osuosl.org (Postfix) with ESMTPS id 483F0421DB; Thu, 17 Jun 2021 16:19:30 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id F0AB6C000D; Thu, 17 Jun 2021 16:19:29 +0000 (UTC) X-Original-To: ovs-dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp4.osuosl.org (smtp4.osuosl.org [IPv6:2605:bc80:3010::137]) by lists.linuxfoundation.org (Postfix) with ESMTP id 236E5C0022 for ; Thu, 17 Jun 2021 16:19:29 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id B580742250 for ; Thu, 17 Jun 2021 16:19:14 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id acIH5ZDsFT1x for ; Thu, 17 Jun 2021 16:19:12 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by smtp4.osuosl.org (Postfix) with ESMTPS id 3D65A42201 for ; Thu, 17 Jun 2021 16:19:09 +0000 (UTC) IronPort-SDR: SW8zZPsvgYo4dIm39Hc+g3l8K7OftnsVQ/6TwZ0kei09485sLMHs8ZKsSTEfPfcM7MEXIoK1h5 OINF3VM/exzQ== X-IronPort-AV: E=McAfee;i="6200,9189,10018"; a="186094085" X-IronPort-AV: E=Sophos;i="5.83,280,1616482800"; d="scan'208";a="186094085" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Jun 2021 09:19:08 -0700 IronPort-SDR: IsA0yBSfPcBWUAxgdeDdew0NhYXt0q8lOE9nm4el7hVw/cWTduSsYfjdOEFyf0RL1EiaTQej44 86xAJvbZ3P9Q== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.83,280,1616482800"; d="scan'208";a="404985780" Received: from silpixa00399779.ir.intel.com (HELO silpixa00399779.ger.corp.intel.com) ([10.237.222.105]) by orsmga003.jf.intel.com with ESMTP; 17 Jun 2021 09:19:07 -0700 From: Cian Ferriter To: ovs-dev@openvswitch.org Date: Thu, 17 Jun 2021 17:18:23 +0100 Message-Id: <20210617161825.94741-11-cian.ferriter@intel.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210617161825.94741-1-cian.ferriter@intel.com> References: <20210617161825.94741-1-cian.ferriter@intel.com> MIME-Version: 1.0 Cc: i.maximets@ovn.org Subject: [ovs-dev] [v13 10/12] 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" From: Harry van Haaren 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 Acked-by: Flavio Leitner --- 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 523ff4b37..f03bfeb5d 100644 --- a/NEWS +++ b/NEWS @@ -16,6 +16,8 @@ Post-v2.15.0 * Add a partial HWOL PMD statistic counting hits similar to existing EMC/SMC/DPCLS stats. * Enable AVX512 optimized DPCLS to search subtables with larger miniflows. + * Add more specialized DPCLS subtables to cover common rules, enhancing + the lookup performance. - ovs-ctl: * New option '--no-record-hostname' to disable hostname configuration in ovsdb on startup. diff --git a/lib/dpif-netdev-lookup-avx512-gather.c b/lib/dpif-netdev-lookup-avx512-gather.c index f1b320bb6..0b51ef9dc 100644 --- a/lib/dpif-netdev-lookup-avx512-gather.c +++ b/lib/dpif-netdev-lookup-avx512-gather.c @@ -314,6 +314,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) @@ -346,6 +349,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);