From patchwork Thu Aug 6 15:18:27 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emma Finn X-Patchwork-Id: 1341769 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.138; helo=whitealder.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 whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BMsb00QlGz9sSG for ; Fri, 7 Aug 2020 01:18:52 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 8338D8830D; Thu, 6 Aug 2020 15:18:50 +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 U8dwgrk5RHRP; Thu, 6 Aug 2020 15:18:48 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by whitealder.osuosl.org (Postfix) with ESMTP id C2CEC882EC; Thu, 6 Aug 2020 15:18:48 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id A5D73C0050; Thu, 6 Aug 2020 15:18:48 +0000 (UTC) X-Original-To: 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 63139C004C for ; Thu, 6 Aug 2020 15:18:47 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 5EF418822C for ; Thu, 6 Aug 2020 15:18:47 +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 PkhXCa9ZYP+D for ; Thu, 6 Aug 2020 15:18:46 +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 whitealder.osuosl.org (Postfix) with ESMTPS id A9E6B881B3 for ; Thu, 6 Aug 2020 15:18:46 +0000 (UTC) IronPort-SDR: /6f1OWUXVeAP0qOwBfVr3jzIFX6D/PBC9Gmo5ezT43UKmHJUOeoFmC+nsIUkhSQUYMkZcZRHt2 JE/cVtXHCoxw== X-IronPort-AV: E=McAfee;i="6000,8403,9704"; a="140702373" X-IronPort-AV: E=Sophos;i="5.75,441,1589266800"; d="scan'208";a="140702373" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Aug 2020 08:18:37 -0700 IronPort-SDR: pPUgMfY1rUrilv2JZlx8L6v6ycFgCET7DRQajcb1d67MFDE8ECU3HDmyF++/FGlG8KTNrLfm4y C9NSQW6N4tKg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,441,1589266800"; d="scan'208";a="367612087" Received: from silpixa00397517.ir.intel.com ([10.237.222.183]) by orsmga001.jf.intel.com with ESMTP; 06 Aug 2020 08:18:35 -0700 From: Emma Finn To: dev@openvswitch.org Date: Thu, 6 Aug 2020 16:18:27 +0100 Message-Id: <1596727107-120520-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 branch-2.13] 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 commit 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.") Fixed by reversion of these changes. Signed-off-by: Emma Finn --- lib/netdev-offload-dpdk.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/lib/netdev-offload-dpdk.c b/lib/netdev-offload-dpdk.c index f97b8f8..c7f25b2 100644 --- a/lib/netdev-offload-dpdk.c +++ b/lib/netdev-offload-dpdk.c @@ -565,8 +565,7 @@ parse_flow_match(struct flow_patterns *patterns, uint8_t proto = 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; @@ -582,6 +581,15 @@ parse_flow_match(struct flow_patterns *patterns, mask->type = match->wc.masks.dl_type; 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. + */ + add_flow_pattern(patterns, RTE_FLOW_ITEM_TYPE_VLAN, NULL, NULL); } /* VLAN */