From patchwork Wed Jul 17 13:00:28 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: 1133297 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 45pcmK16bQz9s8m for ; Wed, 17 Jul 2019 22:59:28 +1000 (AEST) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 436ABEBC; Wed, 17 Jul 2019 12:59:25 +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 55F28BA4 for ; Wed, 17 Jul 2019 12:59:23 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id D08A463D for ; Wed, 17 Jul 2019 12:59:22 +0000 (UTC) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 17 Jul 2019 05:59:21 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,274,1559545200"; d="scan'208";a="187553573" Received: from silpixa00399779.ir.intel.com (HELO silpixa00399779.ger.corp.intel.com) ([10.237.222.100]) by fmsmga001.fm.intel.com with ESMTP; 17 Jul 2019 05:59:20 -0700 From: Harry van Haaren To: dev@openvswitch.org Date: Wed, 17 Jul 2019 14:00:28 +0100 Message-Id: <20190717130033.25114-1-harry.van.haaren@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190715163636.51572-1-harry.van.haaren@intel.com> References: <20190715163636.51572-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 v12 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 v12 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 v11, they should all be addressed in this v12. Patchset details below, summary of v11 changes as follows: - Reworked various minor comments (Capitals, stops, and whitespace) - Moved variable declarations to patch they're used in - Improved function documentation on probe() - Reduced log level from info to debug - See per patch --- v12 notes for details. Given the nearing soft-freeze and branch deadlines, I'd like to see this get merged - and any future minor comments / improvements can be handled before release. 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