From patchwork Mon Jul 15 16:36:31 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Van Haaren, Harry" X-Patchwork-Id: 1132097 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=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=intel.com 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 45nTfh516fz9sDQ for ; Tue, 16 Jul 2019 02:35:40 +1000 (AEST) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id B2EEDE22; Mon, 15 Jul 2019 16:35:21 +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 6E87AE30 for ; Mon, 15 Jul 2019 16:35:20 +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 504A4886 for ; Mon, 15 Jul 2019 16:35:19 +0000 (UTC) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 15 Jul 2019 09:35:18 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.63,493,1557212400"; d="scan'208";a="168993642" Received: from silpixa00399779.ir.intel.com (HELO silpixa00399779.ger.corp.intel.com) ([10.237.222.100]) by fmsmga007.fm.intel.com with ESMTP; 15 Jul 2019 09:35:17 -0700 From: Harry van Haaren To: dev@openvswitch.org Date: Mon, 15 Jul 2019 17:36:31 +0100 Message-Id: <20190715163636.51572-1-harry.van.haaren@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190709123440.45519-1-harry.van.haaren@intel.com> References: <20190709123440.45519-1-harry.van.haaren@intel.com> X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Cc: i.maximets@samsung.com Subject: [ovs-dev] [PATCH v11 0/5] dpcls func ptrs & optimizations 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 Hey Folks, Here a v11 of the DPCLS Function Pointer patchset, as has been presented at OVS Conf in Nov '18, and discussed on the ML since then. I'm aware of the soft-freeze for 2.12, I feel this patchset has had enough reviews/versions/testing to be merged in 2.12. Thanks Ilya and Ian for review comments on v10, they should all be addressed in this v11. Patchset details below, summary of v11 changes as follows: - Reworked to use hash_add_words64(), unfortunatly hash_words64_inline() did not provide the same has due to it calling hash_finish() with a different "final" value. Refactored to re-use as much as we can of the existing code. - Reworked specialized functions to use MACROs as suggested in review. This makes the specialization of functions much more tidy - good suggestion! - Reworked lots of little fixes, Captials and stops. - Added NEWS entry in "Userspace Datapath" section on DPCLS function pointers and how specialization of subtables minfilows gains search performance. - See per patch --- v11 notes for details :) Regards, -Harry Patchset details; 1) Refactor dpcls_lookup and the subtable for flexibility. In particular, add a function pointer to the subtable structure, which enables "plugging-in" a lookup function at runtime. This enables a number of optimizations in future. 2) and 3) With the function pointer in place, we refactor the existing dpcls_lookup matching code into its own function, and later its own file. To split it to its own file requires making various dpcls data-structures available in dpif-netdev-private.h. 4) Refactor the existing code, to favour compute of flat arrays of miniflows, instead of the MACRO based iteration. This simplifies the code itself, and makes future optimizations possible due to simplified loop structures, and loop trip counts pass in via function arguments. See commit message for more details. 5) This patch implements a select few specialized functions, for handling miniflows with 5-1, 4-1, and 4-0 miniflow unit bit patterns. More of these types of functions can (and should) be added to accelerate other patterns of subtable lookups! See commit message for more details. Harry van Haaren (5): dpif-netdev: Implement function pointers/subtable dpif-netdev: Move dpcls lookup structures to .h dpif-netdev: Split out generic lookup function dpif-netdev: Refactor generic implementation dpif-netdev: Add specialized generic scalar functions NEWS | 4 + lib/automake.mk | 2 + lib/dpif-netdev-lookup-generic.c | 290 +++++++++++++++++++++++++++++++ lib/dpif-netdev-private.h | 129 ++++++++++++++ lib/dpif-netdev.c | 197 ++++++++++----------- 5 files changed, 525 insertions(+), 97 deletions(-) create mode 100644 lib/dpif-netdev-lookup-generic.c create mode 100644 lib/dpif-netdev-private.h