From patchwork Fri Jul 21 23:46:09 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joe Stringer X-Patchwork-Id: 792415 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=openvswitch.org (client-ip=140.211.169.12; helo=mail.linuxfoundation.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3xDnZC4pPgz9s7m for ; Sat, 22 Jul 2017 09:50:11 +1000 (AEST) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 75EDC92F; Fri, 21 Jul 2017 23:46:36 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@mail.linuxfoundation.org Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id A7B32BE8 for ; Fri, 21 Jul 2017 23:46:33 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from relay4-d.mail.gandi.net (relay4-d.mail.gandi.net [217.70.183.196]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 0370D171 for ; Fri, 21 Jul 2017 23:46:33 +0000 (UTC) Received: from mfilter11-d.gandi.net (mfilter11-d.gandi.net [217.70.178.131]) by relay4-d.mail.gandi.net (Postfix) with ESMTP id D86A217209A; Sat, 22 Jul 2017 01:46:31 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at mfilter11-d.gandi.net Received: from relay4-d.mail.gandi.net ([IPv6:::ffff:217.70.183.196]) by mfilter11-d.gandi.net (mfilter11-d.gandi.net [::ffff:10.0.15.180]) (amavisd-new, port 10024) with ESMTP id KO9YeM1-ZSik; Sat, 22 Jul 2017 01:46:30 +0200 (CEST) X-Originating-IP: 208.91.1.34 Received: from carno.eng.vmware.com (unknown [208.91.1.34]) (Authenticated sender: joe@ovn.org) by relay4-d.mail.gandi.net (Postfix) with ESMTPSA id 5CEAC172094; Sat, 22 Jul 2017 01:46:29 +0200 (CEST) From: Joe Stringer To: dev@openvswitch.org Date: Fri, 21 Jul 2017 16:46:09 -0700 Message-Id: <20170721234614.2800-7-joe@ovn.org> X-Mailer: git-send-email 2.11.1 In-Reply-To: <20170721234614.2800-1-joe@ovn.org> References: <20170721234614.2800-1-joe@ovn.org> X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Subject: [ovs-dev] [PATCH 06/11] datapath: get rid of redundant vxlan_dev.flags X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: ovs-dev-bounces@openvswitch.org Errors-To: ovs-dev-bounces@openvswitch.org From: Greg Rose Upstream commit: commit dc5321d79697db1b610c25fa4fad1aec7533ea3e Author: Matthias Schiffer Date: Mon Jun 19 10:03:56 2017 +0200 vxlan: get rid of redundant vxlan_dev.flags There is no good reason to keep the flags twice in vxlan_dev and vxlan_config. Signed-off-by: Matthias Schiffer Signed-off-by: David S. Miller Applied using HAVE_VXLAN_DEV_CFG compatibility flag defined in acinclude.m4. Signed-off-by: Greg Rose Signed-off-by: Joe Stringer --- v2: Shift compat symbol definitions to patch which uses it. --- acinclude.m4 | 2 ++ datapath/vport-vxlan.c | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/acinclude.m4 b/acinclude.m4 index 99326824923c..d72e13cd6c73 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -753,6 +753,8 @@ AC_DEFUN([OVS_CHECK_LINUX_COMPAT], [ OVS_FIND_FIELD_IFELSE([$KSRC/include/linux/netdevice.h], [net_device], [needs_free_netdev], [OVS_DEFINE([HAVE_NEEDS_FREE_NETDEV])]) + OVS_FIND_FIELD_IFELSE([$KSRC/include/net/vxlan.h], [vxlan_dev], [cfg], + [OVS_DEFINE([HAVE_VXLAN_DEV_CFG])]) OVS_GREP_IFELSE([$KSRC/include/net/netfilter/nf_conntrack_helper.h], [nf_conntrack_helper_put]) diff --git a/datapath/vport-vxlan.c b/datapath/vport-vxlan.c index fbde91f50ec5..291069441262 100644 --- a/datapath/vport-vxlan.c +++ b/datapath/vport-vxlan.c @@ -40,14 +40,22 @@ static int vxlan_get_options(const struct vport *vport, struct sk_buff *skb) if (nla_put_u16(skb, OVS_TUNNEL_ATTR_DST_PORT, ntohs(dst_port))) return -EMSGSIZE; +#ifdef HAVE_VXLAN_DEV_CFG + if (vxlan->cfg.flags & VXLAN_F_GBP) { +#else if (vxlan->flags & VXLAN_F_GBP) { +#endif struct nlattr *exts; exts = nla_nest_start(skb, OVS_TUNNEL_ATTR_EXTENSION); if (!exts) return -EMSGSIZE; +#ifdef HAVE_VXLAN_DEV_CFG + if (vxlan->cfg.flags & VXLAN_F_GBP && +#else if (vxlan->flags & VXLAN_F_GBP && +#endif nla_put_flag(skb, OVS_VXLAN_EXT_GBP)) return -EMSGSIZE;