From patchwork Thu Jul 21 18:14:17 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thadeu Lima de Souza Cascardo X-Patchwork-Id: 651361 X-Patchwork-Delegate: pshelar@ovn.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from archives.nicira.com (archives.nicira.com [96.126.127.54]) by ozlabs.org (Postfix) with ESMTP id 3rwMQG3fsFz9sxS for ; Fri, 22 Jul 2016 04:15:18 +1000 (AEST) Received: from archives.nicira.com (localhost [127.0.0.1]) by archives.nicira.com (Postfix) with ESMTP id D956210C77; Thu, 21 Jul 2016 11:14:44 -0700 (PDT) X-Original-To: dev@openvswitch.org Delivered-To: dev@openvswitch.org Received: from mx3v3.cudamail.com (mx3.cudamail.com [64.34.241.5]) by archives.nicira.com (Postfix) with ESMTPS id 9B59C10C73 for ; Thu, 21 Jul 2016 11:14:41 -0700 (PDT) Received: from bar6.cudamail.com (localhost [127.0.0.1]) by mx3v3.cudamail.com (Postfix) with ESMTPS id 2AEBA161375 for ; Thu, 21 Jul 2016 12:14:41 -0600 (MDT) X-ASG-Debug-ID: 1469124880-0b3237452c217450001-byXFYA Received: from mx3-pf2.cudamail.com ([192.168.14.1]) by bar6.cudamail.com with ESMTP id 2AUCwBqcBBFthHFo (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 21 Jul 2016 12:14:40 -0600 (MDT) X-Barracuda-Envelope-From: cascardo@redhat.com X-Barracuda-RBL-Trusted-Forwarder: 192.168.14.1 Received: from unknown (HELO mx1.redhat.com) (209.132.183.28) by mx3-pf2.cudamail.com with ESMTPS (DHE-RSA-AES256-SHA encrypted); 21 Jul 2016 18:14:40 -0000 Received-SPF: pass (mx3-pf2.cudamail.com: SPF record at _spf1.redhat.com designates 209.132.183.28 as permitted sender) X-Barracuda-Apparent-Source-IP: 209.132.183.28 X-Barracuda-RBL-IP: 209.132.183.28 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 10E977EA89 for ; Thu, 21 Jul 2016 18:14:40 +0000 (UTC) Received: from indiana.gru.redhat.com (ovpn-116-65.phx2.redhat.com [10.3.116.65]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u6LIEQij019357 for ; Thu, 21 Jul 2016 14:14:39 -0400 X-CudaMail-Envelope-Sender: cascardo@redhat.com From: Thadeu Lima de Souza Cascardo To: dev@openvswitch.org X-CudaMail-Whitelist-To: dev@openvswitch.org X-CudaMail-MID: CM-V2-720035123 X-CudaMail-DTE: 072116 X-CudaMail-Originating-IP: 209.132.183.28 Date: Thu, 21 Jul 2016 15:14:17 -0300 X-ASG-Orig-Subj: [##CM-V2-720035123##][PATCH 6/6] datapath: remove VLAN compat code from GSO Message-Id: <1469124857-30036-7-git-send-email-cascardo@redhat.com> In-Reply-To: <1469124857-30036-1-git-send-email-cascardo@redhat.com> References: <1469124857-30036-1-git-send-email-cascardo@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Thu, 21 Jul 2016 18:14:40 +0000 (UTC) X-Barracuda-Connect: UNKNOWN[192.168.14.1] X-Barracuda-Start-Time: 1469124880 X-Barracuda-Encrypted: DHE-RSA-AES256-SHA X-Barracuda-URL: https://web.cudamail.com:443/cgi-mod/mark.cgi X-ASG-Whitelist: Header =?UTF-8?B?eFwtY3VkYW1haWxcLXdoaXRlbGlzdFwtdG8=?= X-Virus-Scanned: by bsmtpd at cudamail.com X-Barracuda-BRTS-Status: 1 Subject: [ovs-dev] [PATCH 6/6] datapath: remove VLAN compat code from GSO X-BeenThere: dev@openvswitch.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dev-bounces@openvswitch.org Sender: "dev" This compatibility code was only needed for Linux 2.6.36 and older. With the support for versions older than 3.10 dropped, this code is not needed anymore. The style for checking for mpls was kept in case some other protocol type is added in the future. Signed-off-by: Thadeu Lima de Souza Cascardo --- datapath/linux/compat/gso.c | 29 +++-------------------------- 1 file changed, 3 insertions(+), 26 deletions(-) diff --git a/datapath/linux/compat/gso.c b/datapath/linux/compat/gso.c index 92f5441..32790c3 100644 --- a/datapath/linux/compat/gso.c +++ b/datapath/linux/compat/gso.c @@ -42,18 +42,6 @@ #include "gso.h" #ifdef OVS_USE_COMPAT_GSO_SEGMENTATION -static bool dev_supports_vlan_tx(struct net_device *dev) -{ -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37) - return true; -#elif defined(HAVE_VLAN_BUG_WORKAROUND) - return dev->features & NETIF_F_HW_VLAN_TX; -#else - /* Assume that the driver is buggy. */ - return false; -#endif -} - /* Strictly this is not needed and will be optimised out * as this code is guarded by if LINUX_VERSION_CODE < KERNEL_VERSION(3,19,0). * It is here to make things explicit should the compatibility @@ -75,9 +63,9 @@ int rpl_dev_queue_xmit(struct sk_buff *skb) { #undef dev_queue_xmit int err = -ENOMEM; - bool vlan, mpls; + bool mpls; - vlan = mpls = false; + mpls = false; /* Avoid traversing any VLAN tags that are present to determine if * the ethtype is MPLS. Instead compare the mac_len (end of L2) and @@ -86,22 +74,11 @@ int rpl_dev_queue_xmit(struct sk_buff *skb) if (skb->mac_len != skb_network_offset(skb) && !supports_mpls_gso()) mpls = true; - if (skb_vlan_tag_present(skb) && !dev_supports_vlan_tx(skb->dev)) - vlan = true; - - if (vlan || mpls) { + if (mpls) { int features; features = netif_skb_features(skb); - if (vlan) { - skb = vlan_insert_tag_set_proto(skb, skb->vlan_proto, - skb_vlan_tag_get(skb)); - if (unlikely(!skb)) - return err; - skb->vlan_tci = 0; - } - /* As of v3.11 the kernel provides an mpls_features field in * struct net_device which allows devices to advertise which * features its supports for MPLS. This value defaults to