From patchwork Wed Nov 25 18:43:42 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: 1406225 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=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=intel.com 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 4Ch8wD6l2nz9sRR for ; Thu, 26 Nov 2020 05:45:32 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 8543286FBE; Wed, 25 Nov 2020 18:45:31 +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 Gm_PwdUFgice; Wed, 25 Nov 2020 18:45:28 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by fraxinus.osuosl.org (Postfix) with ESMTP id 02E4786FD5; Wed, 25 Nov 2020 18:45:10 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id E0926C1DA0; Wed, 25 Nov 2020 18:45:09 +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 A6F6FC0891 for ; Wed, 25 Nov 2020 18:45:08 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 8F240873DE for ; Wed, 25 Nov 2020 18:45:08 +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 XYzVyU9UMZ0C for ; Wed, 25 Nov 2020 18:45:00 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by whitealder.osuosl.org (Postfix) with ESMTPS id 0FB95873DF for ; Wed, 25 Nov 2020 18:44:33 +0000 (UTC) IronPort-SDR: hDuQ9xOHfcAeat0A3fT0pOQ1LqvDYO6iB6ez2c68rSZHOkavgYo4S4yrcrDRKZqv6xr7oL6WtI EVpczWueleHQ== X-IronPort-AV: E=McAfee;i="6000,8403,9816"; a="190328230" X-IronPort-AV: E=Sophos;i="5.78,369,1599548400"; d="scan'208";a="190328230" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Nov 2020 10:44:32 -0800 IronPort-SDR: s9UXVQNKWC1S27bvz3z7owukJW7Yymh8jDKNvpvgH2pDXNxINlDNyB7eXPPtA+Dr2Y+b2wM5S+ Fj1JUx7xDxMA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.78,369,1599548400"; d="scan'208";a="403380009" Received: from silpixa00400633.ir.intel.com ([10.237.213.210]) by orsmga001.jf.intel.com with ESMTP; 25 Nov 2020 10:44:30 -0800 From: Harry van Haaren To: ovs-dev@openvswitch.org Date: Wed, 25 Nov 2020 18:43:42 +0000 Message-Id: <20201125184342.2715681-12-harry.van.haaren@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201125184342.2715681-1-harry.van.haaren@intel.com> References: <20201118161501.1710801-1-harry.van.haaren@intel.com> <20201125184342.2715681-1-harry.van.haaren@intel.com> MIME-Version: 1.0 Cc: i.maximets@ovn.org Subject: [ovs-dev] [PATCH v4 11/11] dpif-netdev: enable scalar datapath with optimized miniflow extract 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 enables the scalar datapath to utilize the SIMD accelerated packet parsing for the parsing of the outer packet. Signed-off-by: Harry van Haaren --- lib/dpif-netdev.c | 46 ++++++++++++++++++++++++++++++---------------- 1 file changed, 30 insertions(+), 16 deletions(-) diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c index 5627277c4..500da3c14 100644 --- a/lib/dpif-netdev.c +++ b/lib/dpif-netdev.c @@ -6828,27 +6828,41 @@ dfc_processing(struct dp_netdev_pmd_thread *pmd, pkt_metadata_init(&packet->md, port_no); } - if ((*recirc_depth_get() == 0) && - dp_packet_has_flow_mark(packet, &mark)) { - flow = mark_to_flow_find(pmd, mark); - if (OVS_LIKELY(flow)) { - tcp_flags = parse_tcp_flags(packet); - if (OVS_LIKELY(batch_enable)) { - dp_netdev_queue_batches(packet, flow, tcp_flags, batches, - n_batches); - } else { - /* Flow batching should be performed only after fast-path - * processing is also completed for packets with emc miss - * or else it will result in reordering of packets with - * same datapath flows. */ - packet_enqueue_to_flow_map(packet, flow, tcp_flags, - flow_map, map_cnt++); + /* Outer classification checks only */ + uint32_t miniflow_extract_done = 0; + if (*recirc_depth_get() == 0) { + /* Check if packet has hardware flow mark */ + if (dp_packet_has_flow_mark(packet, &mark)) { + flow = mark_to_flow_find(pmd, mark); + if (OVS_LIKELY(flow)) { + tcp_flags = parse_tcp_flags(packet); + if (OVS_LIKELY(batch_enable)) { + dp_netdev_queue_batches(packet, flow, tcp_flags, + batches, n_batches); + } else { + /* Flow batching should be performed only after fast- + * path processing is also completed for packets with + * emc miss or else it will result in reordering of + * packets with same datapath flows. + */ + packet_enqueue_to_flow_map(packet, flow, tcp_flags, + flow_map, map_cnt++); + } } continue; } + + /* Use optimized outer miniflow extract if available */ + if (pmd->miniflow_extract_opt) { + miniflow_extract_done = pmd->miniflow_extract_opt(pmd, packet, + &key->mf); + } + } + + if (!miniflow_extract_done) { + miniflow_extract(packet, &key->mf); } - miniflow_extract(packet, &key->mf); key->len = 0; /* Not computed yet. */ key->hash = (md_is_valid == false)