From patchwork Sun Jun 21 11:19:24 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eli Britstein X-Patchwork-Id: 1313896 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.133; helo=hemlock.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=mellanox.com Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49qVSY18dzz9sRh for ; Sun, 21 Jun 2020 21:19:56 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id B6A9A896A3; Sun, 21 Jun 2020 11:19:53 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id S2PhiAuPeZ5M; Sun, 21 Jun 2020 11:19:52 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by hemlock.osuosl.org (Postfix) with ESMTP id 64F98894A2; Sun, 21 Jun 2020 11:19:52 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 44A7CC08A2; Sun, 21 Jun 2020 11:19:52 +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 3D382C07FF for ; Sun, 21 Jun 2020 11:19:50 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 2D37986F47 for ; Sun, 21 Jun 2020 11:19:50 +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 wNsAtfKfb87K for ; Sun, 21 Jun 2020 11:19:49 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129]) by fraxinus.osuosl.org (Postfix) with ESMTP id 9220F86F32 for ; Sun, 21 Jun 2020 11:19:48 +0000 (UTC) Received: from Internal Mail-Server by MTLPINE1 (envelope-from elibr@mellanox.com) with SMTP; 21 Jun 2020 14:19:46 +0300 Received: from dev-r-vrt-215.mtr.labs.mlnx. (dev-r-vrt-215.mtr.labs.mlnx [10.212.215.1]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id 05LBJis2013908; Sun, 21 Jun 2020 14:19:45 +0300 From: Eli Britstein To: dev@openvswitch.org, Ilya Maximets Date: Sun, 21 Jun 2020 11:19:24 +0000 Message-Id: <20200621111924.12397-13-elibr@mellanox.com> X-Mailer: git-send-email 2.14.5 In-Reply-To: <20200621111924.12397-1-elibr@mellanox.com> References: <20200621111924.12397-1-elibr@mellanox.com> Cc: Eli Britstein , Ameer Mahagneh Subject: [ovs-dev] [PATCH V3 12/12] netdev-offload-dpdk: Fix Ethernet matching for type only 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" For OVS rule of the form "eth type is 0x1234 / end", rule is offloaded in the form of "eth / end", which is incorrect. Fix it. Fixes: e8a2b5bf92bb ("netdev-dpdk: implement flow offload with rte flow") Signed-off-by: Eli Britstein Reviewed-by: Roni Bar Yanai --- lib/netdev-offload-dpdk.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/netdev-offload-dpdk.c b/lib/netdev-offload-dpdk.c index e8b8d6464..e68b6549c 100644 --- a/lib/netdev-offload-dpdk.c +++ b/lib/netdev-offload-dpdk.c @@ -860,7 +860,8 @@ parse_flow_match(struct flow_patterns *patterns, /* Eth */ if (!eth_addr_is_zero(match->wc.masks.dl_src) || - !eth_addr_is_zero(match->wc.masks.dl_dst)) { + !eth_addr_is_zero(match->wc.masks.dl_dst) || + match->wc.masks.dl_type) { struct rte_flow_item_eth *spec, *mask; spec = xzalloc(sizeof *spec); @@ -876,6 +877,7 @@ parse_flow_match(struct flow_patterns *patterns, memset(&consumed_masks->dl_dst, 0, sizeof consumed_masks->dl_dst); memset(&consumed_masks->dl_src, 0, sizeof consumed_masks->dl_src); + consumed_masks->dl_type = 0; add_flow_pattern(patterns, RTE_FLOW_ITEM_TYPE_ETH, spec, mask); } else { @@ -888,7 +890,6 @@ parse_flow_match(struct flow_patterns *patterns, */ add_flow_pattern(patterns, RTE_FLOW_ITEM_TYPE_ETH, NULL, NULL); } - consumed_masks->dl_type = 0; /* VLAN */ if (match->wc.masks.vlans[0].tci && match->flow.vlans[0].tci) {