From patchwork Wed Apr 20 20:51:00 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Duyck X-Patchwork-Id: 612841 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3qqvDg3RpWz9t3c for ; Thu, 21 Apr 2016 06:51:15 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=mirantis.com header.i=@mirantis.com header.b=jJ2okPqa; dkim-atps=neutral Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751555AbcDTUvL (ORCPT ); Wed, 20 Apr 2016 16:51:11 -0400 Received: from mail-pa0-f44.google.com ([209.85.220.44]:32842 "EHLO mail-pa0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751029AbcDTUvK (ORCPT ); Wed, 20 Apr 2016 16:51:10 -0400 Received: by mail-pa0-f44.google.com with SMTP id zm5so21276963pac.0 for ; Wed, 20 Apr 2016 13:51:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mirantis.com; s=google; h=subject:from:to:date:message-id:in-reply-to:references:user-agent :mime-version:content-transfer-encoding; bh=5R8PFBzHTyMfdiyJClncUi2DgkDRQPGbapsMXk7Cn4w=; b=jJ2okPqaKycesx31KjcP1ejPWDDTGtX6AIuvkOsVFeXQNbJ63D0c6IoGKffPAi3uiO 3oDNMzawlVRR8ofD0TAfJpAJrfgEcLpYVAcKznjn2gFaPmyWwpAlER/+DzgEBqPzJ8oO LA40REeB4YY9Pnswb3v0KRNSyK9ALtf3cFplk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:from:to:date:message-id:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=5R8PFBzHTyMfdiyJClncUi2DgkDRQPGbapsMXk7Cn4w=; b=ibrrTUEMjwZ5KY7zXrWw31TAxm2dKlnl6o9NSHFr/1pWAdgRwLg+ZVisYz9igW34hD BlmUV8TOUvSAVxXtk29kRgu5tx0KYWRIKvmVqpHGKJg2VkqPrpEZgNqexnSmyteq/lXg c2SQ43izBsT/cM0TE8SygBu/eTw6OWmhKwQ+hsbYL1vgM8ia8N3PfRgGMAoIMITIZ79x zjoCDWWNLsdwyzmLEC9LAbvMrZFvjbyBBwd56923mksPxz4da2I40SRV5Qkjt1Iynw0+ 0ir+r3oZ5qich2IpU4wWqMNeUxRea5KZc347utBdNse2HSRFhh2nNMTIVS5grubas/qq EqWA== X-Gm-Message-State: AOPr4FXCRVhrFv615TLXLO9Kc7lQqMWd1jLz4XL5PujjzEtaYe0ybsQb8MQXJR0mbyuNl422 X-Received: by 10.66.147.103 with SMTP id tj7mr15168335pab.72.1461185469730; Wed, 20 Apr 2016 13:51:09 -0700 (PDT) Received: from [192.168.1.143] (static-50-53-29-36.bvtn.or.frontiernet.net. [50.53.29.36]) by smtp.gmail.com with ESMTPSA id qb1sm33799115pac.44.2016.04.20.13.51.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 20 Apr 2016 13:51:09 -0700 (PDT) Subject: [net-next resubmit PATCH v2 3/3] net: Add support for IP ID mangling TSO in cases that require encapsulation From: Alexander Duyck To: netdev@vger.kernel.org, davem@davemloft.net, alexander.duyck@gmail.com Date: Wed, 20 Apr 2016 16:51:00 -0400 Message-ID: <20160420205100.4029.36793.stgit@ahduyck-xeon-server> In-Reply-To: <20160420204900.4029.42938.stgit@ahduyck-xeon-server> References: <20160420204900.4029.42938.stgit@ahduyck-xeon-server> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org This patch adds support for NETIF_F_TSO_MANGLEID if a given tunnel supports NETIF_F_TSO. This way if needed a device can then later enable the TSO with IP ID mangling and the tunnels on top of that device can then also make use of the IP ID mangling as well. Signed-off-by: Alexander Duyck --- net/core/dev.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/net/core/dev.c b/net/core/dev.c index 52d446b2cb99..6324bc9267f7 100644 --- a/net/core/dev.c +++ b/net/core/dev.c @@ -7029,8 +7029,19 @@ int register_netdevice(struct net_device *dev) if (!(dev->flags & IFF_LOOPBACK)) dev->hw_features |= NETIF_F_NOCACHE_COPY; + /* If IPv4 TCP segmentation offload is supported we should also + * allow the device to enable segmenting the frame with the option + * of ignoring a static IP ID value. This doesn't enable the + * feature itself but allows the user to enable it later. + */ if (dev->hw_features & NETIF_F_TSO) dev->hw_features |= NETIF_F_TSO_MANGLEID; + if (dev->vlan_features & NETIF_F_TSO) + dev->vlan_features |= NETIF_F_TSO_MANGLEID; + if (dev->mpls_features & NETIF_F_TSO) + dev->mpls_features |= NETIF_F_TSO_MANGLEID; + if (dev->hw_enc_features & NETIF_F_TSO) + dev->hw_enc_features |= NETIF_F_TSO_MANGLEID; /* Make NETIF_F_HIGHDMA inheritable to VLAN devices. */