From patchwork Thu Feb 9 00:50:21 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joe Stringer X-Patchwork-Id: 725890 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org 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 3vJfdF2hs6z9s2G for ; Thu, 9 Feb 2017 11:50:39 +1100 (AEDT) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id D2985BA3; Thu, 9 Feb 2017 00:50:35 +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 513E7B8C for ; Thu, 9 Feb 2017 00:50:34 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from relay6-d.mail.gandi.net (relay6-d.mail.gandi.net [217.70.183.198]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id AAD231E2 for ; Thu, 9 Feb 2017 00:50:33 +0000 (UTC) Received: from mfilter18-d.gandi.net (mfilter18-d.gandi.net [217.70.178.146]) by relay6-d.mail.gandi.net (Postfix) with ESMTP id 8DC03FB882 for ; Thu, 9 Feb 2017 01:50:32 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at mfilter18-d.gandi.net Received: from relay6-d.mail.gandi.net ([IPv6:::ffff:217.70.183.198]) by mfilter18-d.gandi.net (mfilter18-d.gandi.net [::ffff:10.0.15.180]) (amavisd-new, port 10024) with ESMTP id QJs3p8MdyIXg for ; Thu, 9 Feb 2017 01:50:31 +0100 (CET) X-Originating-IP: 208.91.1.34 Received: from carno.eng.vmware.com (unknown [208.91.1.34]) (Authenticated sender: joe@ovn.org) by relay6-d.mail.gandi.net (Postfix) with ESMTPSA id 8D61CFB887 for ; Thu, 9 Feb 2017 01:50:30 +0100 (CET) From: Joe Stringer To: dev@openvswitch.org Date: Wed, 8 Feb 2017 16:50:21 -0800 Message-Id: <20170209005021.2809-1-joe@ovn.org> X-Mailer: git-send-email 2.11.0 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] compat: Remove unused netdevice backport code. 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 Signed-off-by: Joe Stringer Acked-by: Jarno Rajahalme --- datapath/linux/compat/include/linux/netdevice.h | 5 -- datapath/linux/compat/netdevice.c | 71 ------------------------- 2 files changed, 76 deletions(-) diff --git a/datapath/linux/compat/include/linux/netdevice.h b/datapath/linux/compat/include/linux/netdevice.h index 9982fd7f686e..75315dc16e02 100644 --- a/datapath/linux/compat/include/linux/netdevice.h +++ b/datapath/linux/compat/include/linux/netdevice.h @@ -89,11 +89,6 @@ struct sk_buff *rpl_skb_gso_segment(struct sk_buff *skb, netdev_features_t featu } #endif -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,38) -#define netif_skb_features rpl_netif_skb_features -netdev_features_t rpl_netif_skb_features(struct sk_buff *skb); -#endif - #ifdef HAVE_NETIF_NEEDS_GSO_NETDEV #define netif_needs_gso rpl_netif_needs_gso static inline bool netif_needs_gso(struct sk_buff *skb, diff --git a/datapath/linux/compat/netdevice.c b/datapath/linux/compat/netdevice.c index e28b878eea16..c0ffbbd31bee 100644 --- a/datapath/linux/compat/netdevice.c +++ b/datapath/linux/compat/netdevice.c @@ -4,77 +4,6 @@ #include "gso.h" -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,38) -#ifndef HAVE_CAN_CHECKSUM_PROTOCOL -static bool can_checksum_protocol(netdev_features_t features, __be16 protocol) -{ - return ((features & NETIF_F_GEN_CSUM) || - ((features & NETIF_F_V4_CSUM) && - protocol == htons(ETH_P_IP)) || - ((features & NETIF_F_V6_CSUM) && - protocol == htons(ETH_P_IPV6)) || - ((features & NETIF_F_FCOE_CRC) && - protocol == htons(ETH_P_FCOE))); -} -#endif - -static inline int illegal_highdma(struct net_device *dev, struct sk_buff *skb) -{ -#ifdef CONFIG_HIGHMEM - int i; - - if (dev->features & NETIF_F_HIGHDMA) - return 0; - - for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) - if (PageHighMem(skb_shinfo(skb)->frags[i].page)) - return 1; - -#endif - return 0; -} - -static netdev_features_t harmonize_features(struct sk_buff *skb, - __be16 protocol, - netdev_features_t features) -{ - if (!can_checksum_protocol(features, protocol)) { - features &= ~NETIF_F_ALL_CSUM; - features &= ~NETIF_F_SG; - } else if (illegal_highdma(skb->dev, skb)) { - features &= ~NETIF_F_SG; - } - - return features; -} - -netdev_features_t rpl_netif_skb_features(struct sk_buff *skb) -{ - unsigned long vlan_features = skb->dev->vlan_features; - - __be16 protocol = skb->protocol; - netdev_features_t features = skb->dev->features; - - if (protocol == htons(ETH_P_8021Q)) { - struct vlan_ethhdr *veh = (struct vlan_ethhdr *)skb->data; - protocol = veh->h_vlan_encapsulated_proto; - } else if (!skb_vlan_tag_present(skb)) { - return harmonize_features(skb, protocol, features); - } - - features &= (vlan_features | NETIF_F_HW_VLAN_TX); - - if (protocol != htons(ETH_P_8021Q)) { - return harmonize_features(skb, protocol, features); - } else { - features &= NETIF_F_SG | NETIF_F_HIGHDMA | NETIF_F_FRAGLIST | - NETIF_F_GEN_CSUM | NETIF_F_HW_VLAN_TX; - return harmonize_features(skb, protocol, features); - } -} -EXPORT_SYMBOL_GPL(rpl_netif_skb_features); -#endif /* kernel version < 2.6.38 */ - #ifdef OVS_USE_COMPAT_GSO_SEGMENTATION struct sk_buff *rpl__skb_gso_segment(struct sk_buff *skb, netdev_features_t features,