From patchwork Thu Aug 6 15:17:10 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emma Finn X-Patchwork-Id: 1341768 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 4BMsYR1cbrz9sSG for ; Fri, 7 Aug 2020 01:17:31 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 5DC8186C2E; Thu, 6 Aug 2020 15:17:29 +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 HvP1ofG7WVzp; Thu, 6 Aug 2020 15:17:28 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by fraxinus.osuosl.org (Postfix) with ESMTP id BF57A86C29; Thu, 6 Aug 2020 15:17:28 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id B0AB6C0050; Thu, 6 Aug 2020 15:17:28 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by lists.linuxfoundation.org (Postfix) with ESMTP id 62712C004C for ; Thu, 6 Aug 2020 15:17:27 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 5183F86C2E for ; Thu, 6 Aug 2020 15:17:27 +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 C1CxgDcyDnKI for ; Thu, 6 Aug 2020 15:17:26 +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 fraxinus.osuosl.org (Postfix) with ESMTPS id A4B8B86C29 for ; Thu, 6 Aug 2020 15:17:26 +0000 (UTC) IronPort-SDR: Yk6T8YcjAT1oT0/9x4VyUY39v2Qq0aNGwumcQ4bLz5FpbrgrBIcogQIiUOd13tGYKwXsc/xun3 Mc87NAV5IArw== X-IronPort-AV: E=McAfee;i="6000,8403,9704"; a="140701720" X-IronPort-AV: E=Sophos;i="5.75,441,1589266800"; d="scan'208";a="140701720" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Aug 2020 08:17:25 -0700 IronPort-SDR: RlWWzNl/JNPoV/G0Q4uAvRCufCmQcGkOyrkqTKa+dUGudPiUOsGLpc4xhCQ81R/6vtJuMRY6X2 rTOkOob9J/iQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,441,1589266800"; d="scan'208";a="307056869" Received: from silpixa00397517.ir.intel.com ([10.237.222.183]) by orsmga002.jf.intel.com with ESMTP; 06 Aug 2020 08:17:23 -0700 From: Emma Finn To: dev@openvswitch.org Date: Thu, 6 Aug 2020 16:17:10 +0100 Message-Id: <1596727030-120460-1-git-send-email-emma.finn@intel.com> X-Mailer: git-send-email 2.7.4 Cc: elibr@mellanox.com, i.maximets@ovn.org Subject: [ovs-dev] [PATCH] netdev-offload-dpdk: Fix for broken ethernet matching HWOL for XL710 NIC 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: , MIME-Version: 1.0 Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" The following 2 commits introduced changes which caused a regression for XL710 devices and functionality ceases for partial offload as a result. 864852a0624a ("netdev-offload-dpdk: Fix Ethernet matching for type only.") a79eae87abe4 ("netdev-offload-dpdk: Remove pre-validate of patterns function.") Fixed by partial reversion of these changes. Signed-off-by: Emma Finn --- lib/netdev-offload-dpdk.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/lib/netdev-offload-dpdk.c b/lib/netdev-offload-dpdk.c index de6101e..b300884 100644 --- a/lib/netdev-offload-dpdk.c +++ b/lib/netdev-offload-dpdk.c @@ -691,8 +691,7 @@ parse_flow_match(struct flow_patterns *patterns, consumed_masks->packet_type = 0; /* Eth */ - if (match->wc.masks.dl_type || - !eth_addr_is_zero(match->wc.masks.dl_src) || + if (!eth_addr_is_zero(match->wc.masks.dl_src) || !eth_addr_is_zero(match->wc.masks.dl_dst)) { struct rte_flow_item_eth *spec, *mask; @@ -712,6 +711,16 @@ parse_flow_match(struct flow_patterns *patterns, consumed_masks->dl_type = 0; add_flow_pattern(patterns, RTE_FLOW_ITEM_TYPE_ETH, spec, mask); + } else { + /* + * If user specifies a flow (like UDP flow) without L2 patterns, + * OVS will at least set the dl_type. Normally, it's enough to + * create an eth pattern just with it. Unluckily, some Intel's + * NIC (such as XL710) doesn't support that. Below is a workaround, + * which simply matches any L2 pkts. + */ + consumed_masks->dl_type = 0; + add_flow_pattern(patterns, RTE_FLOW_ITEM_TYPE_ETH, NULL, NULL); } /* VLAN */