From patchwork Thu Feb 4 10:23:38 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Salem Sol X-Patchwork-Id: 1436032 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.136; helo=silver.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4DWgQS5gZJz9sXJ for ; Fri, 5 Feb 2021 01:09:04 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 2CF0B2E19E; Thu, 4 Feb 2021 14:09:02 +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 bS6BeMltNWzQ; Thu, 4 Feb 2021 14:08:54 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by silver.osuosl.org (Postfix) with ESMTP id 8F5652042B; Thu, 4 Feb 2021 14:08:54 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 4FC30C0174; Thu, 4 Feb 2021 14:08:54 +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 B7753C013A for ; Thu, 4 Feb 2021 10:23:48 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id AA91084FAE for ; Thu, 4 Feb 2021 10:23:48 +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 96ZImbQiutn4 for ; Thu, 4 Feb 2021 10:23:47 +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 whitealder.osuosl.org (Postfix) with ESMTP id F085784EED for ; Thu, 4 Feb 2021 10:23:46 +0000 (UTC) Received: from Internal Mail-Server by MTLPINE1 (envelope-from salems@nvidia.com) with SMTP; 4 Feb 2021 12:23:41 +0200 Received: from nvidia.com (mtl-vdi-564.wap.labs.mlnx [10.228.128.224]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id 114ANfNg007335; Thu, 4 Feb 2021 12:23:41 +0200 From: Salem Sol To: dev@openvswitch.org, Ilya Maximets Date: Thu, 4 Feb 2021 12:23:38 +0200 Message-Id: <20210204102338.128960-1-salems@nvidia.com> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 X-Mailman-Approved-At: Thu, 04 Feb 2021 14:08:53 +0000 Cc: Eli Britstein , Gaetan Rivet Subject: [ovs-dev] [PATCH 1/1] netdev-native-tnl: Set FLOW_TNL_F_UDPIF only if geneve options exists 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" FLOW_TNL_F_UDPIF is always set for geneve, which leads to wrong miniflow bits mapping in case of a flow modification. Fix it by setting the bit only if geneve options exist. Fixes: ("6728d578f64e dpif-netdev: Translate Geneve options per-flow, not per-packet.") Signed-off-by: Salem Sol Reviewed-by: Eli Britstein --- lib/netdev-native-tnl.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/netdev-native-tnl.c b/lib/netdev-native-tnl.c index b89dfdd52..3a8b2ea1c 100644 --- a/lib/netdev-native-tnl.c +++ b/lib/netdev-native-tnl.c @@ -1017,7 +1017,9 @@ netdev_geneve_pop_header(struct dp_packet *packet) memcpy(tnl->metadata.opts.gnv, gnh->options, opts_len); tnl->metadata.present.len = opts_len; - tnl->flags |= FLOW_TNL_F_UDPIF; + if (opts_len) { + tnl->flags |= FLOW_TNL_F_UDPIF; + } packet->packet_type = htonl(PT_ETH); dp_packet_reset_packet(packet, hlen);