From patchwork Thu Jul 30 10:58:38 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eli Britstein X-Patchwork-Id: 1338754 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 4BHS9b72PYz9s1x for ; Thu, 30 Jul 2020 21:00:03 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id B8FF687E3B; Thu, 30 Jul 2020 11:00:00 +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 BgzpVf98V-Tk; Thu, 30 Jul 2020 11:00:00 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by hemlock.osuosl.org (Postfix) with ESMTP id E878C87D46; Thu, 30 Jul 2020 10:59:59 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id C87D2C0050; Thu, 30 Jul 2020 10:59:59 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by lists.linuxfoundation.org (Postfix) with ESMTP id 2B834C004D for ; Thu, 30 Jul 2020 10:59:59 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 0A0812051A for ; Thu, 30 Jul 2020 10:59:59 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id m4v1wLEW-Cnn for ; Thu, 30 Jul 2020 10:59:57 +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 silver.osuosl.org (Postfix) with ESMTP id D3A9220519 for ; Thu, 30 Jul 2020 10:59:56 +0000 (UTC) Received: from Internal Mail-Server by MTLPINE1 (envelope-from elibr@mellanox.com) with SMTP; 30 Jul 2020 13:59:50 +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 06UAxnoQ031715; Thu, 30 Jul 2020 13:59:49 +0300 From: Eli Britstein To: dev@openvswitch.org, Ilya Maximets Date: Thu, 30 Jul 2020 10:58:38 +0000 Message-Id: <20200730105838.5329-1-elibr@mellanox.com> X-Mailer: git-send-email 2.14.5 Cc: leiw@labmailer.mlnx, Lei Wang , Eli Britstein Subject: [ovs-dev] [PATCH 1/1] netdev-offload-dpdk: Support vxlan encap offload with load actions 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" From: Lei Wang Struct match has the tunnel values/masks in match->flow.tunnel/match->wc.masks.tunnel. Load actions such as load:0xa566c10->NXM_NX_TUN_IPV4_DST[], load:0xbba->NXM_NX_TUN_ID[] are utilizing the tunnel masks fields, but those should not be used for matching. Offloading fails if masks is not clear. Clear it if no tunnel used. Signed-off-by: Lei Wang Reviewed-by: Eli Britstein Reviewed-by: Gaetan Rivet Signed-off-by: Eli Britstein Acked-by: Sriharsha Basavapatna Tested-by: Emma Finn --- lib/netdev-offload-dpdk.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/netdev-offload-dpdk.c b/lib/netdev-offload-dpdk.c index de6101e4d..0d23e4879 100644 --- a/lib/netdev-offload-dpdk.c +++ b/lib/netdev-offload-dpdk.c @@ -682,6 +682,10 @@ parse_flow_match(struct flow_patterns *patterns, consumed_masks = &match->wc.masks; + if (!flow_tnl_dst_is_set(&match->flow.tunnel)) { + memset(&match->wc.masks.tunnel, 0, sizeof match->wc.masks.tunnel); + } + memset(&consumed_masks->in_port, 0, sizeof consumed_masks->in_port); /* recirc id must be zero. */ if (match->wc.masks.recirc_id & match->flow.recirc_id) {